OLD | NEW |
---|---|
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 { | 5 { |
6 'variables': { | 6 'variables': { |
7 'chromium_code': 1, | 7 'chromium_code': 1, |
8 }, | 8 }, |
9 'includes': [ | 9 'includes': [ |
10 '../build/win_precompile.gypi', | 10 '../build/win_precompile.gypi', |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
146 'type': 'static_library', | 146 'type': 'static_library', |
147 'dependencies': [ | 147 'dependencies': [ |
148 'test_support_base', | 148 'test_support_base', |
149 ], | 149 ], |
150 'sources': [ | 150 'sources': [ |
151 'test/run_all_unittests.cc', | 151 'test/run_all_unittests.cc', |
152 ], | 152 ], |
153 }, | 153 }, |
154 { | 154 { |
155 'target_name': 'base_unittests', | 155 'target_name': 'base_unittests', |
156 'type': 'executable', | 156 'type': '<(gtest_target_type)', |
157 'sources': [ | 157 'sources': [ |
158 # Tests. | 158 # Tests. |
159 'android/jni_android_unittest.cc', | 159 'android/jni_android_unittest.cc', |
160 'android/scoped_java_ref_unittest.cc', | 160 'android/scoped_java_ref_unittest.cc', |
161 'at_exit_unittest.cc', | 161 'at_exit_unittest.cc', |
162 'atomicops_unittest.cc', | 162 'atomicops_unittest.cc', |
163 'base64_unittest.cc', | 163 'base64_unittest.cc', |
164 'bind_helpers_unittest.cc', | 164 'bind_helpers_unittest.cc', |
165 'bind_unittest.cc', | 165 'bind_unittest.cc', |
166 'bind_unittest.nc', | 166 'bind_unittest.nc', |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
327 # TODO(michaelbai): The below files are excluded because of the | 327 # TODO(michaelbai): The below files are excluded because of the |
328 # missing JNI and should be added back once JNI is ready. | 328 # missing JNI and should be added back once JNI is ready. |
329 'android/jni_android_unittest.cc', | 329 'android/jni_android_unittest.cc', |
330 'android/scoped_java_ref_unittest.cc', | 330 'android/scoped_java_ref_unittest.cc', |
331 'debug/stack_trace_unittest.cc', | 331 'debug/stack_trace_unittest.cc', |
332 ], | 332 ], |
333 'dependencies': [ | 333 'dependencies': [ |
334 'android/jni_generator/jni_generator.gyp:jni_generator_tests', | 334 'android/jni_generator/jni_generator.gyp:jni_generator_tests', |
335 ], | 335 ], |
336 }], | 336 }], |
337 ['OS=="android" and "<(gtest_target_type)"=="shared_library"', { | |
338 'dependencies': [ | |
339 '../testing/android/native_test.gyp:native_test_native_code', | |
340 ], | |
341 }], | |
337 ['use_glib==1', { | 342 ['use_glib==1', { |
338 'sources!': [ | 343 'sources!': [ |
339 'file_version_info_unittest.cc', | 344 'file_version_info_unittest.cc', |
340 ], | 345 ], |
341 'conditions': [ | 346 'conditions': [ |
342 [ 'linux_use_tcmalloc==1', { | 347 [ 'linux_use_tcmalloc==1', { |
343 'dependencies': [ | 348 'dependencies': [ |
344 'allocator/allocator.gyp:allocator', | 349 'allocator/allocator.gyp:allocator', |
345 ], | 350 ], |
346 }, | 351 }, |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
648 # build a stub dylib to provide these symbols at link time. | 653 # build a stub dylib to provide these symbols at link time. |
649 # This target is still useful to cause those symbols to be | 654 # This target is still useful to cause those symbols to be |
650 # treated as weak imports in dependents, who still must | 655 # treated as weak imports in dependents, who still must |
651 # #include closure_blocks_leopard_compat.h to get weak imports. | 656 # #include closure_blocks_leopard_compat.h to get weak imports. |
652 'type': 'none', | 657 'type': 'none', |
653 }], | 658 }], |
654 ], | 659 ], |
655 }, | 660 }, |
656 ], | 661 ], |
657 }], | 662 }], |
663 # Special target to wrap a <(gtest_target_type)==shared_library | |
664 # base_unittests into an android apk for execution. | |
665 # TODO(jrg): lib.target comes from _InstallableTargetInstallPath() | |
666 # in the gyp make generator. What is the correct way to extract | |
667 # this path from gyp and into 'raw' for input to antfiles? | |
668 # Hard-coding in the gypfile seems a poor choice. | |
669 # TODO(jrg): there has to be a shorter way to do all this. Try | |
670 # and convert this entire target cluster into ~5 lines that can be | |
671 # trivially copied to other projects with only a deps change, such | |
672 # as with a new gtest_target_type called | |
673 # 'shared_library_apk_wrapper' that does a lot of this magically. | |
674 ['OS=="android" and "<(gtest_target_type)"=="shared_library"', { | |
675 'targets': [ | |
676 { | |
677 'target_name': 'base_unittests_apk', | |
678 'type': 'none', | |
679 'dependencies': [ | |
680 'base_unittests', | |
681 ], | |
682 'actions': [ | |
683 { | |
684 # Generate apk files (including source and antfile) from | |
685 # a template. | |
686 'action_name': 'generate_base_unittests_apk', | |
687 'dependencies': [ | |
688 'base', # So that android/java/java.gyp:base_java is built | |
689 'base_unittests', | |
bulach
2012/04/12 15:51:42
not quite clear what's the benefit of having two a
John Grabowski
2012/04/13 01:11:37
I like 2 and 3.
I don't like 1; Chrome philosophy
| |
690 ], | |
691 'inputs': [ | |
692 '../testing/android/generate_native_test.py', | |
693 '<(PRODUCT_DIR)/lib.target/libbase_unittests.so', | |
694 '<(PRODUCT_DIR)/chromium_base.jar' | |
695 ], | |
696 'outputs': [ | |
697 '<(PRODUCT_DIR)/base_unittests_apk/AndroidManifest.xml' | |
698 ], | |
699 'action': [ | |
700 '../testing/android/generate_native_test.py', | |
701 '--native_library', | |
702 '<(PRODUCT_DIR)/lib.target/libbase_unittests.so', | |
703 '--jars', | |
704 '<(PRODUCT_DIR)/chromium_base.jar', | |
705 '--output', | |
706 '<(PRODUCT_DIR)/base_unittests_apk' | |
707 ], | |
708 }, | |
709 { | |
710 # Build the generated template file, wrapping the | |
711 # relevant .so and jar. | |
712 'action_name': 'build_base_unittests_apk', | |
713 'dependencies': [ | |
714 'generate_base_unittests_apk', | |
715 ], | |
716 'inputs': [ | |
717 '<(PRODUCT_DIR)/base_unittests_apk/AndroidManifest.xml' | |
718 ], | |
719 'outputs': [ | |
720 '<(PRODUCT_DIR)/ChromeNativeTests_base_unittests-debug.apk', | |
721 ], | |
722 'action': [ | |
723 'ant', | |
724 '-DPRODUCT_DIR=<(PRODUCT_DIR)', | |
725 '-buildfile', | |
726 '<(PRODUCT_DIR)/base_unittests_apk/native_test_apk.xml', | |
727 ] | |
728 }, | |
729 ] | |
730 }], | |
731 }], | |
658 ], | 732 ], |
659 } | 733 } |
OLD | NEW |