summaryrefslogtreecommitdiffstats
path: root/testing/android/native_test_apk.xml
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 /testing/android/native_test_apk.xml
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 'testing/android/native_test_apk.xml')
-rw-r--r--testing/android/native_test_apk.xml55
1 files changed, 55 insertions, 0 deletions
diff --git a/testing/android/native_test_apk.xml b/testing/android/native_test_apk.xml
new file mode 100644
index 0000000..bae45ce
--- /dev/null
+++ b/testing/android/native_test_apk.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+
+<project name="ChromeNativeTests" default="debug" basedir=".">
+
+ <description>
+ Building native test runner ChromeNativeTests_replaceme.apk
+ </description>
+
+ <property environment="env"/>
+ <property name="sdk.dir" location="${env.ANDROID_SDK_ROOT}"/>
+ <property name="sdk.version" value="${env.ANDROID_SDK_VERSION}"/>
+ <property name="src" location="."/>
+
+ <!-- TODO(jrg): although the source.dir setting points the android
+ antfiles to the correct location for finding our java, and our jars
+ are rebuilt when the java changes, a re-javac does not trigger a
+ re-package of our apk. Fix. -->
+ <property name="source.dir" location="java"/>
+
+ <property name="target" value="android-${env.ANDROID_SDK_VERSION}"/>
+
+ <condition property="location.base"
+ value="${sdk.dir}"
+ else="${sdk.dir}/platforms/android-${sdk.version}">
+ <isset property="env.ANDROID_BUILD_TOP"/>
+ </condition>
+
+ <!-- We expect PRODUCT_DIR to be set like the gyp var
+ (e.g. $ROOT/out/Debug) -->
+ <!-- TODO(jrg): ideally we need this to run before -build-setup, where
+ directories are made based on this variable. -->
+ <target name="-pre-build">
+ <if>
+ <condition>
+ <isset property="PRODUCT_DIR" />
+ </condition>
+ <else>
+ <fail message="PRODUCT_DIR env var not set?" />
+ </else>
+ </if>
+ </target>
+
+ <property name="out.dir" location="${PRODUCT_DIR}/replaceme_apk"/>
+
+ <!-- TODO(jrg): should I make this directory specific to the apk? -->
+ <property name="gen.absolute.dir" value="${out.dir}/gen"/>
+
+ <import file="${sdk.dir}/tools/ant/build.xml" />
+
+</project>