From 13941f86a89aca89acf3bb38c209f2ad2fb972c9 Mon Sep 17 00:00:00 2001 From: gnzlbg Date: Mon, 21 Jan 2019 21:20:16 +0100 Subject: [PATCH] Try to fix the auxv test paths --- .../std_detect/src/detect/os/linux/auxvec.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/crates/std_detect/src/detect/os/linux/auxvec.rs b/crates/std_detect/src/detect/os/linux/auxvec.rs index d6cb249872..31c980fd38 100644 --- a/crates/std_detect/src/detect/os/linux/auxvec.rs +++ b/crates/std_detect/src/detect/os/linux/auxvec.rs @@ -214,9 +214,9 @@ mod tests { if #[cfg(target_arch = "arm")] { #[test] fn linux_rpi3() { - let v = auxv_from_file( - "../../std_detect/detect/test_data/linux-rpi3.auxv", - ).unwrap(); + let file = concat!(env!("CARGO_MANIFEST_DIR"), "/src/detect/test_data/linux-rpi3.auxv"); + println!("file: {}", file); + let v = auxv_from_file(file).unwrap(); assert_eq!(v.hwcap, 4174038); assert_eq!(v.hwcap2, 16); } @@ -224,9 +224,9 @@ mod tests { #[test] #[should_panic] fn linux_macos_vb() { - let _ = auxv_from_file( - "../../std_detect/detect/test_data/macos-virtualbox-linux-x86-4850HQ.auxv" - ).unwrap(); + let file = concat!(env!("CARGO_MANIFEST_DIR"), "/src/detect/test_data/macos-virtualbox-linux-x86-4850HQ.auxv"); + println!("file: {}", file); + let v = auxv_from_file(file).unwrap(); // this file is incomplete (contains hwcap but not hwcap2), we // want to fall back to /proc/cpuinfo in this case, so // reading should fail. assert_eq!(v.hwcap, 126614527); @@ -235,9 +235,9 @@ mod tests { } else if #[cfg(target_arch = "aarch64")] { #[test] fn linux_x64() { - let v = auxv_from_file( - "../../std_detect/detect/test_data/linux-x64-i7-6850k.auxv", - ).unwrap(); + let file = concat!(env!("CARGO_MANIFEST_DIR"), "/src/detect/test_data/linux-x64-i7-6850k.auxv"); + println!("file: {}", file); + let v = auxv_from_file(file).unwrap(); assert_eq!(v.hwcap, 3219913727); } }