diff options
author | ClementTsang <cjhtsang@uwaterloo.ca> | 2020-05-04 18:23:34 -0400 |
---|---|---|
committer | ClementTsang <cjhtsang@uwaterloo.ca> | 2020-05-04 18:23:34 -0400 |
commit | 1ff2606c90c0b0ce10912f03f01314e209b54574 (patch) | |
tree | b5df1b2a6f4e462dd3767f4422bfb47d38cfe034 | |
parent | 16b6f442ac955bf60fa680f7177bf5fc75b6c27b (diff) |
update tests to deal with msrv
-rw-r--r-- | Cargo.toml | 1 | ||||
-rw-r--r-- | tests/arg_tests.rs | 11 | ||||
-rw-r--r-- | tests/invalid_config_tests.rs | 11 |
3 files changed, 20 insertions, 3 deletions
@@ -15,7 +15,6 @@ name = "btm" path = "src/main.rs" [profile.release] -#debug = true debug = 1 opt-level = 3 lto = "fat" diff --git a/tests/arg_tests.rs b/tests/arg_tests.rs index 134d9615..c586a798 100644 --- a/tests/arg_tests.rs +++ b/tests/arg_tests.rs @@ -7,7 +7,16 @@ use std::process::Command; //======================RATES======================// fn get_binary_location() -> String { - env!("CARGO_BIN_EXE_btm").to_string() + // env!("CARGO_BIN_EXE_btm").to_string() + if cfg!(target_os = "linux") { + "./target/x86_64-unknown-linux-gnu/debug/btm".to_string() + } else if cfg!(target_os = "windows") { + "./target/x86_64-pc-windows-msvc/debug/btm".to_string() + } else if cfg!(target_os = "macos") { + "./target/x86_64-apple-darwin/debug/btm".to_string() + } else { + "".to_string() + } } #[test] diff --git a/tests/invalid_config_tests.rs b/tests/invalid_config_tests.rs index 34b8e06e..0a0f69a4 100644 --- a/tests/invalid_config_tests.rs +++ b/tests/invalid_config_tests.rs @@ -5,7 +5,16 @@ use std::process::Command; // These tests are for testing some config file-specific options. fn get_binary_location() -> String { - env!("CARGO_BIN_EXE_btm").to_string() + // env!("CARGO_BIN_EXE_btm").to_string() + if cfg!(target_os = "linux") { + "./target/x86_64-unknown-linux-gnu/debug/btm".to_string() + } else if cfg!(target_os = "windows") { + "./target/x86_64-pc-windows-msvc/debug/btm".to_string() + } else if cfg!(target_os = "macos") { + "./target/x86_64-apple-darwin/debug/btm".to_string() + } else { + "".to_string() + } } #[test] |