Skip to content

Commit faa3e95

Browse files
committed
tests: Mark known_failure tests with a ! in the runner's output
Example output: ``` test [!] from_gnash/misc-swfmill.all/zeroframe_definesprite ... ok test [!fp11] from_gnash/actionscript.all/argstest-v8 ... ok ```
1 parent 5ae3655 commit faa3e95

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

tests/tests/regression_tests.rs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,18 @@ fn load_test_dir<'a>(test_dir: &'a VfsPath, name: &'a str) -> impl Iterator<Item
104104

105105
fn trial_for_test(opts: &RuffleTestOpts, test: Test, list_only: bool) -> Trial {
106106
let ignore = !test.should_run(opts.ignore_known_failures, !list_only, &NativeEnvironment);
107-
let subtest_name = test.options.subtest_name.clone();
108107

109-
let mut trial = Trial::test(test.name.clone(), move || {
108+
// Put extra info into the test 'kind' instead of appending it to the test name,
109+
// to not break `cargo test some/test -- --exact` and `cargo test -- --list`.
110+
let mut test_kind = String::new();
111+
if test.options.known_failure {
112+
test_kind.push('!');
113+
}
114+
if let Some(name) = &test.options.subtest_name {
115+
test_kind.push_str(name);
116+
}
117+
118+
let trial = Trial::test(test.name.clone(), move || {
110119
let test = AssertUnwindSafe(test);
111120
let unwind_result = catch_unwind(|| {
112121
let mut runner = test.create_test_runner(&NativeEnvironment)?;
@@ -136,13 +145,6 @@ fn trial_for_test(opts: &RuffleTestOpts, test: Test, list_only: bool) -> Trial {
136145
}
137146
}
138147
});
139-
if ignore {
140-
trial = trial.with_ignored_flag(true);
141-
}
142-
if let Some(name) = subtest_name {
143-
// Put the subtest name as the test 'kind' instead of appending it to the test name,
144-
// to not break `cargo test some/test -- --exact` and `cargo test -- --list`.
145-
trial = trial.with_kind(name);
146-
}
147-
trial
148+
149+
trial.with_ignored_flag(ignore).with_kind(test_kind)
148150
}

0 commit comments

Comments
 (0)