diff options
Diffstat (limited to 'test/lsan/lit.common.cfg')
-rw-r--r-- | test/lsan/lit.common.cfg | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/lsan/lit.common.cfg b/test/lsan/lit.common.cfg index b90c7ef4860f1..7020bd8473e55 100644 --- a/test/lsan/lit.common.cfg +++ b/test/lsan/lit.common.cfg @@ -32,6 +32,21 @@ else: lit_config.fatal("Unknown LSan test mode: %r" % lsan_lit_test_mode) config.name += config.name_suffix +# Platform-specific default LSAN_OPTIONS for lit tests. +default_lsan_opts = 'detect_leaks=1' +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_lsan_opts += ':abort_on_error=0' + default_lsan_opts += ':log_to_syslog=0' + +if default_lsan_opts: + config.environment['LSAN_OPTIONS'] = default_lsan_opts + default_lsan_opts += ':' +config.substitutions.append(('%env_lsan_opts=', + 'env LSAN_OPTIONS=' + default_lsan_opts)) + if lit.util.which('strace'): config.available_features.add('strace') |