Skip to main content

auto_normalize_paths

Function auto_normalize_paths 

Source
pub fn auto_normalize_paths(data: &mut CoverageData, source_root: Option<&Path>)
Expand description

Automatically normalize paths in coverage data to be relative.

Strategy:

  1. If source_root is provided, strip it from all paths.
  2. Otherwise, detect common absolute prefix and strip it.
  3. As fallback, try git rev-parse --show-toplevel.
  4. Normalize backslashes and strip leading ./.