Skip to content

Commit

Permalink
Add test showing we don't run test normalizations after the global no…
Browse files Browse the repository at this point in the history
…rmalizations
  • Loading branch information
oli-obk committed Sep 8, 2024
1 parent 721ed1b commit 6386512
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/integrations/basic-fail/Cargo.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ tests/actual_tests_bless/no_main.rs ... FAILED
tests/actual_tests_bless/no_main_manual.rs ... FAILED
tests/actual_tests_bless/no_test.rs ... FAILED
tests/actual_tests_bless/non_top_level_configs.rs ... FAILED
tests/actual_tests_bless/normalization_override.rs ... ok
tests/actual_tests_bless/pass.rs ... ok
tests/actual_tests_bless/pass_with_annotation.rs ... FAILED
tests/actual_tests_bless/revised_revision.rs ... FAILED
Expand Down Expand Up @@ -1078,7 +1079,7 @@ FAILURES:
tests/actual_tests_bless/unknown_revision2.rs
tests/actual_tests_bless/wrong_diagnostic_code.rs

test result: FAIL. 23 failed; 24 passed; 3 ignored
test result: FAIL. 23 failed; 25 passed; 3 ignored

Building dependencies ... ok
tests/actual_tests_bless_yolo/revisions_bad.rs (revision `foo`) ... ok
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//@normalize-stderr-test: "NORMALIZATION_OVERRIDE" -> "SUCCESS"

// Test that the above normalization will be run after the default normalization set in ui_tests_bless.rs

fn main() {
asdf //~ ERROR: cannot find
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error[E0425]: cannot find value `asdf` in this scope
--> tests/actual_tests_bless/NORMALIZATION_OVERRIDE.rs:6:5
|
6 | asdf
| ^^^^ not found in this scope

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0425`.
4 changes: 4 additions & 0 deletions tests/integrations/basic-fail/tests/ui_tests_bless.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ fn main() -> ui_test::color_eyre::Result<()> {
config.stdout_filter("in ([0-9]m )?[0-9\\.]+s", "");
config.stderr_filter(r"[^ ]*/\.?cargo/registry/.*/", "$$CARGO_REGISTRY");
config.path_stderr_filter(&std::path::Path::new(path), "$DIR");

// This is part of a test: we want to make sure the base filters are run first
config.stderr_filter("normalization_override", "NORMALIZATION_OVERRIDE");

let _ = run_tests_generic(
vec![config],
default_file_filter,
Expand Down

0 comments on commit 6386512

Please sign in to comment.