From fdbbb08aeff983a815ee17dd9e28e8e4fefe6f16 Mon Sep 17 00:00:00 2001 From: knight42 Date: Tue, 20 Dec 2016 03:21:42 +0800 Subject: [PATCH] tests: expand $OUT_DIR at compile time --- tests/common/util.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/tests/common/util.rs b/tests/common/util.rs index 9e9e0b08e..743fd5f16 100644 --- a/tests/common/util.rs +++ b/tests/common/util.rs @@ -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),