Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 36 additions & 3 deletions Lib/test/libregrtest/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def get_build_info():

config_args = sysconfig.get_config_var('CONFIG_ARGS') or ''
cflags = sysconfig.get_config_var('PY_CFLAGS') or ''
cflags_nodist = sysconfig.get_config_var('PY_CFLAGS_NODIST') or ''
cflags += ' ' + (sysconfig.get_config_var('PY_CFLAGS_NODIST') or '')
ldflags_nodist = sysconfig.get_config_var('PY_LDFLAGS_NODIST') or ''

build = []
Expand All @@ -313,16 +313,49 @@ def get_build_info():
# --with-pydebug
build.append('debug')

if '-DNDEBUG' in (cflags + cflags_nodist):
if '-DNDEBUG' in cflags:
build.append('without_assert')
else:
build.append('release')

if '--with-assertions' in config_args:
build.append('with_assert')
elif '-DNDEBUG' not in (cflags + cflags_nodist):
elif '-DNDEBUG' not in cflags:
build.append('with_assert')

# --enable-experimental-jit
tier2 = re.search('-D_Py_TIER2=([0-9]+)', cflags)
if tier2:
tier2 = int(tier2.group(1))

if not sys.flags.ignore_environment:
PYTHON_JIT = os.environ.get('PYTHON_JIT', '')
if PYTHON_JIT:
PYTHON_JIT = (PYTHON_JIT != '0')
else:
PYTHON_JIT = None

if tier2 == 1:
jit = 'JIT' # =yes
elif tier2 == 3:
if PYTHON_JIT:
jit = 'JIT=on'
else:
jit = 'JIT=off'
elif tier2 == 4:
jit = 'JIT=interpreter'
elif tier2 == 6: # Secret option
if PYTHON_JIT:
jit = 'JIT=interpreter-on'
else:
jit = 'JIT=interpreter-off'
elif '-D_Py_JIT' in cflags:
jit = 'JIT'
else:
jit = None
if jit:
build.append(jit)

# --enable-framework=name
framework = sysconfig.get_config_var('PYTHONFRAMEWORK')
if framework:
Expand Down
Loading