Skip to content

Commit

Permalink
Update help message
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius committed Oct 26, 2022
1 parent 40ac738 commit 9217cef
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 8 deletions.
32 changes: 26 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,18 @@ The `cargo test-fuzz` command is used to interact with fuzz targets, and to mani

```
--backtrace Display backtraces
--consolidate Move one target's crashes, hangs, and work queue to its corpus; to consolidate all targets, use --consolidate-all
--display <OBJECT> Display concretizations, corpus, crashes, `impl` concretizations, hangs, or work queue. By default, corpus uses an uninstrumented fuzz target; the others use an instrumented fuzz target. To display the corpus with instrumentation, use --display corpus-instrumented. [possible values: concretizations, corpus, corpus-instrumented, crashes, hangs, impl-concretizations, queue]
--consolidate Move one target's crashes, hangs, and work queue to its corpus; to
consolidate all targets, use --consolidate-all
--display <OBJECT> Display concretizations, corpus, crashes, `impl` concretizations,
hangs, or work queue. By default, corpus uses an uninstrumented fuzz
target; the others use an instrumented fuzz target. To display the
corpus with instrumentation, use --display corpus-instrumented. [possible
values: concretizations, corpus, corpus-instrumented, crashes, hangs,
impl-concretizations, queue]
--exact Target name is an exact name rather than a substring
--exit-code Exit with 0 if the time limit was reached, 1 for other programmatic aborts, and 2 if an error occurred; implies --no-ui, does not imply --run-until-crash or -- -V <SECONDS>
--exit-code Exit with 0 if the time limit was reached, 1 for other programmatic
aborts, and 2 if an error occurred; implies --no-ui, does not imply
--run-until-crash or -- -V <SECONDS>
--features <FEATURES> Space or comma separated list of features to activate
--list List fuzz targets
--manifest-path <PATH> Path to Cargo.toml
Expand All @@ -263,15 +271,27 @@ The `cargo test-fuzz` command is used to interact with fuzz targets, and to mani
-p, --package <PACKAGE> Package containing fuzz target
--persistent Enable persistent mode fuzzing
--pretty-print Pretty-print debug output when displaying/replaying
--replay <OBJECT> Replay corpus, crashes, hangs, or work queue. By default, corpus uses an uninstrumented fuzz target; the others use an instrumented fuzz target. To replay the corpus with instrumentation, use --replay corpus-instrumented. [possible values: concretizations, corpus, corpus-instrumented, crashes, hangs, impl-concretizations, queue]
--reset Clear fuzzing data for one target, but leave corpus intact; to reset all targets, use --reset-all
--replay <OBJECT> Replay corpus, crashes, hangs, or work queue. By default, corpus uses
an uninstrumented fuzz target; the others use an instrumented fuzz
target. To replay the corpus with instrumentation, use --replay
corpus-instrumented. [possible values: concretizations, corpus,
corpus-instrumented, crashes, hangs, impl-concretizations, queue]
--reset Clear fuzzing data for one target, but leave corpus intact; to reset
all targets, use --reset-all
--resume Resume target's last fuzzing session
--run-until-crash Stop fuzzing once a crash is found
--test <NAME> Integration test containing fuzz target
--timeout <TIMEOUT> Number of milliseconds to consider a hang when fuzzing or replaying (equivalent to -- -t <TIMEOUT> when fuzzing)
--timeout <TIMEOUT> Number of milliseconds to consider a hang when fuzzing or replaying
(equivalent to -- -t <TIMEOUT> when fuzzing)
--verbose Show build output when displaying/replaying
-h, --help Print help information
-V, --version Print version information
To fuzz for at most <SECONDS> of time, use:
cargo test-fuzz ... -- -V <SECONDS>
See `cargo afl fuzz --help` for additional options.
```

### Convenience functions and macros
Expand Down
2 changes: 1 addition & 1 deletion cargo-test-fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ doctest = false
anyhow = "1.0.66"
bitflags = "1.3.2"
cargo_metadata = "0.15.0"
clap = { version = "4.0.18", features = ["cargo", "derive"] }
clap = { version = "4.0.18", features = ["cargo", "derive", "wrap_help"] }
env_logger = "0.9.1"
heck = "0.4.0"
lazy_static = "1.4.0"
Expand Down
7 changes: 6 additions & 1 deletion cargo-test-fuzz/src/transition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ enum SubCommand {

// smoelius: Wherever possible, try to reuse cargo test and libtest option names.
#[derive(Clone, Debug, Deserialize, Parser, Serialize)]
#[clap(version = crate_version!())]
#[clap(version = crate_version!(), after_help = "To fuzz for at most <SECONDS> of time, use:
cargo test-fuzz ... -- -V <SECONDS>
See `cargo afl fuzz --help` for additional options.
")]
#[remain::sorted]
struct TestFuzzWithDeprecations {
#[clap(long, help = "Display backtraces")]
Expand Down

0 comments on commit 9217cef

Please sign in to comment.