diff options
author | 2016-01-21 15:17:14 -0800 | |
---|---|---|
committer | 2016-01-21 15:17:14 -0800 | |
commit | ff6242b40181ab5ed857e9cc9e759e5ee7c09b50 (patch) | |
tree | df66b3685559727398d4090141023d2a4f8f9ae5 /tools | |
parent | 6734ae802c6600236d1ec5319cdd5c6790f2546f (diff) | |
parent | 81df68d6474ed2afb6cb95d8e180cf5d6ff33713 (diff) |
Merge pull request #4791 from ctiller/rtt2
Move build configs into build.yaml
Diffstat (limited to 'tools')
-rw-r--r-- | tools/run_tests/configs.json | 67 | ||||
-rwxr-xr-x | tools/run_tests/run_tests.py | 48 |
2 files changed, 75 insertions, 40 deletions
diff --git a/tools/run_tests/configs.json b/tools/run_tests/configs.json new file mode 100644 index 0000000000..769942df99 --- /dev/null +++ b/tools/run_tests/configs.json @@ -0,0 +1,67 @@ +[ + { + "config": "opt" + }, + { + "config": "basicprof" + }, + { + "config": "helgrind", + "timeout_multiplier": 20, + "tool_prefix": [ + "valgrind", + "--tool=helgrind" + ] + }, + { + "config": "asan-noleaks", + "environ": { + "ASAN_OPTIONS": "detect_leaks=0:color=always" + }, + "timeout_multiplier": 1.5 + }, + { + "config": "ubsan", + "timeout_multiplier": 1.5 + }, + { + "config": "dbg" + }, + { + "config": "stapprof" + }, + { + "config": "gcov" + }, + { + "config": "memcheck", + "timeout_multiplier": 10, + "tool_prefix": [ + "valgrind", + "--tool=memcheck", + "--leak-check=full" + ] + }, + { + "config": "asan", + "environ": { + "ASAN_OPTIONS": "suppressions=tools/asan_suppressions.txt:detect_leaks=1:color=always", + "LSAN_OPTIONS": "suppressions=tools/asan_suppressions.txt:report_objects=1" + }, + "timeout_multiplier": 1.5 + }, + { + "config": "tsan", + "environ": { + "TSAN_OPTIONS": "suppressions=tools/tsan_suppressions.txt:halt_on_error=1:second_deadlock_stack=1" + }, + "timeout_multiplier": 2 + }, + { + "config": "msan", + "timeout_multiplier": 1.5 + }, + { + "config": "mutrace" + } +] diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 61d8447112..f8b01021c8 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -31,6 +31,7 @@ """Run tests in parallel.""" import argparse +import ast import glob import hashlib import itertools @@ -66,15 +67,16 @@ def platform_string(): # SimpleConfig: just compile with CONFIG=config, and run the binary to test -class SimpleConfig(object): +class Config(object): - def __init__(self, config, environ=None, timeout_multiplier=1): + def __init__(self, config, environ=None, timeout_multiplier=1, tool_prefix=[]): if environ is None: environ = {} self.build_config = config self.allow_hashing = (config != 'gcov') self.environ = environ self.environ['CONFIG'] = config + self.tool_prefix = tool_prefix self.timeout_multiplier = timeout_multiplier def job_spec(self, cmdline, hash_targets, timeout_seconds=5*60, @@ -93,7 +95,7 @@ class SimpleConfig(object): actual_environ = self.environ.copy() for k, v in environ.iteritems(): actual_environ[k] = v - return jobset.JobSpec(cmdline=cmdline, + return jobset.JobSpec(cmdline=self.tool_prefix + cmdline, shortname=shortname, environ=actual_environ, cpu_cost=cpu_cost, @@ -104,27 +106,6 @@ class SimpleConfig(object): timeout_retries=3 if args.allow_flakes else 0) -# ValgrindConfig: compile with some CONFIG=config, but use valgrind to run -class ValgrindConfig(object): - - def __init__(self, config, tool, args=None): - if args is None: - args = [] - self.build_config = config - self.tool = tool - self.args = args - self.allow_hashing = False - - def job_spec(self, cmdline, hash_targets, cpu_cost=1.0): - return jobset.JobSpec(cmdline=['valgrind', '--tool=%s' % self.tool] + - self.args + cmdline, - shortname='valgrind %s' % cmdline[0], - hash_targets=None, - cpu_cost=cpu_cost, - flake_retries=5 if args.allow_flakes else 0, - timeout_retries=3 if args.allow_flakes else 0) - - def get_c_tests(travis, test_lang) : out = [] platforms_str = 'ci_platforms' if travis else 'platforms' @@ -530,22 +511,8 @@ class Build(object): # different configurations we can run under -_CONFIGS = { - 'dbg': SimpleConfig('dbg'), - 'opt': SimpleConfig('opt'), - 'tsan': SimpleConfig('tsan', timeout_multiplier=2, environ={ - 'TSAN_OPTIONS': 'suppressions=tools/tsan_suppressions.txt:halt_on_error=1:second_deadlock_stack=1'}), - 'msan': SimpleConfig('msan', timeout_multiplier=1.5), - 'ubsan': SimpleConfig('ubsan'), - 'asan': SimpleConfig('asan', timeout_multiplier=1.5, environ={ - 'ASAN_OPTIONS': 'suppressions=tools/asan_suppressions.txt:detect_leaks=1:color=always', - 'LSAN_OPTIONS': 'suppressions=tools/asan_suppressions.txt:report_objects=1'}), - 'asan-noleaks': SimpleConfig('asan', environ={ - 'ASAN_OPTIONS': 'detect_leaks=0:color=always'}), - 'gcov': SimpleConfig('gcov'), - 'memcheck': ValgrindConfig('valgrind', 'memcheck', ['--leak-check=full']), - 'helgrind': ValgrindConfig('dbg', 'helgrind') - } +with open('tools/run_tests/configs.json') as f: + _CONFIGS = dict((cfg['config'], Config(**cfg)) for cfg in ast.literal_eval(f.read())) _DEFAULT = ['opt'] @@ -1143,3 +1110,4 @@ else: if BuildAndRunError.POST_TEST in errors: exit_code |= 4 sys.exit(exit_code) + |