use std::path::{Path, PathBuf};
pub fn artifacts_dir(output_dir: &Path) -> PathBuf {
output_dir
.parent()
.map(|parent| parent.join(".isotarp-artifacts"))
.unwrap_or_else(|| PathBuf::from(".isotarp-artifacts"))
}
pub fn test_name_to_path_segment(test_name: &str) -> String {
test_name.replace("::", "/")
}
pub fn test_output_dir(output_dir: &Path, test_name: &str) -> PathBuf {
output_dir.join(test_name_to_path_segment(test_name))
}
pub fn test_target_dir(output_dir: &Path, test_name: &str) -> PathBuf {
artifacts_dir(output_dir)
.join(test_name_to_path_segment(test_name))
.join("tarpaulin-target")
}
pub fn test_report_path(output_dir: &Path, test_name: &str) -> PathBuf {
test_output_dir(output_dir, test_name).join("tarpaulin-report.json")
}