I’d like to be able to run a binary generated by cargo directly in integration tests. I know that cargo places binaries (at least ones in a main.rs) in target/(debug or release)/myapp(.exe) . Is there a cleaner way to get that location, though? Like in an environment variable or macro? I didn’t see exactly what I want in http://doc.crates.io/environment-variables.html . I can use CARGO_MANIFEST_DIR , detect whether it’s debug or release, then sort of guess the executable name with CARGO_PKG_NAME, but that doesn’t seem very clean and a little unreliable.
Also, tangentially, is there a place where all the possible values for cfg! can be found? I didn’t see anything in https://rustbyexample.com/attribute/cfg.html , https://doc.rust-lang.org/std/macro.cfg.html , or https://doc.rust-lang.org/book/first-edition/conditional-compilation.html .