FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.12] Display the sanitizer config in the regrtest header. (GH-105301) by miss-islington · Pull Request #105342 · python/cpython · GitHub

/ cpython Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
20 changes: 20 additions & 0 deletions Lib/test/libregrtest/main.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,26 @@ def display_header(self):
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,
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/support/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def check_sanitizer(*, address=False, memory=False, ub=False):
)
address_sanitizer = (
'-fsanitize=address' in _cflags or
'--with-memory-sanitizer' in _config_args
'--with-address-sanitizer' in _config_args
)
ub_sanitizer = (
'-fsanitize=undefined' in _cflags or
Expand Down

Back | FazBrowse Home | New Git URL