load coverage file from environment variable

pull/10758/head
Dustin Lagoy 2024-05-09 07:18:01 -07:00
parent 6006a69b44
commit 79b85030b2
1 changed files with 29 additions and 27 deletions

View File

@ -151,7 +151,8 @@ pub fn coverage<'doc>(
) -> GutterFn<'doc> {
let covered = theme.get("diff.plus.gutter");
let not_covered = theme.get("diff.minus.gutter");
if let Some(cov) = coverage::parse(PathBuf::from("report/coverage.xml")) {
if let Ok(coverage_path) = std::env::var("HELIX_COVERAGE_FILE") {
if let Some(cov) = coverage::parse(PathBuf::from(coverage_path)) {
if let Some(mut path) = doc.path.clone() {
if let Ok(cwd) = std::env::current_dir() {
if let Ok(tmp) = path.strip_prefix(cwd) {
@ -183,6 +184,7 @@ pub fn coverage<'doc>(
}
}
}
}
return Box::new(move |_, _, _, _| None);
}