Skip to content

Commit

Permalink
Merge pull request #222 from oli-obk/abort
Browse files Browse the repository at this point in the history
Add an abort test
  • Loading branch information
oli-obk authored May 1, 2024
2 parents e0c0664 + 35ba24b commit e77e554
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
4 changes: 4 additions & 0 deletions tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ fn main() -> Result<()> {
"(/target/ui/tests/integrations/[^/]+).*debug/deps",
"$1/debug/deps",
);
// abort messages are different on macos
config.stdout_filter(r#" \(core dumped\)"#, "");
// abort messages are different on windows
config.stdout_filter(r#"exit status: 0xc0000409"#, "signal: 6 (SIGABRT)");

let text = ui_test::status_emitter::Text::from(args.format);

Expand Down
18 changes: 16 additions & 2 deletions tests/integrations/basic-fail/Cargo.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,10 @@ FAILURES:

test result: FAIL. 15 failed;

Building dependencies ... ok
tests/actual_tests_bless/abort.rs ... FAILED
tests/actual_tests_bless/aux_build_not_found.rs ... FAILED
tests/actual_tests_bless/aux_proc_macro_misuse.rs ... FAILED
Building dependencies ... ok
Building aux file tests/actual_tests_bless/auxiliary/the_proc_macro.rs ... ok
tests/actual_tests_bless/aux_proc_macro_no_main.rs ... FAILED
tests/actual_tests_bless/compile_flags_quotes.rs ... FAILED
Expand Down Expand Up @@ -497,6 +498,18 @@ tests/actual_tests_bless/unknown_revision.rs ... FAILED
tests/actual_tests_bless/unknown_revision2.rs ... FAILED
tests/actual_tests_bless/wrong_diagnostic_code.rs ... FAILED

FAILED TEST: tests/actual_tests_bless/abort.rs
command: "$CMD"

error: run(0) test got signal: 6 (SIGABRT), but expected 0
= note: the test was expected to run successfully

full stderr:

full stdout:



FAILED TEST: tests/actual_tests_bless/aux_build_not_found.rs
command: "$CMD"

Expand Down Expand Up @@ -1010,6 +1023,7 @@ full stdout:


FAILURES:
tests/actual_tests_bless/abort.rs
tests/actual_tests_bless/aux_build_not_found.rs
tests/actual_tests_bless/aux_proc_macro_misuse.rs
tests/actual_tests_bless/aux_proc_macro_no_main.rs
Expand All @@ -1032,7 +1046,7 @@ FAILURES:
tests/actual_tests_bless/unknown_revision2.rs
tests/actual_tests_bless/wrong_diagnostic_code.rs

test result: FAIL. 21 failed; 14 passed; 3 ignored;
test result: FAIL. 22 failed; 14 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,5 @@
//@run

fn main() {
std::process::abort();
}

0 comments on commit e77e554

Please sign in to comment.