Skip to content

Commit

Permalink
Try to fix the auxv test paths
Browse files Browse the repository at this point in the history
  • Loading branch information
gnzlbg committed Jan 21, 2019
1 parent cb6b61a commit 13941f8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions crates/std_detect/src/detect/os/linux/auxvec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,19 +214,19 @@ 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);
}

#[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);
Expand All @@ -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);
}
}
Expand Down

0 comments on commit 13941f8

Please sign in to comment.