|
15 | 15 |
|
16 | 16 | reOPT = re.compile(r"^opt([0-9]+)_") # To detect -On tests |
17 | 17 | reBIN = re.compile(r"^(?:.*/)?(tzx|tap)_.*") # To detect tzx / tap test |
| 18 | +reIC = re.compile(r"^.*_IC$") # To detect intermediate code tests |
18 | 19 |
|
19 | 20 | EXIT_CODE = 0 |
20 | | -FILTER = r"^(([ \t]*;)|(#[ \t]*line))" |
| 21 | +FILTER = r"^(([ \t]*;)|(#[ \t]*line))|^\('inline',[ \t]+'#[ \t]*line .*'\)" |
21 | 22 | DEFAULT_ARCH = "zx48k" # Default testing architecture |
22 | 23 |
|
23 | 24 | # Global tests and failed counters |
@@ -233,11 +234,16 @@ def _get_testbas_options(fname: str) -> tuple[list[str], str, str]: |
233 | 234 | if match: |
234 | 235 | options.append("-O" + match.groups()[0]) |
235 | 236 |
|
236 | | - match = reBIN.match(getName(fname)) |
237 | | - if match and match.groups()[0].lower() in ("tzx", "tap"): |
238 | | - ext = match.groups()[0].lower() |
| 237 | + match_bin = reBIN.match(getName(fname)) |
| 238 | + match_ic = reIC.match(getName(fname)) |
| 239 | + if match_bin and match_bin.groups()[0].lower() in ("tzx", "tap"): |
| 240 | + ext = match_bin.groups()[0].lower() |
239 | 241 | tfname = os.path.join(TEMP_DIR, getName(fname) + os.extsep + ext) |
240 | 242 | options.extend(["--%s" % ext, fname, "-o", tfname, "-a", "-B"] + prep) |
| 243 | + elif match_ic: |
| 244 | + ext = "ic" |
| 245 | + tfname = os.path.join(TEMP_DIR, "test" + getName(fname) + os.extsep + ext) |
| 246 | + options.extend(["-E", fname, "-o", tfname] + prep) |
241 | 247 | else: |
242 | 248 | ext = "asm" |
243 | 249 | tfname = os.path.join(TEMP_DIR, "test" + getName(fname) + os.extsep + ext) |
@@ -406,7 +412,12 @@ def testBAS( |
406 | 412 | func = lambda: systemExec(syscmd) |
407 | 413 |
|
408 | 414 | with TempTestFile(func, tfname, keep_file=UPDATE): |
409 | | - result: bool | None = is_same_file(okfile, tfname, filter_, is_binary=reBIN.match(fname) is not None) |
| 415 | + result: bool | None = is_same_file( |
| 416 | + okfile, |
| 417 | + tfname, |
| 418 | + filter_, |
| 419 | + is_binary=reBIN.match(fname) is not None, |
| 420 | + ) |
410 | 421 | if UPDATE: |
411 | 422 | if not result: # File changed |
412 | 423 | if os.path.exists(okfile): |
|
0 commit comments