Skip to content

Commit a91f19f

Browse files
committed
Auto merge of #27869 - alexcrichton:libtest-panic, r=brson
This commit removes the call to `panic!("Some tests failed")` at the end of all tests run when running with libtest. The panic is replaced with `std::process::exit` to have a nonzero error code, but this change both: 1. Makes the test runner no longer print out the extraneous panic message at the end of a failing test run that some tests failed. (this is already summarized in the output of the test run). 2. When running tests with `RUST_BACKTRACE` set it removes an extraneous backtrace from the output (only failing tests will have their backtraces in the output.
2 parents 16cacbe + bfc4583 commit a91f19f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libtest/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ pub fn test_main(args: &[String], tests: Vec<TestDescAndFn> ) {
250250
};
251251
match run_tests_console(&opts, tests) {
252252
Ok(true) => {}
253-
Ok(false) => panic!("Some tests failed"),
253+
Ok(false) => std::process::exit(101),
254254
Err(e) => panic!("io error when running tests: {:?}", e),
255255
}
256256
}

0 commit comments

Comments
 (0)