diff options
author | cjhopman <cjhopman@chromium.org> | 2014-09-09 16:18:07 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-09 23:27:27 +0000 |
commit | e65ead8fb1a1976682356cf824445476584e70f0 (patch) | |
tree | 2184502b838fa9523a9f915bbc25be5bb1726cfe /testing | |
parent | e8dc2f1ff837e32b9d02d65ab520d16187450bf9 (diff) | |
download | chromium_src-e65ead8fb1a1976682356cf824445476584e70f0.zip chromium_src-e65ead8fb1a1976682356cf824445476584e70f0.tar.gz chromium_src-e65ead8fb1a1976682356cf824445476584e70f0.tar.bz2 |
Make base_unittests_apk actually work
This changes the "test" template to create a shared_library (instead of
an executable) on Android. After this, we can actually run
base_unittests with
`build/android/test_runner.py gtest -s base_unnittests`
as normal (though may need to CHROMIUM_OUT_DIR and BUILDTYPE as
appropriate).
This requires adding the following targets:
//testing/android:native_test_native_code
//testing/android:native_test_util
//testing/android:native_test_jni_headers
//tools/android/md5sum:md5sum
//tools/android/md5sum:md5sum_bin
//tools/android/md5sum:md5sum_prepare_dist
//tools/android/md5sum:md5sum_copy_host
Also, makes it so that native executables are stripped (just like shared
libraries). Adds a simple create_native_execuatable_dist template that
sets up a dist directory for the executable (see
build/android/gyp/native_app_dependencies.gyp).
BUG=359249
TBR=rlarocque
Review URL: https://codereview.chromium.org/557463002
Cr-Commit-Position: refs/heads/master@{#294032}
Diffstat (limited to 'testing')
-rw-r--r-- | testing/android/BUILD.gn | 40 | ||||
-rw-r--r-- | testing/android/native_test.gyp | 3 |
2 files changed, 43 insertions, 0 deletions
diff --git a/testing/android/BUILD.gn b/testing/android/BUILD.gn new file mode 100644 index 0000000..c26830c --- /dev/null +++ b/testing/android/BUILD.gn @@ -0,0 +1,40 @@ +# Copyright 2014 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. + +import("//build/config/android/rules.gni") + +# GYP: //testing/android/native_test.gyp:native_test_native_code +source_set("native_test_native_code") { + testonly = true + sources = [ + "native_test_launcher.cc" + ] + deps = [ + ":native_test_jni_headers", + ":native_test_util", + "//base", + "//base/test:test_support", + "//base/third_party/dynamic_annotations", + "//testing/gtest", + ] +} + +# GYP: //testing/android/native_test.gyp:native_test_jni_headers +generate_jni("native_test_jni_headers") { + sources = [ + "java/src/org/chromium/native_test/ChromeNativeTestActivity.java", + ] + jni_package = "testing" +} + +# GYP: //testing/android/native_test.gyp:native_test_util +source_set("native_test_util") { + sources = [ + "native_test_util.cc", + "native_test_util.h", + ] + deps = [ + "//base" + ] +} diff --git a/testing/android/native_test.gyp b/testing/android/native_test.gyp index 204ec4b..14f3229 100644 --- a/testing/android/native_test.gyp +++ b/testing/android/native_test.gyp @@ -7,6 +7,7 @@ ['OS=="android"', { 'targets': [ { + # GN: //testing/android:native_test_native_code 'target_name': 'native_test_native_code', 'message': 'building native pieces of native test package', 'type': 'static_library', @@ -30,6 +31,7 @@ ], }, { + # GN: //testing/android:native_test_jni_headers 'target_name': 'native_test_jni_headers', 'type': 'none', 'sources': [ @@ -41,6 +43,7 @@ 'includes': [ '../../build/jni_generator.gypi' ], }, { + # GN: //testing/android:native_test_util 'target_name': 'native_test_util', 'type': 'static_library', 'sources': [ |