Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1541)

Unified Diff: base/base.gyp

Issue 10051021: apk-based test runner work for android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/android/jni_android.h ('k') | build/all_android.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/base.gyp
diff --git a/base/base.gyp b/base/base.gyp
index e070ee205f55ba6f43be813e0b588db70caac326..53e28034dbb769fb696165e56dd425ae9e6a025e 100644
--- a/base/base.gyp
+++ b/base/base.gyp
@@ -128,7 +128,7 @@
},
{
'target_name': 'base_unittests',
- 'type': 'executable',
+ 'type': '<(gtest_target_type)',
'sources': [
# Tests.
'android/jni_android_unittest.cc',
@@ -313,6 +313,11 @@
'android/jni_generator/jni_generator.gyp:jni_generator_tests',
],
}],
+ ['OS=="android" and "<(gtest_target_type)"=="shared_library"', {
+ 'dependencies': [
+ '../testing/android/native_test.gyp:native_test_native_code',
+ ],
+ }],
['use_glib==1', {
'sources!': [
'file_version_info_unittest.cc',
@@ -628,5 +633,54 @@
},
],
}],
+ # Special target to wrap a <(gtest_target_type)==shared_library
+ # base_unittests into an android apk for execution.
+ # TODO(jrg): lib.target comes from _InstallableTargetInstallPath()
+ # in the gyp make generator. What is the correct way to extract
+ # this path from gyp and into 'raw' for input to antfiles?
+ # Hard-coding in the gypfile seems a poor choice.
+ # TODO(jrg): there has to be a shorter way to do all this. Try
+ # and convert this entire target cluster into ~5 lines that can be
+ # trivially copied to other projects with only a deps change, such
+ # as with a new gtest_target_type called
+ # 'shared_library_apk_wrapper' that does a lot of this magically.
+ ['OS=="android" and "<(gtest_target_type)"=="shared_library"', {
+ 'targets': [
+ {
+ 'target_name': 'base_unittests_apk',
+ 'type': 'none',
+ 'dependencies': [
+ 'base', # So that android/java/java.gyp:base_java is built
+ 'base_unittests',
+ ],
+ 'actions': [
+ {
+ # Generate apk files (including source and antfile) from
+ # a template, and builds them.
+ 'action_name': 'generate_and_build',
+ 'inputs': [
+ '../testing/android/generate_native_test.py',
+ '<(PRODUCT_DIR)/lib.target/libbase_unittests.so',
+ '<(PRODUCT_DIR)/chromium_base.jar'
+ ],
+ 'outputs': [
+ '<(PRODUCT_DIR)/ChromeNativeTests_base_unittests-debug.apk',
+ ],
+ 'action': [
+ '../testing/android/generate_native_test.py',
+ '--native_library',
+ '<(PRODUCT_DIR)/lib.target/libbase_unittests.so',
+ '--jar',
+ '<(PRODUCT_DIR)/chromium_base.jar',
+ '--output',
+ '<(PRODUCT_DIR)/base_unittests_apk',
+ '--ant-args',
+ '-DPRODUCT_DIR=<(PRODUCT_DIR)',
+ '--ant-compile'
+ ],
+ },
+ ]
+ }],
+ }],
],
}
« no previous file with comments | « base/android/jni_android.h ('k') | build/all_android.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698