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

Unified Diff: ipc/ipc.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
Index: ipc/ipc.gyp
diff --git a/ipc/ipc.gyp b/ipc/ipc.gyp
index 9b38f77aaf2fcf0d28820cb9d53b8d4a93d5e07b..d82b7eff459bfc66019c1bf069935a661d71cc9d 100644
--- a/ipc/ipc.gyp
+++ b/ipc/ipc.gyp
@@ -32,7 +32,7 @@
'targets': [
{
'target_name': 'ipc_tests',
- 'type': 'executable',
+ 'type': '<(gtest_target_type)',
'dependencies': [
'ipc',
'../base/base.gyp:base',
@@ -63,6 +63,11 @@
'../build/linux/system.gyp:gtk',
],
}],
+ ['OS=="android" and "<(gtest_target_type)"=="shared_library"', {
+ 'dependencies': [
+ '../testing/android/native_test.gyp:native_test_native_code',
+ ],
+ }],
['os_posix == 1 and OS != "mac" and OS != "android"', {
'conditions': [
['linux_use_tcmalloc==1', {
@@ -87,4 +92,69 @@
],
},
],
+ 'conditions': [
+ # Special target to wrap a <(gtest_target_type)==shared_library
+ # ipc_tests into an android apk for execution.
+ # See base.gyp for TODO(jrg)s about this strategy.
bulach 2012/04/12 15:51:42 ditto..
+ ['OS=="android" and "<(gtest_target_type)"=="shared_library"', {
+ 'targets': [
+ {
+ 'target_name': 'ipc_tests_apk',
+ 'type': 'none',
+ 'dependencies': [
+ 'ipc_tests',
+ ],
+ 'actions': [
+ {
+ # Generate apk files (including source and antfile) from
+ # a template.
+ 'action_name': 'generate_ipc_tests_apk',
+ 'dependencies': [
+ 'base', # So that android/java/java.gyp:base_java is built
+ 'ipc_tests',
+ ],
+ 'inputs': [
+ '../testing/android/generate_native_test.py',
+ '<(PRODUCT_DIR)/lib.target/libipc_tests.so',
+ '<(PRODUCT_DIR)/chromium_base.jar'
+ ],
+ 'outputs': [
+ '<(PRODUCT_DIR)/ipc_tests_apk/AndroidManifest.xml'
+ ],
+ 'action': [
+ '../testing/android/generate_native_test.py',
+ '--native_library',
+ '<(PRODUCT_DIR)/lib.target/libipc_tests.so',
+ # TODO(jrg): find a better way to specify jar
+ # dependencies. Hard coding seems fragile.
+ '--jars',
+ '<(PRODUCT_DIR)/chromium_base.jar',
+ '--output',
+ '<(PRODUCT_DIR)/ipc_tests_apk'
+ ],
+ },
+ {
+ # Build the generated template file, wrapping the
+ # relevant .so and jar.
+ 'action_name': 'build_ipc_tests_apk',
+ 'dependencies': [
+ 'generate_ipc_tests_apk',
+ ],
+ 'inputs': [
+ '<(PRODUCT_DIR)/ipc_tests_apk/AndroidManifest.xml'
+ ],
+ 'outputs': [
+ '<(PRODUCT_DIR)/ChromeNativeTests_ipc_tests-debug.apk',
+ ],
+ 'action': [
+ 'ant',
+ '-DPRODUCT_DIR=<(PRODUCT_DIR)',
+ '-buildfile',
+ '<(PRODUCT_DIR)/ipc_tests_apk/native_test_apk.xml',
+ ]
+ },
+ ]
+ }],
+ }],
+ ],
}

Powered by Google App Engine
This is Rietveld 408576698