Perhaps I'm doing something wrong, but I have code that looks very similar to the examples, and I can't get it to panic or otherwise respond to failpoints in the environment:
The full code is in https://github.com/sourcefrog/fail-repro
main.rs is
use fail::fail_point;
fn main() {
println!("Has failpoints: {}", fail::has_failpoints());
println!(
"FAILPOINTS is {:?}",
std::env::var("FAILPOINTS").unwrap_or_default()
);
fail_point!("main");
println!("Failpoint passed");
}
When I run this:
$ FAILPOINTS=main=panic cargo +1.61 r --features fail/failpoints
Updating crates.io index
...
Running `target/debug/fail-repro`
Has failpoints: true
FAILPOINTS is "main=panic"
Failpoint passed
$ FAILPOINTS=main=print cargo +1.61 r --features fail/failpoints
Finished dev [unoptimized + debuginfo] target(s) in 0.01s
Running `target/debug/fail-repro`
Has failpoints: true
FAILPOINTS is "main=print"
Failpoint passed
In case this was broken by a later Cargo change, I tried it on both 1.76 and 1.63 and they both show the same behavior.
This is on x86_64 Linux.
Perhaps I'm doing something wrong, but I have code that looks very similar to the examples, and I can't get it to panic or otherwise respond to failpoints in the environment:
The full code is in https://github.com/sourcefrog/fail-repro
main.rsisWhen I run this:
In case this was broken by a later Cargo change, I tried it on both 1.76 and 1.63 and they both show the same behavior.
This is on x86_64 Linux.