diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2017-10-06 20:53:40 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2017-10-06 20:53:40 +0000 |
commit | 8501b0e87655065c6668db3eac37ea08bd4f712f (patch) | |
tree | 97d7bd7f2a7a3236b602706cabf5b2dbbfe1ca36 /test/asan/lit.cfg | |
parent | e9b56a34017060f38e481ae24a23acf43043fb4f (diff) |
Factor out default_(a|ub)sanitizer_opts in lit.
Reviewers: vitalybuka
Subscribers: srhines, llvm-commits, kubamracek
Differential Revision: https://reviews.llvm.org/D38644
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315106 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/asan/lit.cfg')
-rw-r--r-- | test/asan/lit.cfg | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/test/asan/lit.cfg b/test/asan/lit.cfg index fc8daaaf0..ad4e6a49d 100644 --- a/test/asan/lit.cfg +++ b/test/asan/lit.cfg @@ -31,29 +31,19 @@ def push_dynamic_library_lookup_path(config, new_path): config.name = 'AddressSanitizer' + config.name_suffix # Platform-specific default ASAN_OPTIONS for lit tests. -default_asan_opts = '' -if config.host_os == 'Darwin': - # On Darwin, we default to `abort_on_error=1`, which would make tests run - # much slower. Let's override this and run lit tests with 'abort_on_error=0'. - # Also, make sure we do not overwhelm the syslog while testing. - default_asan_opts = 'abort_on_error=0' - default_asan_opts += ':log_to_syslog=0' - - # On Darwin, leak checking is not enabled by default. Enable for x86_64 - # tests to prevent regressions - if config.target_arch == 'x86_64': - default_asan_opts += ':detect_leaks=1' -elif config.android: - # The same as on Darwin, we default to "abort_on_error=1" which slows down - # testing. Also, all existing tests are using "not" instead of "not --crash" - # which does not work for abort()-terminated programs. - default_asan_opts = 'abort_on_error=0' - -if default_asan_opts: - config.environment['ASAN_OPTIONS'] = default_asan_opts - default_asan_opts += ':' +default_asan_opts = list(config.default_sanitizer_opts) + +# On Darwin, leak checking is not enabled by default. Enable for x86_64 +# tests to prevent regressions +if config.host_os == 'Darwin' and config.target_arch == 'x86_64': + default_asan_opts += ['detect_leaks=1'] + +default_asan_opts_str = ':'.join(default_asan_opts) +if default_asan_opts_str: + config.environment['ASAN_OPTIONS'] = default_asan_opts_str + default_asan_opts_str += ':' config.substitutions.append(('%env_asan_opts=', - 'env ASAN_OPTIONS=' + default_asan_opts)) + 'env ASAN_OPTIONS=' + default_asan_opts_str)) # Setup source root. config.test_source_root = os.path.dirname(__file__) |