Skip to content

Commit

Permalink
Use CARGO_TARGET_DIR for target directory (#1056)
Browse files Browse the repository at this point in the history
  • Loading branch information
L3nn0x authored Jul 10, 2023
1 parent 76fc4ac commit f8bf349
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/llvm_tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,15 @@ mod tests {
assert_eq!(lcovs.len(), 0);

#[cfg(unix)]
let binary_path = "target/debug/rust-code-coverage-sample";
let binary_path = format!(
"{}/debug/rust-code-coverage-sample",
std::env::var("CARGO_TARGET_DIR").unwrap_or("target".to_string())
);
#[cfg(windows)]
let binary_path = "target/debug/rust-code-coverage-sample.exe";
let binary_path = format!(
"{}/debug/rust-code-coverage-sample.exe",
std::env::var("CARGO_TARGET_DIR").unwrap_or("target".to_string())
);

let lcovs = profraws_to_lcov(
&[tmp_path.join("default.profraw")],
Expand Down

0 comments on commit f8bf349

Please sign in to comment.