The module test (aka. integration test) doesn't know if cargo test is invoked with --release or not.
That is the fundamental problem. Furthermore, it doesn't really want to concern itself with where the various debug and release executables are located.
Currently, it searches for executables named "shellharden" and just tests every one of them. Care is taken to search CARGO_TARGET_DIR if set.
Why this is wrong: When you think you are testing the debug build, you are implicitly also testing a stale release build if it exists, and vice versa.
The module test (aka. integration test) doesn't know if
cargo test
is invoked with--release
or not.That is the fundamental problem. Furthermore, it doesn't really want to concern itself with where the various debug and release executables are located.
Currently, it searches for executables named "shellharden" and just tests every one of them. Care is taken to search CARGO_TARGET_DIR if set.
Why this is wrong: When you think you are testing the debug build, you are implicitly also testing a stale release build if it exists, and vice versa.
Problem: https://github.com/rust-lang/cargo/issues/3670
Solution: https://github.com/rust-lang/cargo/pull/7697