diff options
author | ilevy@chromium.org <ilevy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-13 04:09:27 +0000 |
---|---|---|
committer | ilevy@chromium.org <ilevy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-13 04:09:27 +0000 |
commit | 9324bff2ee61a20d1df733d20e8d196e69fcb417 (patch) | |
tree | b67067213278f170a0aa1100da6d03aea26776e8 /build | |
parent | c2aa4989cecd04f13fee109802f6384a49a0aa30 (diff) | |
download | chromium_src-9324bff2ee61a20d1df733d20e8d196e69fcb417.zip chromium_src-9324bff2ee61a20d1df733d20e8d196e69fcb417.tar.gz chromium_src-9324bff2ee61a20d1df733d20e8d196e69fcb417.tar.bz2 |
Add android buildbot support for exe tests
Add breakpad_unittests and sandbox_linux_unittests
to experimental test suites.
BUG=170530, 169416
NOTRY=True
Review URL: https://chromiumcodereview.appspot.com/12758002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187768 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rwxr-xr-x | build/android/buildbot/bb_device_steps.py | 12 | ||||
-rwxr-xr-x | build/android/buildbot/bb_run_bot.py | 39 | ||||
-rw-r--r-- | build/android/pylib/gtest/dispatch.py | 26 | ||||
-rw-r--r-- | build/android/pylib/gtest/gtest_config.py | 45 |
4 files changed, 74 insertions, 48 deletions
diff --git a/build/android/buildbot/bb_device_steps.py b/build/android/buildbot/bb_device_steps.py index 0743b53..4bc095d 100755 --- a/build/android/buildbot/bb_device_steps.py +++ b/build/android/buildbot/bb_device_steps.py @@ -134,8 +134,11 @@ def RunTestSuites(options, suites): if options.asan: args.append('--tool=asan') for suite in suites: - buildbot_report.PrintNamedStep(suite) - RunCmd(['build/android/run_tests.py', '-s', suite] + args) + buildbot_report.PrintNamedStep(suite.name) + cmd = ['build/android/run_tests.py', '-s', suite.name] + args + if suite.is_suite_exe: + cmd.append('--exe') + RunCmd(cmd) def RunBrowserTestSuite(options): """Manages an invocation of run_browser_tests.py. @@ -273,7 +276,10 @@ def MainTestWrapper(options): for test in INSTRUMENTATION_TESTS.itervalues(): RunInstrumentationSuite(options, test) if 'webkit' in options.test_filter: - RunTestSuites(options, ['webkit_unit_tests', 'TestWebKitAPI']) + RunTestSuites(options, [ + gtest_config.Apk('webkit_unit_tests'), + gtest_config.Apk('TestWebKitAPI'), + ]) RunWebkitLint(options.target) if 'webkit_layout' in options.test_filter: RunWebkitLayoutTests(options) diff --git a/build/android/buildbot/bb_run_bot.py b/build/android/buildbot/bb_run_bot.py index c623f66..f768c3f 100755 --- a/build/android/buildbot/bb_run_bot.py +++ b/build/android/buildbot/bb_run_bot.py @@ -23,7 +23,8 @@ GLOBAL_SLAVE_PROPS = {} BotConfig = collections.namedtuple( 'BotConfig', ['bot_id', 'bash_funs', 'test_obj', 'slave_props']) TestConfig = collections.namedtuple('Tests', ['tests', 'extra_args']) -Command = collections.namedtuple('Command', ['step_name', 'command']) +Command = collections.namedtuple( + 'Command', ['step_name', 'command', 'testing_cmd']) def GetCommands(options, bot_config): @@ -45,13 +46,20 @@ def GetCommands(options, bot_config): '--slave-properties=%s' % json.dumps(slave_props)] commands = [] - if bot_config.bash_funs: - bash_base = [ + def WrapWithBash(command): + """Wrap a bash command string with envsetup scripts.""" + return ['bash', '-exc', '; '.join([ '. build/android/buildbot/buildbot_functions.sh', - "bb_baseline_setup %s '%s'" % - (CHROME_SRC, "' '".join(property_args))] - commands.append(Command( - None, ['bash', '-exc', '; '.join(bash_base + bot_config.bash_funs)])) + 'bb_baseline_setup %s %s' % ( + CHROME_SRC, + ' '.join(map(pipes.quote, property_args))), + command]) + ] + + if bot_config.bash_funs: + # bash_funs command does not have a testing mode. + commands.append( + Command(None, WrapWithBash('; '.join(bot_config.bash_funs)), None)) test_obj = bot_config.test_obj if test_obj: @@ -61,7 +69,9 @@ def GetCommands(options, bot_config): run_test_cmd.extend(['-f', test]) if test_obj.extra_args: run_test_cmd.extend(test_obj.extra_args) - commands.append(Command('Run tests', run_test_cmd)) + commands.append(Command( + 'Run tests', + WrapWithBash(' '.join(map(pipes.quote, run_test_cmd))), run_test_cmd)) return commands @@ -188,13 +198,14 @@ def main(argv): sys.stdout.flush() env = None if options.TESTING: - # The bash command doesn't yet support the testing option. - if command[0] == 'bash': + if not command_obj.testing_cmd: continue - env = dict(os.environ) - env['BUILDBOT_TESTING'] = '1' - - return_code = subprocess.call(command, cwd=CHROME_SRC, env=env) + return_code = subprocess.call( + command_obj.testing_cmd, + cwd=CHROME_SRC, + env=dict(os.environ, BUILDBOT_TESTING='1')) + else: + return_code = subprocess.call(command, cwd=CHROME_SRC, env=env) if return_code != 0: return return_code diff --git a/build/android/pylib/gtest/dispatch.py b/build/android/pylib/gtest/dispatch.py index 3195401..3020947 100644 --- a/build/android/pylib/gtest/dispatch.py +++ b/build/android/pylib/gtest/dispatch.py @@ -33,28 +33,30 @@ def _FullyQualifiedTestSuites(exe, option_test_suite, build_type): '/tmp/chrome/src/out/Debug/content_unittests_apk/' 'content_unittests-debug.apk') """ + def GetQualifiedSuite(suite): + if suite.is_suite_exe: + relpath = suite.name + else: + # out/(Debug|Release)/$SUITE_apk/$SUITE-debug.apk + relpath = os.path.join(suite.name + '_apk', suite.name + '-debug.apk') + return suite.name, os.path.join(test_suite_dir, relpath) + test_suite_dir = os.path.join(cmd_helper.OutDirectory.get(), build_type) if option_test_suite: - all_test_suites = [option_test_suite] + all_test_suites = [gtest_config.Suite(exe, option_test_suite)] else: all_test_suites = gtest_config.STABLE_TEST_SUITES - if exe: - qualified_test_suites = [os.path.join(test_suite_dir, t) - for t in all_test_suites] - else: - # out/(Debug|Release)/$SUITE_apk/$SUITE-debug.apk - qualified_test_suites = [os.path.join(test_suite_dir, - t + '_apk', - t + '-debug.apk') - for t in all_test_suites] - for t, q in zip(all_test_suites, qualified_test_suites): + # List of tuples (suite_name, suite_path) + qualified_test_suites = map(GetQualifiedSuite, all_test_suites) + + for t, q in qualified_test_suites: if not os.path.exists(q): raise Exception('Test suite %s not found in %s.\n' 'Supported test suites:\n %s\n' 'Ensure it has been built.\n' % (t, q, gtest_config.STABLE_TEST_SUITES)) - return zip(all_test_suites, qualified_test_suites) + return qualified_test_suites def GetTestsFromDevice(runner): diff --git a/build/android/pylib/gtest/gtest_config.py b/build/android/pylib/gtest/gtest_config.py index 8512dc4..f5fdaac 100644 --- a/build/android/pylib/gtest/gtest_config.py +++ b/build/android/pylib/gtest/gtest_config.py @@ -4,31 +4,38 @@ """Configuration file for android gtest suites.""" +import collections + + +Suite = collections.namedtuple('Suite', ['is_suite_exe', 'name']) +Exe = lambda name : Suite(True, name) +Apk = lambda name : Suite(False, name) + + # Add new suites here before upgrading them to the stable list below. EXPERIMENTAL_TEST_SUITES = [ - # The JNI version of the sandbox_linux_unittests. Should be changed to - # 'sandbox_linux_unittests' once it can be run with --exe. - 'sandbox_linux_jni_unittests', + Exe('sandbox_linux_unittests'), + Exe('breakpad_unittests'), ] # Do not modify this list without approval of an android owner. # This list determines which suites are run by default, both for local # testing and on android trybots running on commit-queue. STABLE_TEST_SUITES = [ - 'TestWebKitAPI', - 'android_webview_unittests', - 'base_unittests', - 'cc_unittests', - 'components_unittests', - 'content_unittests', - 'gpu_unittests', - 'ipc_tests', - 'media_unittests', - 'net_unittests', - 'sql_unittests', - 'sync_unit_tests', - 'ui_unittests', - 'unit_tests', - 'webkit_compositor_bindings_unittests', - 'webkit_unit_tests', + Apk('TestWebKitAPI'), + Apk('android_webview_unittests'), + Apk('base_unittests'), + Apk('cc_unittests'), + Apk('components_unittests'), + Apk('content_unittests'), + Apk('gpu_unittests'), + Apk('ipc_tests'), + Apk('media_unittests'), + Apk('net_unittests'), + Apk('sql_unittests'), + Apk('sync_unit_tests'), + Apk('ui_unittests'), + Apk('unit_tests'), + Apk('webkit_compositor_bindings_unittests'), + Apk('webkit_unit_tests'), ] |