mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
Merge pull request #1016 from uutils/fix-out-dir
tests: expand $OUT_DIR at compile time
This commit is contained in:
commit
b596df9a0a
1 changed files with 1 additions and 9 deletions
|
@ -374,15 +374,7 @@ impl TestScenario {
|
|||
// Instead of hardcoding the path relative to the current
|
||||
// directory, use Cargo's OUT_DIR to find path to executable.
|
||||
// This allows tests to be run using profiles other than debug.
|
||||
// let target_dir = path_concat!(env::var("OUT_DIR").unwrap(), "..", "..", "..", PROGNAME);
|
||||
let target_dir;
|
||||
// FIXME: $OUT_DIR is not set by nightly cargo
|
||||
// See also: https://github.com/rust-lang/cargo/issues/3368
|
||||
if cfg!(build = "release") {
|
||||
target_dir = path_concat!(env!("CARGO_MANIFEST_DIR"), "target", "release", PROGNAME);
|
||||
} else {
|
||||
target_dir = path_concat!(env!("CARGO_MANIFEST_DIR"), "target", "debug", PROGNAME);
|
||||
}
|
||||
let target_dir = path_concat!(env!("OUT_DIR"), "..", "..", "..", PROGNAME);
|
||||
PathBuf::from(AtPath::new(Path::new(&target_dir)).root_dir_resolved())
|
||||
},
|
||||
util_name: String::from(util_name),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue