macro_rules! bin_path {
($bin_name:expr) => { ... };
}Expand description
When called from within an integration test or benchmark, returns the path to the binary with the specified crate name in the current package.
Whenever Cargo compiles a benchmark or integration test any binary crates in the same package will also be compiled. This macro returns the path to one of those compiled binaries. If no such binary exists then the macro will fail to compile.
For example:
There is a test at test/tests.rs for a binary crate with name="foo" in its Cargo.toml and with a src/bin/bar.rs.
Inside the test at test/tests.rs, both bin_path!("foo") and bin_path!("bar") would compile and return the path of their respective binaries.