-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Labels
pendingIssue can not be solved nowIssue can not be solved now
Description
$ cat src/lib.rs
#[test_with::env(SOME_VAR)]
fn test() {
panic!("WUT");
}
$ cargo test --tests
Compiling a v0.1.0 (/tmp/a)
Finished test [unoptimized] target(s) in 0.23s
Running unittests (target/debug/deps/a-07e254e8b610defe)
running 1 test
test test ... ignored
test result: ok. 0 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.00s
$ : This should fail but it does not:
$ SOME_VAR=should_panic cargo test --tests
Finished test [unoptimized] target(s) in 0.03s
Running unittests (target/debug/deps/a-07e254e8b610defe)
running 1 test
test test ... ignored
test result: ok. 0 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.00s
$ touch src/lib.rs
$ SOME_VAR=should_panic cargo test --tests
Compiling a v0.1.0 (/tmp/a)
Finished test [unoptimized] target(s) in 0.19s
Running unittests (target/debug/deps/a-07e254e8b610defe)
running 1 test
test test ... FAILED
failures:
---- test stdout ----
thread 'test' panicked at 'WUT', src/lib.rs:3:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
test
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
error: test failed, to rerun pass '--lib'
$ : This should succeed but fails:
$ cargo test --tests
Finished test [unoptimized] target(s) in 0.03s
Running unittests (target/debug/deps/a-07e254e8b610defe)
running 1 test
test test ... FAILED
failures:
---- test stdout ----
thread 'test' panicked at 'WUT', src/lib.rs:3:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
test
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
error: test failed, to rerun pass '--lib'
WhyNotHugo
Metadata
Metadata
Assignees
Labels
pendingIssue can not be solved nowIssue can not be solved now