Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an abort test #222

Merged
merged 1 commit into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
}