diff options
| author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-09-02 14:10:52 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-02 14:10:52 (GMT) |
| commit | 3b3a1a8e7ebbd824778d16fad457a3fa15a9f7e4 (patch) | |
| tree | 8f56647adbac5b9f91412d4c9403ad6e95b8e60d | |
| parent | 05dcc8160191dbf760157e2c9675dbbcc5edc674 (diff) | |
| download | cpython-3b3a1a8e7ebbd824778d16fad457a3fa15a9f7e4.zip cpython-3b3a1a8e7ebbd824778d16fad457a3fa15a9f7e4.tar.gz cpython-3b3a1a8e7ebbd824778d16fad457a3fa15a9f7e4.tar.bz2 | |
[3.13] gh-101525: Skip test_gdb if the binary is relocated by BOLT. (gh-118572) (#123601)
gh-101525: Skip test_gdb if the binary is relocated by BOLT. (gh-118572)
(cherry picked from commit f95fc4de115ae03d7aa6dece678240df085cb4f6)
Co-authored-by: Donghee Na <donghee.na@python.org>
| -rw-r--r-- | Lib/test/libregrtest/utils.py | 5 | ||||
| -rw-r--r-- | Lib/test/support/__init__.py | 9 | ||||
| -rw-r--r-- | Lib/test/test_gdb/__init__.py | 3 | ||||
| -rw-r--r-- | Misc/NEWS.d/next/Tests/2024-05-04-22-56-41.gh-issue-101525.LHK166.rst | 2 |
4 files changed, 19 insertions, 0 deletions
diff --git a/Lib/test/libregrtest/utils.py b/Lib/test/libregrtest/utils.py index f4d3b00..87246df 100644 --- a/Lib/test/libregrtest/utils.py +++ b/Lib/test/libregrtest/utils.py @@ -343,6 +343,11 @@ def get_build_info(): if support.check_cflags_pgo(): # PGO (--enable-optimizations) optimizations.append('PGO') + + if support.check_bolt_optimized(): + # BOLT (--enable-bolt) + optimizations.append('BOLT') + if optimizations: build.append('+'.join(optimizations)) diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index e00d3f8..ed23f73 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -866,6 +866,15 @@ def check_cflags_pgo(): return any(option in cflags_nodist for option in pgo_options) +def check_bolt_optimized(): + # Always return false, if the platform is WASI, + # because BOLT optimization does not support WASM binary. + if is_wasi: + return False + config_args = sysconfig.get_config_var('CONFIG_ARGS') or '' + return '--enable-bolt' in config_args + + Py_GIL_DISABLED = bool(sysconfig.get_config_var('Py_GIL_DISABLED')) def requires_gil_enabled(msg="needs the GIL enabled"): diff --git a/Lib/test/test_gdb/__init__.py b/Lib/test/test_gdb/__init__.py index 9955773..0dd7217 100644 --- a/Lib/test/test_gdb/__init__.py +++ b/Lib/test/test_gdb/__init__.py @@ -24,6 +24,9 @@ if not sysconfig.is_python_build(): if support.check_cflags_pgo(): raise unittest.SkipTest("test_gdb is not reliable on PGO builds") +if support.check_bolt_optimized(): + raise unittest.SkipTest("test_gdb is not reliable on BOLT optimized builds") + def load_tests(*args): return support.load_package_tests(os.path.dirname(__file__), *args) diff --git a/Misc/NEWS.d/next/Tests/2024-05-04-22-56-41.gh-issue-101525.LHK166.rst b/Misc/NEWS.d/next/Tests/2024-05-04-22-56-41.gh-issue-101525.LHK166.rst new file mode 100644 index 0000000..ae8001a --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2024-05-04-22-56-41.gh-issue-101525.LHK166.rst @@ -0,0 +1,2 @@ +Skip ``test_gdb`` if the binary is relocated by BOLT. +Patch by Donghee Na. |
