Skip to content

Commit

Permalink
[3.12] pythongh-117889: Fix PGO test in test_peg_generator (pythonGH-…
Browse files Browse the repository at this point in the history
…117893) (python#117895)

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 64cd6fc)

Co-authored-by: Victor Stinner <vstinner@python.org>
  • Loading branch information
miss-islington and vstinner committed Apr 15, 2024
1 parent e7c7749 commit 6a4c06b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions Lib/test/pythoninfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ def collect_sysconfig(info_add):
'MACHDEP',
'MULTIARCH',
'OPT',
'PGO_PROF_USE_FLAG',
'PY_CFLAGS',
'PY_CFLAGS_NODIST',
'PY_CORE_LDFLAGS',
Expand Down
4 changes: 1 addition & 3 deletions Lib/test/test_peg_generator/test_c_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
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")
Expand Down

0 comments on commit 6a4c06b

Please sign in to comment.