Skip to content
Snippets Groups Projects
Commit 686fb26b authored by Craig Tiller's avatar Craig Tiller
Browse files

Allow language to be specified to run_tests.py

parent ec0b8f3f
No related branches found
No related tags found
No related merge requests found
...@@ -46,7 +46,10 @@ _CONFIGS = { ...@@ -46,7 +46,10 @@ _CONFIGS = {
_DEFAULT = ['dbg', 'opt'] _DEFAULT = ['dbg', 'opt']
_MAKE_TEST_TARGETS = ['buildtests_c', 'buildtests_cxx'] _LANGUAGE_TEST_TARGETS = {
'c++': 'buildtests_cxx',
'c': 'buildtests_c',
}
# parse command line # parse command line
argp = argparse.ArgumentParser(description='Run grpc tests.') argp = argparse.ArgumentParser(description='Run grpc tests.')
...@@ -64,6 +67,10 @@ argp.add_argument('--newline_on_success', ...@@ -64,6 +67,10 @@ argp.add_argument('--newline_on_success',
default=False, default=False,
action='store_const', action='store_const',
const=True) const=True)
argp.add_argument('-l', '--language',
choices=sorted(_LANGUAGE_TEST_TARGETS.keys()),
nargs='+',
default=sorted(_LANGUAGE_TEST_TARGETS.keys()))
args = argp.parse_args() args = argp.parse_args()
# grab config # grab config
...@@ -72,6 +79,7 @@ run_configs = set(_CONFIGS[cfg] ...@@ -72,6 +79,7 @@ run_configs = set(_CONFIGS[cfg]
_CONFIGS.iterkeys() if x == 'all' else [x] _CONFIGS.iterkeys() if x == 'all' else [x]
for x in args.config)) for x in args.config))
build_configs = set(cfg.build_config for cfg in run_configs) build_configs = set(cfg.build_config for cfg in run_configs)
make_targets = set(_LANGUAGE_TEST_TARGETS[x] for x in args.language)
filters = args.test_filter filters = args.test_filter
runs_per_test = args.runs_per_test runs_per_test = args.runs_per_test
forever = args.forever forever = args.forever
...@@ -83,7 +91,7 @@ def _build_and_run(check_cancelled, newline_on_success, forever=False): ...@@ -83,7 +91,7 @@ def _build_and_run(check_cancelled, newline_on_success, forever=False):
if not jobset.run( if not jobset.run(
(['make', (['make',
'-j', '%d' % (multiprocessing.cpu_count() + 1), '-j', '%d' % (multiprocessing.cpu_count() + 1),
'CONFIG=%s' % cfg] + _MAKE_TEST_TARGETS 'CONFIG=%s' % cfg] + list(make_targets)
for cfg in build_configs), for cfg in build_configs),
check_cancelled, maxjobs=1): check_cancelled, maxjobs=1):
return 1 return 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment