Skip to content

Commit 938baee

Browse files
committed
Fix prints of panics in gix-url baseline test
Due to [known-limitations][1] `libtest_mimic` can not capture the output of the tests it executes, which causes all panic messages from the asserts to be printed twice: during execution and in the test summary. Note that `cargo nextest` does not have this problem, because it captures output itself. The prints during execution are annoying because they brake the normal formatting of `cargo test` and because multiple tests run in parallel their output is mixed too. By setting a no-op panic hook we can avoid those prints. [1]: https://docs.rs/libtest-mimic/latest/libtest_mimic/#known-limitations-and-differences-to-the-official-test-harness
1 parent 163e139 commit 938baee

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

gix-url/tests/baseline/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ use bstr::ByteSlice;
22
use libtest_mimic::{Arguments, Failed, Trial};
33

44
fn main() {
5+
// We do not need to set this hook back to its default, because this test gets compiled to its
6+
// own binary and does therefore not interfere with other tests.
7+
std::panic::set_hook(Box::new(|_| {}));
8+
59
let args = Arguments::from_args();
610
let tests = get_baseline_test_cases();
711

0 commit comments

Comments
 (0)