diff options
author | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-20 17:01:02 +0000 |
---|---|---|
committer | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-20 17:01:02 +0000 |
commit | 8b9ba656c5186bd9a9f76380e9d602759ab6f327 (patch) | |
tree | fa464a80ce08e80d3206132643d32074cd09bd43 /tools/sharding_supervisor | |
parent | 5b38a521c6f9195d0e5514b8547c4e2263791a46 (diff) | |
download | chromium_src-8b9ba656c5186bd9a9f76380e9d602759ab6f327.zip chromium_src-8b9ba656c5186bd9a9f76380e9d602759ab6f327.tar.gz chromium_src-8b9ba656c5186bd9a9f76380e9d602759ab6f327.tar.bz2 |
Improve sharding_supervisor to look for special gtest args.
This is necessary for GPU tests that use both --gtest_filter and --run-manual.
R=csharp@chromium.org
BUG=180631
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/12939009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189318 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/sharding_supervisor')
-rwxr-xr-x | tools/sharding_supervisor/sharding_supervisor.py | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/tools/sharding_supervisor/sharding_supervisor.py b/tools/sharding_supervisor/sharding_supervisor.py index 6414a37..6c7edf8 100755 --- a/tools/sharding_supervisor/sharding_supervisor.py +++ b/tools/sharding_supervisor/sharding_supervisor.py @@ -13,11 +13,21 @@ ROOT_DIR = os.path.dirname( os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -def pop_gtest_output(args): - """Extracts --gtest_output from the args if present.""" - for index, arg in enumerate(args): - if arg.startswith('--gtest_output='): - return args.pop(index) +def pop_known_arguments(args): + """Extracts known arguments from the args if present.""" + rest = [] + run_test_cases_extra_args = [] + for arg in args: + if arg.startswith(('--gtest_filter=', '--gtest_output=')): + run_test_cases_extra_args.append(arg) + elif arg == '--run-manual': + run_test_cases_extra_args.append(arg) + elif arg == '--gtest_print_time': + # Ignore. + pass + else: + rest.append(arg) + return run_test_cases_extra_args, rest def main(): @@ -51,15 +61,12 @@ def main(): ] if options.timeout is not None: cmd.extend(['--timeout', str(options.timeout)]) - gtest_output = pop_gtest_output(args) - if gtest_output: - # It is important that --gtest_output appears before the '--' so it is - # properly processed by run_test_cases. - cmd.append(gtest_output) + + run_test_cases_extra_args, rest = pop_known_arguments(args) import run_test_cases # pylint: disable=F0401 - return run_test_cases.main(cmd + ['--'] + args) + return run_test_cases.main(cmd + run_test_cases_extra_args + ['--'] + rest) if __name__ == '__main__': |