Revert 128679 - Speculative revert. xcodebuilders hosed between r128678 - 128680 in GYP phse, this is the only change that touched GYP files.
apk-based test runner work. Not enabled yet. This CL is a combination of upstreaming, ndk/ant-ification, and other tweaks. BUG=None TEST= Review URL: http://codereview.chromium.org/9834037 TBR=jrg@chromium.org Review URL: https://chromiumcodereview.appspot.com/9852004 git-svn-id: http://src.chromium.org/svn/trunk/src/build@128685 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
Родитель
d168ae37cd
Коммит
962d5c4564
|
@ -35,19 +35,12 @@
|
|||
'../ipc/ipc.gyp:ipc_tests',
|
||||
'../net/net.gyp:net_unittests',
|
||||
'../third_party/WebKit/Source/WebKit/chromium/All.gyp:*',
|
||||
'../tools/android/fake_dns/fake_dns.gyp:fake_dns',
|
||||
'../tools/android/forwarder/forwarder.gyp:forwarder',
|
||||
# From here down: not added to run_tests.py yet.
|
||||
'../jingle/jingle.gyp:jingle_unittests',
|
||||
'../tools/android/fake_dns/fake_dns.gyp:fake_dns',
|
||||
'../tools/android/forwarder/forwarder.gyp:forwarder',
|
||||
'../media/media.gyp:media_unittests',
|
||||
],
|
||||
# The Native Test Runner is not on by default.
|
||||
'conditions': [
|
||||
['gtest_target_type=="shared_library"', {
|
||||
'dependencies': [
|
||||
'../base/base.gyp:native_test_apk',
|
||||
]
|
||||
}]],
|
||||
},
|
||||
{
|
||||
# Experimental / in-progress targets that are expected to fail
|
||||
|
|
|
@ -49,11 +49,8 @@ export ANDROID_TOOLCHAIN="${ANDROID_NDK_ROOT}/toolchains/arm-linux-androideabi-4
|
|||
|
||||
export ANDROID_SDK_VERSION="15"
|
||||
|
||||
# Add Android SDK/NDK tools to system path.
|
||||
export PATH=$PATH:${ANDROID_NDK_ROOT}
|
||||
export PATH=$PATH:${ANDROID_SDK_ROOT}/tools
|
||||
export PATH=$PATH:${ANDROID_SDK_ROOT}/platform-tools
|
||||
|
||||
# Add Android SDK's platform-tools to system path.
|
||||
export PATH="${PATH}:${ANDROID_SDK_ROOT}/platform-tools/"
|
||||
|
||||
if [ ! -d "${ANDROID_TOOLCHAIN}" ]; then
|
||||
echo "Can not find Android toolchain in ${ANDROID_TOOLCHAIN}." >& 2
|
||||
|
|
|
@ -167,8 +167,7 @@ def RunTests(device, test_suite, gtest_filter, test_arguments, rebaseline,
|
|||
|
||||
if test_suite:
|
||||
global _TEST_SUITES
|
||||
if (not os.path.exists(test_suite) and
|
||||
not os.path.splitext(test_suite)[1] == '.apk'):
|
||||
if not os.path.exists(test_suite):
|
||||
logging.critical('Unrecognized test suite %s, supported: %s' %
|
||||
(test_suite, _TEST_SUITES))
|
||||
if test_suite in _TEST_SUITES:
|
||||
|
|
|
@ -9,7 +9,6 @@ import sys
|
|||
from base_test_runner import BaseTestRunner
|
||||
import debug_info
|
||||
import run_tests_helper
|
||||
from test_package_apk import TestPackageApk
|
||||
from test_package_executable import TestPackageExecutable
|
||||
from test_result import TestResults
|
||||
|
||||
|
@ -47,14 +46,6 @@ class SingleTestRunner(BaseTestRunner):
|
|||
self.dump_debug_info = None
|
||||
self.fast_and_loose = fast_and_loose
|
||||
|
||||
if os.path.splitext(test_suite)[1] == '.apk':
|
||||
self.test_package = TestPackageApk(self.adb, device,
|
||||
test_suite, timeout, rebaseline, performance_test, cleanup_test_files,
|
||||
tool, self.dump_debug_info)
|
||||
else:
|
||||
android_product_out = '.' # os.environ['ANDROID_PRODUCT_OUT']
|
||||
symbols_dir = os.path.join(android_product_out, 'symbols', 'data',
|
||||
'local')
|
||||
self.test_package = TestPackageExecutable(self.adb, device,
|
||||
test_suite, timeout, rebaseline, performance_test, cleanup_test_files,
|
||||
tool, self.dump_debug_info)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
||||
# Copyright (c) 2011 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.
|
||||
|
||||
|
@ -35,7 +35,6 @@ class TestPackage(object):
|
|||
performance_test, cleanup_test_files, tool, dump_debug_info):
|
||||
self.adb = adb
|
||||
self.device = device
|
||||
self.test_suite_full = test_suite
|
||||
self.test_suite = os.path.splitext(test_suite)[0]
|
||||
self.test_suite_basename = os.path.basename(self.test_suite)
|
||||
self.test_suite_dirname = os.path.dirname(self.test_suite)
|
||||
|
|
|
@ -1,89 +0,0 @@
|
|||
#!/usr/bin/python
|
||||
# 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.
|
||||
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
import cmd_helper
|
||||
import shutil
|
||||
import tempfile
|
||||
from test_package import TestPackage
|
||||
|
||||
|
||||
class TestPackageApk(TestPackage):
|
||||
"""A helper class for running APK-based native tests.
|
||||
|
||||
Args:
|
||||
adb: ADB interface the tests are using.
|
||||
device: Device to run the tests.
|
||||
test_suite: A specific test suite to run, empty to run all.
|
||||
timeout: Timeout for each test.
|
||||
rebaseline: Whether or not to run tests in isolation and update the filter.
|
||||
performance_test: Whether or not performance test(s).
|
||||
cleanup_test_files: Whether or not to cleanup test files on device.
|
||||
tool: Name of the Valgrind tool.
|
||||
dump_debug_info: A debug_info object.
|
||||
"""
|
||||
|
||||
APK_DATA_DIR = '/data/user/0/com.android.chrome.native_tests/files/'
|
||||
|
||||
def __init__(self, adb, device, test_suite, timeout, rebaseline,
|
||||
performance_test, cleanup_test_files, tool,
|
||||
dump_debug_info):
|
||||
TestPackage.__init__(self, adb, device, test_suite, timeout,
|
||||
rebaseline, performance_test, cleanup_test_files,
|
||||
tool, dump_debug_info)
|
||||
|
||||
def _CreateTestRunnerScript(self, options):
|
||||
tool_wrapper = self.tool.GetTestWrapper()
|
||||
if tool_wrapper:
|
||||
raise RuntimeError("TestPackageApk does not support custom wrappers.")
|
||||
command_line_file = tempfile.NamedTemporaryFile()
|
||||
# GTest expects argv[0] to be the executable path.
|
||||
command_line_file.write(self.test_suite_basename + ' ' + options)
|
||||
command_line_file.flush()
|
||||
self.adb.PushIfNeeded(command_line_file.name,
|
||||
TestPackageApk.APK_DATA_DIR +
|
||||
'chrome-native-tests-command-line')
|
||||
|
||||
def _GetGTestReturnCode(self):
|
||||
return None
|
||||
|
||||
def GetAllTests(self):
|
||||
"""Returns a list of all tests available in the test suite."""
|
||||
self._CreateTestRunnerScript('--gtest_list_tests')
|
||||
self.adb.RunShellCommand(
|
||||
'am start -n '
|
||||
'com.android.chrome.native_tests/'
|
||||
'android.app.NativeActivity')
|
||||
stdout_file = tempfile.NamedTemporaryFile()
|
||||
ret = []
|
||||
self.adb.Adb().Pull(TestPackageApk.APK_DATA_DIR + 'stdout.txt',
|
||||
stdout_file.name)
|
||||
ret = self._ParseGTestListTests(stdout_file)
|
||||
return ret
|
||||
|
||||
def CreateTestRunnerScript(self, gtest_filter, test_arguments):
|
||||
self._CreateTestRunnerScript('--gtest_filter=%s %s' % (gtest_filter,
|
||||
test_arguments))
|
||||
|
||||
def RunTestsAndListResults(self):
|
||||
self.adb.StartMonitoringLogcat(clear=True, logfile=sys.stdout)
|
||||
# TODO(jrg): make the activity name a function of the test.
|
||||
self.adb.RunShellCommand(
|
||||
'am start -n '
|
||||
'org.chromium.native_test/'
|
||||
'org.chromium.native_test.ChromeNativeTestActivity')
|
||||
return self._WatchTestOutput(self.adb.GetMonitoredLogCat())
|
||||
|
||||
def StripAndCopyExecutable(self):
|
||||
# TODO(jrg): downstream we would package up the .so into the apk
|
||||
# and rebuild. (Yikes!) We need to do something more kosher,
|
||||
# such as assembly at build time. E.g. building base_unittests
|
||||
# will build a libbase_unittests.apk that contains
|
||||
# libbbase_unittests.so, and avoid a "naked" ChromeNativeTests.apk.
|
||||
self.adb.Adb().SendCommand('install -r ' + self.test_suite_full,
|
||||
timeout_time=60*5)
|
11
common.gypi
11
common.gypi
|
@ -789,9 +789,9 @@
|
|||
'notifications%': 0,
|
||||
|
||||
# Builds the gtest targets as a shared_library.
|
||||
# TODO(jrg): when 'gtest_target_type'=='shared_libary' and OS==android,
|
||||
# make all gtest_targets depend on base/base.gyp:native_test_apk.
|
||||
### 'gtest_target_type': 'shared_libary',
|
||||
# TODO(michaelbai): Use the fixed value 'shared_library' once it
|
||||
# is fully supported.
|
||||
'gtest_target_type%': '<(gtest_target_type)',
|
||||
|
||||
# Uses system APIs for decoding audio and video.
|
||||
'use_libffmpeg%': '0',
|
||||
|
@ -2356,11 +2356,6 @@
|
|||
'ldflags': [
|
||||
'-Wl,-shared,-Bsymbolic',
|
||||
],
|
||||
# Use of -nostdlib prevents the compiler from bringing
|
||||
# in crtbegin_dynamic.o et al, so we get an undefined
|
||||
# reference to ___dso_handle when building
|
||||
# gtest_target_type==shared_library.
|
||||
'ldflags!': [ '-nostdlib' ],
|
||||
}],
|
||||
],
|
||||
}],
|
||||
|
|
|
@ -71,6 +71,6 @@ then
|
|||
fi
|
||||
|
||||
# Install ant
|
||||
sudo apt-get install ant1.8
|
||||
sudo apt-get install ant
|
||||
|
||||
echo "install-build-deps-android.sh complete."
|
||||
|
|
Загрузка…
Ссылка в новой задаче