Skip to content

Commit

Permalink
Allow passing "-vv" to cargo fuzz
Browse files Browse the repository at this point in the history
It should help to figure out how libFuzzer is built and linked
against, which in turn should be useful in scenarios like
google/oss-fuzz#5867 (comment)
  • Loading branch information
evverx committed Jun 4, 2021
1 parent ede133e commit 280afc8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ pub struct BuildOptions {
pub debug_assertions: bool,

/// Build target with verbose output from `cargo build`
#[structopt(short = "v", long = "verbose")]
pub verbose: bool,
#[structopt(short = "v", long = "verbose", parse(from_occurrences))]
pub verbose: i32,

#[structopt(long = "no-default-features")]
/// Build artifacts with default Cargo features disabled
Expand Down Expand Up @@ -144,7 +144,7 @@ impl stdfmt::Display for BuildOptions {
write!(f, " -a")?;
}

if self.verbose {
for _ in 0..self.verbose {
write!(f, " -v")?;
}

Expand Down Expand Up @@ -213,7 +213,7 @@ mod test {
dev: false,
release: false,
debug_assertions: false,
verbose: false,
verbose: 0,
no_default_features: false,
all_features: false,
features: None,
Expand All @@ -240,7 +240,7 @@ mod test {
..default_opts.clone()
},
BuildOptions {
verbose: true,
verbose: 1,
..default_opts.clone()
},
BuildOptions {
Expand Down
2 changes: 1 addition & 1 deletion src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ impl FuzzProject {
if !build.dev {
cmd.arg("--release");
}
if build.verbose {
for _ in 0..build.verbose {
cmd.arg("--verbose");
}
if build.no_default_features {
Expand Down

0 comments on commit 280afc8

Please sign in to comment.