Skip to content

Commit

Permalink
Allow language to be specified to run_tests.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ctiller committed Jan 15, 2015
1 parent ec0b8f3 commit 686fb26
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tools/run_tests/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ def run_command(self, binary):


_DEFAULT = ['dbg', 'opt']
_MAKE_TEST_TARGETS = ['buildtests_c', 'buildtests_cxx']
_LANGUAGE_TEST_TARGETS = {
'c++': 'buildtests_cxx',
'c': 'buildtests_c',
}

# parse command line
argp = argparse.ArgumentParser(description='Run grpc tests.')
Expand All @@ -64,6 +67,10 @@ def run_command(self, binary):
default=False,
action='store_const',
const=True)
argp.add_argument('-l', '--language',
choices=sorted(_LANGUAGE_TEST_TARGETS.keys()),
nargs='+',
default=sorted(_LANGUAGE_TEST_TARGETS.keys()))
args = argp.parse_args()

# grab config
Expand All @@ -72,6 +79,7 @@ def run_command(self, binary):
_CONFIGS.iterkeys() if x == 'all' else [x]
for x in args.config))
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
runs_per_test = args.runs_per_test
forever = args.forever
Expand All @@ -83,7 +91,7 @@ def _build_and_run(check_cancelled, newline_on_success, forever=False):
if not jobset.run(
(['make',
'-j', '%d' % (multiprocessing.cpu_count() + 1),
'CONFIG=%s' % cfg] + _MAKE_TEST_TARGETS
'CONFIG=%s' % cfg] + list(make_targets)
for cfg in build_configs),
check_cancelled, maxjobs=1):
return 1
Expand Down

0 comments on commit 686fb26

Please sign in to comment.