]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-117889: Fix PGO test in test_peg_generator (GH-117893) (#117895)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 15 Apr 2024 14:15:30 +0000 (16:15 +0200)
committerGitHub <noreply@github.com>
Mon, 15 Apr 2024 14:15:30 +0000 (14:15 +0000)
Reuse support.check_cflags_pgo() in test_peg_generator to check for
PGO build.

Log PGO_PROF_USE_FLAG in test.pythoninfo.
(cherry picked from commit 64cd6fc9a6a3c3c19091a1c81cbbe8994583017d)

Co-authored-by: Victor Stinner <vstinner@python.org>
Lib/test/pythoninfo.py
Lib/test/test_peg_generator/test_c_parser.py

index 74ebb5e5b8a2923f65ced63d8ee22b50e8757cd8..6efeaad8126db34a70ff35d6dea960948c368efd 100644 (file)
@@ -509,6 +509,7 @@ def collect_sysconfig(info_add):
         'MACHDEP',
         'MULTIARCH',
         'OPT',
+        'PGO_PROF_USE_FLAG',
         'PY_CFLAGS',
         'PY_CFLAGS_NODIST',
         'PY_CORE_LDFLAGS',
index f9105a9f23bd6d50409b7364ee78afed62550c21..eb31569c0307ed3d5ae019c53e64bbe03a366f22 100644 (file)
@@ -13,9 +13,7 @@ from test import support
 from test.support import os_helper, import_helper
 from test.support.script_helper import assert_python_ok
 
-_py_cflags_nodist = sysconfig.get_config_var("PY_CFLAGS_NODIST")
-_pgo_flag = sysconfig.get_config_var("PGO_PROF_USE_FLAG")
-if _pgo_flag and _py_cflags_nodist and _pgo_flag in _py_cflags_nodist:
+if support.check_cflags_pgo():
     raise unittest.SkipTest("peg_generator test disabled under PGO build")
 
 test_tools.skip_if_missing("peg_generator")