Allow to check explicit flags in assertflags.py
This commit is contained in:
parent
b8d9e52c94
commit
800608da2e
2 changed files with 8 additions and 1 deletions
|
|
@ -14,6 +14,9 @@ the last such option is the one that is effective."
|
||||||
import sys
|
import sys
|
||||||
import sysconfig
|
import sysconfig
|
||||||
|
|
||||||
|
# We will check all flags if none were requested
|
||||||
|
KEYS_TO_CHECK = sys.argv[2:] or list(sysconfig.get_config_vars().keys())
|
||||||
|
|
||||||
# The flags that currently don't have the -Og flag on the debug build
|
# The flags that currently don't have the -Og flag on the debug build
|
||||||
# and we consider it OK, because we don't know any better :)
|
# and we consider it OK, because we don't know any better :)
|
||||||
SKIP = [
|
SKIP = [
|
||||||
|
|
@ -26,9 +29,10 @@ SKIP = [
|
||||||
print('Expecting that {} is the last -O flag:\n'.format(sys.argv[1]))
|
print('Expecting that {} is the last -O flag:\n'.format(sys.argv[1]))
|
||||||
ret = 0
|
ret = 0
|
||||||
|
|
||||||
for key, flags in sysconfig.get_config_vars().items():
|
for key in KEYS_TO_CHECK:
|
||||||
if key in SKIP:
|
if key in SKIP:
|
||||||
continue
|
continue
|
||||||
|
flags = sysconfig.get_config_vars()[key]
|
||||||
if isinstance(flags, str):
|
if isinstance(flags, str):
|
||||||
oflags = [f for f in flags.split(' ') if f.startswith('-O')]
|
oflags = [f for f in flags.split(' ') if f.startswith('-O')]
|
||||||
if oflags and oflags[-1] != sys.argv[1]:
|
if oflags and oflags[-1] != sys.argv[1]:
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,9 @@
|
||||||
- debugflags:
|
- debugflags:
|
||||||
dir: flags
|
dir: flags
|
||||||
run: runuser testuser -c 'python3-debug ./assertflags.py -O0'
|
run: runuser testuser -c 'python3-debug ./assertflags.py -O0'
|
||||||
|
- debugflags_some:
|
||||||
|
dir: flags
|
||||||
|
run: runuser testuser -c 'python3-debug ./assertflags.py -O0 PY_STDMODULE_CFLAGS'
|
||||||
- marshalparser_compatibility:
|
- marshalparser_compatibility:
|
||||||
dir: marshalparser
|
dir: marshalparser
|
||||||
run: runuser testuser -c 'SAMPLE=10 test_marshalparser_compatibility.sh'
|
run: runuser testuser -c 'SAMPLE=10 test_marshalparser_compatibility.sh'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue