diff options
Diffstat (limited to 'test/testrunner/testrunner.py')
| -rwxr-xr-x | test/testrunner/testrunner.py | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/test/testrunner/testrunner.py b/test/testrunner/testrunner.py index 2d1398e3fe..e8d4290d28 100755 --- a/test/testrunner/testrunner.py +++ b/test/testrunner/testrunner.py @@ -52,6 +52,8 @@ import json import multiprocessing import os import re +import shlex +import shutil import subprocess import sys import tempfile @@ -115,6 +117,7 @@ build = False gdb = False gdb_arg = '' runtime_option = '' +run_test_option = [] stop_testrunner = False dex2oat_jobs = -1 # -1 corresponds to default threads for dex2oat run_all_configs = False @@ -325,6 +328,8 @@ def run_tests(tests): if gdb_arg: options_all += ' --gdb-arg ' + gdb_arg + options_all += ' ' + ' '.join(run_test_option) + if runtime_option: for opt in runtime_option: options_all += ' --runtime-option ' + opt @@ -904,6 +909,7 @@ def parse_option(): global gdb global gdb_arg global runtime_option + global run_test_option global timeout global dex2oat_jobs global run_all_configs @@ -933,6 +939,12 @@ def parse_option(): global_group.set_defaults(build = env.ART_TEST_RUN_TEST_BUILD) global_group.add_argument('--gdb', action='store_true', dest='gdb') global_group.add_argument('--gdb-arg', dest='gdb_arg') + global_group.add_argument('--run-test-option', action='append', dest='run_test_option', + default=[], + help="""Pass an option, unaltered, to the run-test script. + This should be enclosed in single-quotes to allow for spaces. The option + will be split using shlex.split() prior to invoking run-test. + Example \"--run-test-option='--with-agent libtifast.so=MethodExit'\"""") global_group.add_argument('--runtime-option', action='append', dest='runtime_option', help="""Pass an option to the runtime. Runtime options starting with a '-' must be separated by a '=', for @@ -981,6 +993,8 @@ def parse_option(): if options['gdb_arg']: gdb_arg = options['gdb_arg'] runtime_option = options['runtime_option']; + run_test_option = sum(map(shlex.split, options['run_test_option']), []) + timeout = options['timeout'] if options['dex2oat_jobs']: dex2oat_jobs = options['dex2oat_jobs'] @@ -996,17 +1010,20 @@ def main(): if build: build_targets = '' if 'host' in _user_input_variants['target']: - build_targets += 'test-art-host-run-test-dependencies' + build_targets += 'test-art-host-run-test-dependencies ' if 'target' in _user_input_variants['target']: - build_targets += 'test-art-target-run-test-dependencies' + build_targets += 'test-art-target-run-test-dependencies ' if 'jvm' in _user_input_variants['target']: - build_targets += 'test-art-host-run-test-dependencies' + build_targets += 'test-art-host-run-test-dependencies ' build_command = 'make' build_command += ' DX=' build_command += ' -j' build_command += ' -C ' + env.ANDROID_BUILD_TOP build_command += ' ' + build_targets if subprocess.call(build_command.split()): + # Debugging for b/62653020 + if env.DIST_DIR: + shutil.copyfile(env.SOONG_OUT_DIR + '/build.ninja', env.DIST_DIR + '/soong.ninja') sys.exit(1) if user_requested_tests: test_runner_thread = threading.Thread(target=run_tests, args=(user_requested_tests,)) |