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', # So that android/java/java.gyp:base_java is built |
| 681 'base_unittests', |
| 682 ], |
| 683 'actions': [ |
| 684 { |
| 685 # Generate apk files (including source and antfile) from |
| 686 # a template, and builds them. |
| 687 'action_name': 'generate_and_build', |
| 688 'inputs': [ |
| 689 '../testing/android/generate_native_test.py', |
| 690 '<(PRODUCT_DIR)/lib.target/libbase_unittests.so', |
| 691 '<(PRODUCT_DIR)/chromium_base.jar' |
| 692 ], |
| 693 'outputs': [ |
| 694 '<(PRODUCT_DIR)/ChromeNativeTests_base_unittests-debug.apk', |
| 695 ], |
| 696 'action': [ |
| 697 '../testing/android/generate_native_test.py', |
| 698 '--native_library', |
| 699 '<(PRODUCT_DIR)/lib.target/libbase_unittests.so', |
| 700 '--jar', |
| 701 '<(PRODUCT_DIR)/chromium_base.jar', |
| 702 '--output', |
| 703 '<(PRODUCT_DIR)/base_unittests_apk', |
| 704 '--ant-args', |
| 705 '-DPRODUCT_DIR=<(PRODUCT_DIR)', |
| 706 '--ant-compile' |
| 707 ], |
| 708 }, |
| 709 ] |
| 710 }], |
| 711 }], |
658 ], | 712 ], |
659 } | 713 } |
OLD | NEW |