diff options
author | Vijay Pai <vpai@google.com> | 2016-06-13 12:37:12 -0700 |
---|---|---|
committer | Vijay Pai <vpai@google.com> | 2016-06-13 12:37:12 -0700 |
commit | 488fd0ec3139cabea924bb5d5c249114d8b7ba1e (patch) | |
tree | b2718ddc6c5c9192d9d618350c79cca5867dc89b /tools/run_tests | |
parent | 97da6473b4a52579fc2f9ed03b56c8078daec6d0 (diff) |
Add an option --regex_exclude to block certain tests from running
Diffstat (limited to 'tools/run_tests')
-rwxr-xr-x | tools/run_tests/run_tests.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index f7282dddb8..4201402b06 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -776,6 +776,7 @@ argp.add_argument('-n', '--runs_per_test', default=1, type=runs_per_test_type, help='A positive integer or "inf". If "inf", all tests will run in an ' 'infinite loop. Especially useful in combination with "-f"') argp.add_argument('-r', '--regex', default='.*', type=str) +argp.add_argument('--regex_exclude', default='', type=str) argp.add_argument('-j', '--jobs', default=multiprocessing.cpu_count(), type=int) argp.add_argument('-s', '--slowdown', default=1.0, type=float) argp.add_argument('-f', '--forever', @@ -1187,7 +1188,9 @@ def _build_and_run( spec for language in languages for spec in language.test_specs() - if re.search(args.regex, spec.shortname)) + if (re.search(args.regex, spec.shortname) and + (args.regex_exclude == '' or + not re.search(args.regex_exclude, spec.shortname)))) # When running on travis, we want out test runs to be as similar as possible # for reproducibility purposes. if args.travis: |