| 49 | } |
| 50 | |
| 51 | fn run_tests(root: &Path, args: &[String], rustflags: &str, profraw_pattern: &Path) { |
| 52 | eprintln!("=== Running cargo test with coverage ==="); |
| 53 | let status = Command::new("cargo") |
| 54 | .arg("test") |
| 55 | .args(args) |
| 56 | .env("RUSTFLAGS", rustflags) |
| 57 | .env("LLVM_PROFILE_FILE", profraw_pattern) |
| 58 | .current_dir(root) |
| 59 | .status() |
| 60 | .expect("failed to run cargo test"); |
| 61 | if !status.success() { |
| 62 | eprintln!("cargo test failed with {status}"); |
| 63 | std::process::exit(status.code().unwrap_or(1)); |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | fn discover_test_binaries( |
| 68 | root: &Path, |