Skip to main content

cargo_profile_dir

Function cargo_profile_dir 

Source
pub fn cargo_profile_dir() -> PathBuf
Expand description

Returns the Cargo profile directory (target/<profile>) for the currently running test executable.

Final binaries like forge and cast are uplifted into target/<profile> itself, while test executables are compiled into target/<profile>/deps/, or under target/<profile>/build/ with Cargo’s new build-dir layout, so walk up from the executable’s directory until the parent of the deps or build component.