diff options
author | Gregory P. Smith <greg@krypto.org> | 2023-06-06 06:36:36 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-06 06:36:36 (GMT) |
commit | 852348ab65783601e0844b6647ea033668b45c11 (patch) | |
tree | a6057e85fcfebec7f091e230f6d59bcdf8f5f308 /Lib/test/libregrtest | |
parent | f04c16875b649e2c2b420eb146308d0206c7e527 (diff) | |
download | cpython-852348ab65783601e0844b6647ea033668b45c11.zip cpython-852348ab65783601e0844b6647ea033668b45c11.tar.gz cpython-852348ab65783601e0844b6647ea033668b45c11.tar.bz2 |
Display the sanitizer config in the regrtest header. (#105301)
Display the sanitizers present in libregrtest.
Having this in the CI output for tests with the relevant environment
variable displayed will help make it easier to do what we need to
create an equivalent local test run.
Diffstat (limited to 'Lib/test/libregrtest')
-rw-r--r-- | Lib/test/libregrtest/main.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index 3c3509d..9001ca3 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -526,6 +526,26 @@ class Regrtest: print("== CPU count:", cpu_count) print("== encodings: locale=%s, FS=%s" % (locale.getencoding(), sys.getfilesystemencoding())) + asan = support.check_sanitizer(address=True) + msan = support.check_sanitizer(memory=True) + ubsan = support.check_sanitizer(ub=True) + # This makes it easier to remember what to set in your local + # environment when trying to reproduce a sanitizer failure. + if asan or msan or ubsan: + names = [n for n in (asan and "address", + msan and "memory", + ubsan and "undefined behavior") + if n] + print(f"== sanitizers: {', '.join(names)}") + a_opts = os.environ.get("ASAN_OPTIONS") + if asan and a_opts is not None: + print(f"== ASAN_OPTIONS={a_opts}") + m_opts = os.environ.get("ASAN_OPTIONS") + if msan and m_opts is not None: + print(f"== MSAN_OPTIONS={m_opts}") + ub_opts = os.environ.get("UBSAN_OPTIONS") + if ubsan and ub_opts is not None: + print(f"== UBSAN_OPTIONS={ub_opts}") def no_tests_run(self): return not any((self.good, self.bad, self.skipped, self.interrupted, |