summaryrefslogtreecommitdiffstats
path: root/ipc/ipc.gyp
diff options
context:
space:
mode:
authorjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-19 21:02:09 +0000
committerjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-19 21:02:09 +0000
commitd9f9695633f8ea3dd1d4d02136c12cf2ffe429b8 (patch)
tree18b8981c285c249d714b079cafce988ad66d5f8d /ipc/ipc.gyp
parentd9426956e7653f57361544bfa9ff7cfd84590a5a (diff)
downloadchromium_src-d9f9695633f8ea3dd1d4d02136c12cf2ffe429b8.zip
chromium_src-d9f9695633f8ea3dd1d4d02136c12cf2ffe429b8.tar.gz
chromium_src-d9f9695633f8ea3dd1d4d02136c12cf2ffe429b8.tar.bz2
apk-based test runner work for android. 2 unit test bundles converted over (ipc, base).
OFF by default; enable with a gyp var. E.g. GYP_DEFINES="$GYP_DEFINES gtest_target_type=shared_library" android_gyp Some useful commands: adb uninstall org.chromium.native_test adb install -r out/Release/base_unittests_apk/ChromeNativeTests-debug.apk adb shell am start -n org.chromium.native_test/org.chromium.native_test.ChromeNativeTestActivity For the moment, all apks can be built simultaneously but use the same activity name. Thus you cannot have more than one installed at the same time. BUG=None TEST= Review URL: http://codereview.chromium.org/10051021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133053 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc.gyp')
-rw-r--r--ipc/ipc.gyp53
1 files changed, 51 insertions, 2 deletions
diff --git a/ipc/ipc.gyp b/ipc/ipc.gyp
index 9b38f77..e6b5116 100644
--- a/ipc/ipc.gyp
+++ b/ipc/ipc.gyp
@@ -1,4 +1,4 @@
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -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,48 @@
],
},
],
+ '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.
+ ['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, and builds them.
+ 'action_name': 'generate_and_build',
+ 'inputs': [
+ '../testing/android/generate_native_test.py',
+ '<(PRODUCT_DIR)/lib.target/libipc_tests.so',
+ '<(PRODUCT_DIR)/chromium_base.jar'
+ ],
+ 'outputs': [
+ '<(PRODUCT_DIR)/ChromeNativeTests_ipc_tests-debug.apk',
+ ],
+ '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.
+ '--jar',
+ '<(PRODUCT_DIR)/chromium_base.jar',
+ '--output',
+ '<(PRODUCT_DIR)/ipc_tests_apk',
+ '--ant-args',
+ '-DPRODUCT_DIR=<(PRODUCT_DIR)',
+ '--ant-compile'
+ ],
+ },
+ ],
+ }],
+ }],
+ ],
}