| •1 |
/*extern crate executable_path; |
| 2 |
|
| 3 |
use {executable_path::executable_path, std::process::Command}; |
| 4 |
|
| 5 |
#[cfg(all(target_arch = "x86_64", target_os = "linux", target_env = "gnu"))] |
| 6 |
static EXPECTED: &str = r#"arch: x86_64 |
| 7 |
os: linux |
| 8 |
family: unix |
| 9 |
env: gnu |
| 10 |
endian: little |
| 11 |
pointer_width: 64 |
| 12 |
vendor: unknown |
| 13 |
feature: ["fxsr", "sse", "sse2"] |
| 14 |
"#; |
| 15 |
|
| 16 |
#[cfg(all(target_arch = "x86_64", target_os = "windows", target_env = "msvc"))] |
| 17 |
static EXPECTED: &str = r#"arch: x86_64 |
| 18 |
os: windows |
| 19 |
family: windows |
| 20 |
env: msvc |
| 21 |
endian: little |
| 22 |
pointer_width: 64 |
| 23 |
vendor: pc |
| 24 |
feature: ["fxsr", "sse", "sse2"] |
| 25 |
"#; |
| 26 |
|
| 27 |
#[cfg(all(target_arch = "x86_64", target_os = "macos", target_env = ""))] |
| 28 |
static EXPECTED: &str = r#"arch: x86_64 |
| 29 |
os: macos |
| 30 |
family: unix |
| 31 |
env: |
| 32 |
endian: little |
| 33 |
pointer_width: 64 |
| 34 |
vendor: apple |
| 35 |
feature: ["fxsr", "sse", "sse2", "sse3", "ssse3"] |
| 36 |
"#; |
| 37 |
|
| 38 |
#[cfg(all(target_arch = "aarch64", target_os = "macos", target_env = ""))] |
| 39 |
static EXPECTED: &str = r#"arch: aarch64 |
| 40 |
os: macos |
| 41 |
family: unix |
| 42 |
env: |
| 43 |
endian: little |
| 44 |
pointer_width: 64 |
| 45 |
vendor: apple |
| 46 |
feature: [] |
| 47 |
"#; |
| 48 |
|
| 49 |
#[test] |
| 50 |
fn binary_output() { |
| 51 |
let output = Command::new(executable_path("target")) |
| 52 |
.output() |
| 53 |
.unwrap() |
| 54 |
.stdout; |
| 55 |
let output = std::str::from_utf8(&output).unwrap(); |
| 56 |
pretty_assertions::assert_eq!(output, EXPECTED); |
| •57 |
}*/ |