]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-117889: Fix PGO test in test_peg_generator (#117893)
authorVictor Stinner <vstinner@python.org>
Mon, 15 Apr 2024 13:59:34 +0000 (15:59 +0200)
committerGitHub <noreply@github.com>
Mon, 15 Apr 2024 13:59:34 +0000 (13:59 +0000)
Reuse support.check_cflags_pgo() in test_peg_generator to check for
PGO build.

Log PGO_PROF_USE_FLAG in test.pythoninfo.

Lib/test/pythoninfo.py
Lib/test/test_peg_generator/test_c_parser.py

index 0cfd033bb637a7e47301fcc25b4b7cbea6f86796..1db9fb9537f888f09b1295d1eb25c9b23fa45363 100644 (file)
@@ -513,6 +513,7 @@ def collect_sysconfig(info_add):
         'MACHDEP',
         'MULTIARCH',
         'OPT',
+        'PGO_PROF_USE_FLAG',
         'PY_CFLAGS',
         'PY_CFLAGS_NODIST',
         'PY_CORE_LDFLAGS',
index 9e273e99e387a4c38e7532689468892b6f65d9e2..1411e55dd0f293ac665339d410346291d57bf792 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")