summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_peg_generator
diff options
context:
space:
mode:
authorserge-sans-paille <serge.guelton@telecom-bretagne.eu>2020-11-04 23:01:08 (GMT)
committerGitHub <noreply@github.com>2020-11-04 23:01:08 (GMT)
commit100964e0310d3a2040d0db976f7984d0507b2dbd (patch)
treefbea10c8567345626a83c3591e29c3c7f4f0b190 /Lib/test/test_peg_generator
parent789359f47c2a744caa9a405131706099fd7ad6bd (diff)
downloadcpython-100964e0310d3a2040d0db976f7984d0507b2dbd.zip
cpython-100964e0310d3a2040d0db976f7984d0507b2dbd.tar.gz
cpython-100964e0310d3a2040d0db976f7984d0507b2dbd.tar.bz2
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.
Diffstat (limited to 'Lib/test/test_peg_generator')
-rw-r--r--Lib/test/test_peg_generator/test_c_parser.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_peg_generator/test_c_parser.py b/Lib/test/test_peg_generator/test_c_parser.py
index 0dffedc..67bb851 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
@@ -8,6 +9,11 @@ from test import support
from test.support import os_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:
+ 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