You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apologies if this is a dupe, I searched but couldn't find anything. Big GUI project here and have been playing around with using cranelift to improve compile times. When running my tests on windows, any failing assert_eq!() will trigger nonsensical error messages as opposed to the correct error message about a failing assertion. Minimal example:
cargo-features = ["codegen-backend"]
[package]
name = "panic_test"
version = "0.1.0"
edition = "2021"
[profile.dev]
codegen-backend = "cranelift"
[dependencies]
Error message when using cranelift:
C:\Users\tbeckley...\Documents\code\panic_test>cargo test
Finished test profile [unoptimized + debuginfo] target(s) in 0.05s
Running unittests src/main.rs (target\debug\deps\panic_test-58a397beba7a73c1.exe)
running 1 test
error: test failed, to rerun pass --bin panic_test
Caused by:
process didn't exit successfully: C:\Users\tbeckley\...\Documents\code\panic_test\target\debug\deps\panic_test-58a397beba7a73c1.exe (exit code: 0xe06d7363)
note: test exited abnormally; to see the full output pass --nocapture to the harness.
And without cranelift:
C:\Users\tbeckley...\Documents\code\panic_test>cargo test
Compiling panic_test v0.1.0 (C:\Users\tbeckley...\Documents\code\panic_test)
Finished test profile [unoptimized + debuginfo] target(s) in 0.36s
Running unittests src/main.rs (target\debug\deps\panic_test-36ac1adaeb9d3e34.exe)
running 1 test
test tests::test_panics ... FAILED
failures:
---- tests::test_panics stdout ----
thread 'tests::test_panics' panicked at src/main.rs:9:9:
assertion left == right failed: not equal
left: 4
right: 5
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
failures:
tests::test_panics
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
error: test failed, to rerun pass --bin panic_test
I've also seen errors for memory access violation and stack overflows.
Unwinding on panics isn't supported yet. Because of this libtest is unable to catch the test failure and show the test result it saved. Instead the process is aborted. Try using RUSTFLAGS="-Cpanic=abort -Zpanic-abort-tests" which will make libtest handle panic=abort correctly by running each test in a new subprocess. Be aware however that spawning processes is relatively slow on Windows.
That works perfectly! Sorry for the dumb question and thank you for the quick response! I hadn't actually considered that the test fail causes a panic...
Hi guys,
Apologies if this is a dupe, I searched but couldn't find anything. Big GUI project here and have been playing around with using cranelift to improve compile times. When running my tests on windows, any failing
assert_eq!()
will trigger nonsensical error messages as opposed to the correct error message about a failing assertion. Minimal example:cargo.toml:
Error message when using cranelift:
And without cranelift:
I've also seen errors for memory access violation and stack overflows.
Result of
rustup show
:The text was updated successfully, but these errors were encountered: