aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests/run_tests.py
diff options
context:
space:
mode:
authorGravatar Nicolas Noble <nnoble@google.com>2015-01-14 18:02:04 -0800
committerGravatar Nicolas Noble <nnoble@google.com>2015-01-14 18:02:04 -0800
commit594ef6c3b30fb2f592ff9372546185693ba3684a (patch)
tree3fd2df7329bc8f58e9bbb4266195d437133ce1a6 /tools/run_tests/run_tests.py
parent044db7422a83368aa44eb0bbdfbffef19b61a800 (diff)
parent93209643dd6fe96dd6165f70bffae7f8b3513632 (diff)
Merge remote-tracking branch 'google/master' into tweaks
Conflicts: tools/run_tests/run_tests.py
Diffstat (limited to 'tools/run_tests/run_tests.py')
-rwxr-xr-xtools/run_tests/run_tests.py31
1 files changed, 20 insertions, 11 deletions
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py
index 0e627d8f96..460a945cee 100755
--- a/tools/run_tests/run_tests.py
+++ b/tools/run_tests/run_tests.py
@@ -15,6 +15,7 @@ import watch_dirs
class SimpleConfig(object):
def __init__(self, config):
self.build_config = config
+ self.maxjobs = 32 * multiprocessing.cpu_count()
def run_command(self, binary):
return [binary]
@@ -22,11 +23,13 @@ class SimpleConfig(object):
# ValgrindConfig: compile with some CONFIG=config, but use valgrind to run
class ValgrindConfig(object):
- def __init__(self, config):
+ def __init__(self, config, tool):
self.build_config = config
+ self.tool = tool
+ self.maxjobs = 4 * multiprocessing.cpu_count()
def run_command(self, binary):
- return ['valgrind', binary]
+ return ['valgrind', binary, '--tool=%s' % self.tool]
# different configurations we can run under
@@ -37,7 +40,8 @@ _CONFIGS = {
'msan': SimpleConfig('msan'),
'asan': SimpleConfig('asan'),
'gcov': SimpleConfig('gcov'),
- 'valgrind': ValgrindConfig('dbg'),
+ 'memcheck': ValgrindConfig('dbg', 'memcheck'),
+ 'helgrind': ValgrindConfig('dbg', 'helgrind')
}
@@ -85,14 +89,19 @@ def _build_and_run(check_cancelled, newline_on_success, forever=False):
return 1
# run all the tests
- if not jobset.run((
- config.run_command(x)
- for config in run_configs
- for filt in filters
- for x in itertools.chain.from_iterable(itertools.repeat(
- glob.glob('bins/%s/%s_test' % (
- config.build_config, filt)),
- runs_per_test))), check_cancelled, newline_on_success=newline_on_success):
+ if not jobset.run(
+ itertools.ifilter(
+ lambda x: x is not None, (
+ config.run_command(x)
+ for config in run_configs
+ for filt in filters
+ for x in itertools.chain.from_iterable(itertools.repeat(
+ glob.glob('bins/%s/%s_test' % (
+ config.build_config, filt)),
+ runs_per_test)))),
+ check_cancelled,
+ newline_on_success=newline_on_success,
+ maxjobs=min(c.maxjobs for c in run_configs)):
if not forever:
jobset.message('FAILED', 'Some tests failed', do_newline=True)
return 2