File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,8 @@ ignore = false
4040# When the test passes in the future, it'll fail and alert that it now passes.
4141# This will not catch Ruffle panics; if the test is expected to panic, use
4242# `known_failure.panic = "panic message"`
43- # instead.
43+ # instead (note that 'panicky' tests will be skipped if the test harness is run
44+ # with debug assertions disabled, e.g. with `--release`).
4445known_failure = false
4546
4647# Path (relative to the directory containing test.toml) to the expected output
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ use std::collections::HashMap;
22
33use crate :: environment:: Environment ;
44use crate :: options:: TestOptions ;
5+ use crate :: options:: known_failure:: KnownFailure ;
56use crate :: runner:: TestRunner ;
67use crate :: util:: read_bytes;
78use anyhow:: { Result , anyhow} ;
@@ -145,6 +146,15 @@ impl Test {
145146 if ignore_known_failures && self . options . has_known_failure ( ) {
146147 return false ;
147148 }
149+
150+ // Panicky tests may expect to hit a debug assertion, so don't run them
151+ // if assertions are disabled.
152+ if !cfg ! ( debug_assertions)
153+ && matches ! ( self . options. known_failure, KnownFailure :: Panic { .. } )
154+ {
155+ return false ;
156+ }
157+
148158 self . options . required_features . can_run ( )
149159 && self
150160 . options
You can’t perform that action at this time.
0 commit comments