mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
gh-111178: Skip test_perf_profiler on function sanitizer (#132020)
Add 'function' parameter to check_sanitizer() of test.support.
This commit is contained in:
parent
f20f02e6b5
commit
643dd5107c
2 changed files with 8 additions and 3 deletions
|
@ -409,7 +409,8 @@ def skip_if_buildbot(reason=None):
|
||||||
isbuildbot = False
|
isbuildbot = False
|
||||||
return unittest.skipIf(isbuildbot, reason)
|
return unittest.skipIf(isbuildbot, reason)
|
||||||
|
|
||||||
def check_sanitizer(*, address=False, memory=False, ub=False, thread=False):
|
def check_sanitizer(*, address=False, memory=False, ub=False, thread=False,
|
||||||
|
function=True):
|
||||||
"""Returns True if Python is compiled with sanitizer support"""
|
"""Returns True if Python is compiled with sanitizer support"""
|
||||||
if not (address or memory or ub or thread):
|
if not (address or memory or ub or thread):
|
||||||
raise ValueError('At least one of address, memory, ub or thread must be True')
|
raise ValueError('At least one of address, memory, ub or thread must be True')
|
||||||
|
@ -433,11 +434,15 @@ def check_sanitizer(*, address=False, memory=False, ub=False, thread=False):
|
||||||
'-fsanitize=thread' in cflags or
|
'-fsanitize=thread' in cflags or
|
||||||
'--with-thread-sanitizer' in config_args
|
'--with-thread-sanitizer' in config_args
|
||||||
)
|
)
|
||||||
|
function_sanitizer = (
|
||||||
|
'-fsanitize=function' in cflags
|
||||||
|
)
|
||||||
return (
|
return (
|
||||||
(memory and memory_sanitizer) or
|
(memory and memory_sanitizer) or
|
||||||
(address and address_sanitizer) or
|
(address and address_sanitizer) or
|
||||||
(ub and ub_sanitizer) or
|
(ub and ub_sanitizer) or
|
||||||
(thread and thread_sanitizer)
|
(thread and thread_sanitizer) or
|
||||||
|
(function and function_sanitizer)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ from test.support.os_helper import temp_dir
|
||||||
if not support.has_subprocess_support:
|
if not support.has_subprocess_support:
|
||||||
raise unittest.SkipTest("test module requires subprocess")
|
raise unittest.SkipTest("test module requires subprocess")
|
||||||
|
|
||||||
if support.check_sanitizer(address=True, memory=True, ub=True):
|
if support.check_sanitizer(address=True, memory=True, ub=True, function=True):
|
||||||
# gh-109580: Skip the test because it does crash randomly if Python is
|
# gh-109580: Skip the test because it does crash randomly if Python is
|
||||||
# built with ASAN.
|
# built with ASAN.
|
||||||
raise unittest.SkipTest("test crash randomly on ASAN/MSAN/UBSAN build")
|
raise unittest.SkipTest("test crash randomly on ASAN/MSAN/UBSAN build")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue