diff options
-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] |