Skip to content

Commit

Permalink
add support for user supplied coverage output types
Browse files Browse the repository at this point in the history
  • Loading branch information
R9295 committed Jun 14, 2024
1 parent 6540fcd commit 34fb8a2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/bin/cargo-ziggy/coverage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,18 @@ impl Cover {
}
};

let output_types = match &self.output_types {
Some(o) => o,
None => "html",
};

// We generate the code coverage report
process::Command::new("grcov")
.args([
".",
&format!("-b=./target/coverage/debug/{}", self.target),
&format!("-s={source_or_workspace_root}"),
"-t=html",
&format!("-t={}", output_types),
"--llvm",
"--branch",
"--ignore-not-existing",
Expand Down
4 changes: 4 additions & 0 deletions src/bin/cargo-ziggy/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ pub struct Cover {
/// Keep coverage data files (WARNING: Do not use if source code has changed)
#[clap(short, long, default_value_t = false)]
keep: bool,

/// Comma separated list of output types. See grov --help to see supported output types.
#[clap(short = 't', long)]
output_types: Option<String>,
}

#[derive(Args)]
Expand Down

0 comments on commit 34fb8a2

Please sign in to comment.