diff options
author | Craig Tiller <ctiller@google.com> | 2015-01-14 15:59:44 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-01-14 15:59:44 -0800 |
commit | d63b7896cc6509924548da2236bcfe77140bdb3e (patch) | |
tree | 44d685d8f39cc95fdb5bb02faa72617f828d16ee | |
parent | 1371abd306e33f87b8016a587e3decc73b3fafdf (diff) |
Helgrind support for run_tests.py
Also allow maxjobs to be tweaked based upon which configs are being run,
to prevent memory starvation.
-rwxr-xr-x | tools/run_tests/run_tests.py | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 2c27cd777a..eee6f0136d 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,17 +23,20 @@ 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] # SanConfig: compile with CONFIG=config, filter out incompatible binaries class SanConfig(object): def __init__(self, config): self.build_config = config + self.maxjobs = 16 * multiprocessing.cpu_count() def run_command(self, binary): if '_ssl_' in binary: @@ -47,7 +51,8 @@ _CONFIGS = { 'msan': SanConfig('msan'), 'asan': SanConfig('asan'), 'gcov': SimpleConfig('gcov'), - 'valgrind': ValgrindConfig('dbg'), + 'memcheck': ValgrindConfig('dbg', 'memcheck'), + 'helgrind': ValgrindConfig('dbg', 'helgrind') } @@ -91,15 +96,18 @@ def _build_and_run(check_cancelled): return 1 # run all the tests - 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): + 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, + maxjobs=min(c.maxjobs for c in run_configs)): return 2 return 0 |