Skip to content

Commit 50075d1

Browse files
committed
Add expect-warnings to zxbpp
1 parent 85d63cb commit 50075d1

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

src/libzxbpp/zxbpp.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,10 +865,13 @@ def entry_point(args=None):
865865
parser.add_argument('--arch', type=str, default=arch.AVAILABLE_ARCHITECTURES[0],
866866
help=f"Target architecture (defaults is'{arch.AVAILABLE_ARCHITECTURES[0]}'). "
867867
f"Available architectures: {','.join(arch.AVAILABLE_ARCHITECTURES)}")
868+
parser.add_argument('--expect-warnings', default=OPTIONS.expect_warnings, type=int,
869+
help='Expects N warnings: first N warnings will be silenced')
868870

869871
options = parser.parse_args(args=args)
870872
OPTIONS.Debug = options.debug
871873
OPTIONS.debug_zxbpp = OPTIONS.Debug > 0
874+
OPTIONS.expect_warnings = options.expect_warnings
872875

873876
if options.arch not in arch.AVAILABLE_ARCHITECTURES:
874877
parser.error(f"Invalid architecture '{options.arch}'")

tests/functional/test_errmsg.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,3 +180,4 @@ line_err.bas:5: error: Variable 'q' already declared at line_err.bas:1
180180
# Test warning silencing
181181
>>> process_file('mcleod3.bas', ['-S', '-q', '-O --expect-warnings=2'])
182182
mcleod3.bas:3: error: 'GenerateSpaces' is neither an array nor a function.
183+
>>> process_file('prepro77.bi', ['-S', '-q', '-O --expect-warnings=1'])

0 commit comments

Comments
 (0)