Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bin_tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ pub struct ArtifactsBuild {
fn inner_build_artifact(c: &ArtifactsBuild) -> anyhow::Result<PathBuf> {
let mut build_cmd = process::Command::new(env!("CARGO"));
build_cmd.arg("build");
if let Ok(_path) = std::env::var("LLVM_PROFILE_FILE") {
// LLVM_PROFILE_FILE is set, running llvm-cov
// Add the instrument-coverage flag to the RUSTFLAGS environment variable
build_cmd.env("RUSTFLAGS", "-C instrument-coverage --cfg=coverage");
}
if let BuildProfile::Release = c.build_profile {
build_cmd.arg("--release");
}
Expand Down
3 changes: 3 additions & 0 deletions bin_tests/src/test_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ where
let fixtures = TestFixtures::new()?;

let mut cmd = process::Command::new(&artifacts_map[&artifacts.crashtracker_bin]);
if let Ok(path) = std::env::var("LLVM_PROFILE_FILE") {
cmd.env("LLVM_PROFILE_FILE", path);
}
cmd.arg(format!("file://{}", fixtures.crash_profile_path.display()))
.arg(&artifacts_map[&artifacts.crashtracker_receiver])
.arg(&fixtures.output_dir)
Expand Down
Loading