Skip to content

Commit

Permalink
Improve cli
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius committed Apr 22, 2022
1 parent 6bef0a5 commit 5e8e45a
Show file tree
Hide file tree
Showing 11 changed files with 399 additions and 283 deletions.
143 changes: 39 additions & 104 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,110 +234,45 @@ The `cargo test-fuzz` command is used to interact with fuzz targets, and to mani
#### Options

```
--backtrace
Display backtraces
--consolidate
Move one target's crashes, hangs, and work queue to its corpus; to consolidate all
targets, use --consolidate-all
--display-concretizations
Display concretizations
--display-corpus
Display corpus using uninstrumented fuzz target; to display with instrumentation, use
--display-corpus-instrumented
--display-crashes
Display crashes
--display-hangs
Display hangs
--display-impl-concretizations
Display `impl` concretizations
--display-queue
Display work 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>
--features <FEATURES>
Space or comma separated list of features to activate
-h, --help
Print help information
--list
List fuzz targets
--manifest-path <PATH>
Path to Cargo.toml
--no-default-features
Do not activate the `default` feature
--no-instrumentation
Compile without instrumentation (for testing build process)
--no-run
Compile, but don't fuzz
--no-ui
Disable user interface
-p, --package <PACKAGE>
Package containing fuzz target
--persistent
Enable persistent mode fuzzing
--pretty-print
Pretty-print debug output when displaying/replaying
--replay-corpus
Replay corpus using uninstrumented fuzz target; to replay with instrumentation, use
--replay-corpus-instrumented
--replay-crashes
Replay crashes
--replay-hangs
Replay hangs
--replay-queue
Replay work 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
--target <TARGETNAME>
DEPRECATED: Use just <TARGETNAME>
--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)
-V, --version
Print version information
--verbose
Show build output when displaying/replaying
--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]
--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>
--features <FEATURES> Space or comma separated list of features to activate
-h, --help Print help information
--list List fuzz targets
--manifest-path <PATH> Path to Cargo.toml
--no-default-features Do not activate the `default` feature
--no-instrumentation Compile without instrumentation (for testing build process)
--no-run Compile, but don't fuzz
--no-ui Disable user interface
-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
--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)
-V, --version Print version information
--verbose Show build output when displaying/replaying
```

### Convenience functions and macros
Expand Down
3 changes: 3 additions & 0 deletions cargo-test-fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ bitflags = "1.3.2"
cargo_metadata = "0.14.2"
clap = { version = "3.1.6", features = ["cargo", "derive"] }
env_logger = "0.9.0"
heck = "0.4.0"
lazy_static = "1.4.0"
log = "0.4.16"
paste = "1.0.7"
remain = "0.2.2"
semver = "1.0.6"
serde = { version = "1.0.136", features = ["derive"] }
strum_macros = "0.24.0"
subprocess = "0.2.8"

internal = { path = "../internal", package = "test-fuzz-internal", version = "=3.0.1" }
Expand Down
2 changes: 2 additions & 0 deletions cargo-test-fuzz/src/bin/cargo_test_fuzz.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(deprecated)]

use anyhow::Result;
use cargo_test_fuzz::cargo_test_fuzz;
use std::env;
Expand Down
Loading

0 comments on commit 5e8e45a

Please sign in to comment.