Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit852348a

Browse files
authored
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 environmentvariable displayed will help make it easier to do what we need tocreate an equivalent local test run.
1 parentf04c168 commit852348a

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

‎Lib/test/libregrtest/main.py‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,26 @@ def display_header(self):
526526
print("== CPU count:",cpu_count)
527527
print("== encodings: locale=%s, FS=%s"
528528
% (locale.getencoding(),sys.getfilesystemencoding()))
529+
asan=support.check_sanitizer(address=True)
530+
msan=support.check_sanitizer(memory=True)
531+
ubsan=support.check_sanitizer(ub=True)
532+
# This makes it easier to remember what to set in your local
533+
# environment when trying to reproduce a sanitizer failure.
534+
ifasanormsanorubsan:
535+
names= [nfornin (asanand"address",
536+
msanand"memory",
537+
ubsanand"undefined behavior")
538+
ifn]
539+
print(f"== sanitizers:{', '.join(names)}")
540+
a_opts=os.environ.get("ASAN_OPTIONS")
541+
ifasananda_optsisnotNone:
542+
print(f"== ASAN_OPTIONS={a_opts}")
543+
m_opts=os.environ.get("ASAN_OPTIONS")
544+
ifmsanandm_optsisnotNone:
545+
print(f"== MSAN_OPTIONS={m_opts}")
546+
ub_opts=os.environ.get("UBSAN_OPTIONS")
547+
ifubsanandub_optsisnotNone:
548+
print(f"== UBSAN_OPTIONS={ub_opts}")
529549

530550
defno_tests_run(self):
531551
returnnotany((self.good,self.bad,self.skipped,self.interrupted,

‎Lib/test/support/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ def check_sanitizer(*, address=False, memory=False, ub=False):
414414
)
415415
address_sanitizer= (
416416
'-fsanitize=address'in_cflagsor
417-
'--with-memory-sanitizer'in_config_args
417+
'--with-address-sanitizer'in_config_args
418418
)
419419
ub_sanitizer= (
420420
'-fsanitize=undefined'in_cflagsor

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp