Skip to content

Commit 5c7b979

Browse files
committed
Add allowed-to-fail CLI flag to round-tripping script
1 parent bd12199 commit 5c7b979

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

interp/src/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ struct Cli {
5454
/// of cycles specified with this option.
5555
#[arg(long)]
5656
max_steps: Option<u32>,
57+
58+
/// Mark this test as allowed to fail (ignored by interpreter, used by test harness)
59+
#[arg(long)]
60+
allowed_to_fail: bool,
5761
}
5862

5963
/// Examples (enables all tracing logs):

scripts/roundtrip_case.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ def format_monitor_trace_candidates(traces: list[list[str]]) -> str:
175175

176176

177177
def main() -> int:
178-
"""Execute one roundtrip check for a single `.tx` file."""
178+
"""Execute one roundtrip check for a single `.tx` file. If the
179+
interpreter fails with a non-zero exit code, the test is skipped."""
179180
parser = argparse.ArgumentParser(
180181
description="Run one roundtrip check for a single .tx file."
181182
)
@@ -185,8 +186,17 @@ def main() -> int:
185186
action="store_true",
186187
help="Do not delete the intermediate .fst waveform file after the check",
187188
)
189+
parser.add_argument(
190+
"--allowed-to-fail",
191+
action="store_true",
192+
help="Mark this test as allowed to fail (will be skipped)",
193+
)
188194
args_ns = parser.parse_args()
189195

196+
if args_ns.allowed_to_fail:
197+
print("SKIP: allowed to fail")
198+
return 0
199+
190200
tx_file = Path(args_ns.tx_file).resolve()
191201
if not tx_file.exists():
192202
return fail(f"Missing tx file: {tx_file}")

0 commit comments

Comments
 (0)