[Python-checkins] Disable peg generator tests when building with PGO (GH-23141)
miss-islington
webhook-mailer at python.org
Wed Nov 4 18:22:22 EST 2020
https://github.com/python/cpython/commit/3997a4e6bca18c7f220d6212ef1e86d8aa9c7aee
commit: 3997a4e6bca18c7f220d6212ef1e86d8aa9c7aee
branch: 3.9
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2020年11月04日T15:22:13-08:00
summary:
Disable peg generator tests when building with PGO (GH-23141)
Otherwise, when running the testsuite, test_peg_generator tries to compile C
code using the optimized flags and fails because it cannot find the profile
data.
(cherry picked from commit 100964e0310d3a2040d0db976f7984d0507b2dbd)
Co-authored-by: serge-sans-paille <serge.guelton at telecom-bretagne.eu>
files:
M Lib/test/test_peg_generator/test_c_parser.py
diff --git a/Lib/test/test_peg_generator/test_c_parser.py b/Lib/test/test_peg_generator/test_c_parser.py
index f9935258c861e..9701d4f9feb16 100644
--- a/Lib/test/test_peg_generator/test_c_parser.py
+++ b/Lib/test/test_peg_generator/test_c_parser.py
@@ -1,3 +1,4 @@
+import sysconfig
import textwrap
import unittest
from distutils.tests.support import TempdirManager
@@ -7,6 +8,11 @@
from test import support
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:
+ raise unittest.SkipTest("peg_generator test disabled under PGO build")
+
test_tools.skip_if_missing("peg_generator")
with test_tools.imports_under_tool("peg_generator"):
from pegen.grammar_parser import GeneratedParser as GrammarParser
More information about the Python-checkins
mailing list