Skip to content

Commit d541e7e

Browse files
committed
Test updated
Now warning codes are hidden by default.
1 parent ca41911 commit d541e7e

4 files changed

Lines changed: 8 additions & 2 deletions

File tree

tests/api/test_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def test_initted_values(self):
6262
'enableBreak',
6363
'expect_warnings',
6464
'explicit',
65+
'hide_warning_codes',
6566
'include_path',
6667
'inputFileName',
6768
'max_syntax_errors',

tests/functional/test_.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ def flush(self):
2020
sys.stdout.flush()
2121

2222

23-
def process_file(fname, params=None):
23+
def process_file(fname: str, params=None):
2424
if params is None:
2525
params = ['-S', '-q']
26+
if fname.lower().endswith('.bas'):
27+
params.append('-O --hide-warning-codes')
2628

2729
try:
2830
current_path = os.path.abspath(os.getcwd())

tests/functional/test_cmdline.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ usage: zxbc.py [-h] [-d] [-O OPTIMIZE] [-o OUTPUT_FILE] [-T] [-t] [-B] [-a]
1212
[--parse-only] [--append-binary APPEND_BINARY]
1313
[--append-headless-binary APPEND_HEADLESS_BINARY] [-N]
1414
[--arch ARCH] [--expect-warnings EXPECT_WARNINGS]
15-
[-W DISABLE_WARNING] [+W ENABLE_WARNING]
15+
[-W DISABLE_WARNING] [+W ENABLE_WARNING] [--hide-warning-codes]
1616
PROGRAM
1717
zxbc.py: error: Option --asm and --mmap cannot be used together
1818

tests/functional/test_errmsg.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,6 @@ line_err.bas:5: error: Variable 'q' already declared at line_err.bas:1
181181
>>> process_file('mcleod3.bas', ['-S', '-q', '-O --expect-warnings=2'])
182182
mcleod3.bas:3: error: 'GenerateSpaces' is neither an array nor a function.
183183
>>> process_file('prepro77.bi', ['-S', '-q', '-O --expect-warnings=1'])
184+
>>> process_file('doloop2.bas', ['-S', '-q', '-O -W110'])
185+
doloop2.bas:4: warning: [W100] Using default implicit type 'ubyte' for 'a'
186+
doloop2.bas:4: warning: [W150] Variable 'a' is never used

0 commit comments

Comments
 (0)