Skip to content

Commit

Permalink
feat: allow including libraries into coverage report (#7663)
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr authored Apr 15, 2024
1 parent 94e940c commit 46f51c9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/forge/bin/cmd/coverage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ pub struct CoverageArgs {
)]
report_file: Option<PathBuf>,

/// Whether to include libraries in the coverage report.
#[arg(long)]
include_libs: bool,

#[command(flatten)]
filter: FilterArgs,

Expand Down Expand Up @@ -162,7 +166,8 @@ impl CoverageArgs {
report.add_source(version.clone(), source_file.id as usize, path.clone());

// Filter out dependencies
if project_paths.has_library_ancestor(std::path::Path::new(&path)) {
if !self.include_libs && project_paths.has_library_ancestor(std::path::Path::new(&path))
{
continue
}

Expand Down

0 comments on commit 46f51c9

Please sign in to comment.