Skip to content

Commit

Permalink
🧑‍💻 add help comment for fuzz add command + remove skip_fuzzer option…
Browse files Browse the repository at this point in the history
… as it is not used
  • Loading branch information
lukacan committed Feb 7, 2024
1 parent 9776295 commit 312ad98
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
1 change: 1 addition & 0 deletions crates/cli/src/command/fuzz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub enum FuzzCommand {
/// Path to the crash file
crash_file_path: String,
},
/// Add new fuzz test. Explicit fuzz test name is not supported. Implicit name is fuzz_ID, where ID is automatically derived.
Add,
}

Expand Down
4 changes: 2 additions & 2 deletions crates/cli/src/command/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use fehler::throws;
use trdelnik_client::TestGenerator;

#[throws]
pub async fn init(skip_fuzzer: bool) {
pub async fn init() {
let generator = TestGenerator::new();
generator.generate(skip_fuzzer).await?;
generator.generate().await?;
}
12 changes: 4 additions & 8 deletions crates/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ enum Command {
#[clap(subcommand)]
subcmd: KeyPairCommand,
},
/// Run program tests
/// Run program PoC tests
Test {
/// Anchor project root
#[clap(short, long, default_value = "./")]
root: String,
},
/// Run and debug fuzz tests
/// Run and debug Fuzz tests
Fuzz {
/// Anchor project root
#[clap(short, long)]
Expand All @@ -52,11 +52,7 @@ enum Command {
subcmd: ExplorerCommand,
},
/// Initialize test environment
Init {
/// Flag to skip generating template for fuzzing and activating the fuzzing feature.
#[arg(short, long)]
skip_fuzzer: bool,
},
Init,
/// Removes target contents except for KeyPair and removes hfuzz_target folder
Clean,
}
Expand All @@ -72,7 +68,7 @@ pub async fn start() {
Command::Fuzz { root, subcmd } => command::fuzz(root, subcmd).await?,
Command::Localnet => command::localnet().await?,
Command::Explorer { subcmd } => command::explorer(subcmd).await?,
Command::Init { skip_fuzzer } => command::init(skip_fuzzer).await?,
Command::Init => command::init().await?,
Command::Clean => command::clean().await?,
}
}
2 changes: 1 addition & 1 deletion crates/client/src/test_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl TestGenerator {
/// It fails when:
/// - there is not a root directory (no `Anchor.toml` file)
#[throws]
pub async fn generate(&self, _skip_fuzzer: bool) {
pub async fn generate(&self) {
let root = match Config::discover_root() {
Ok(root) => root,
Err(_) => throw!(Error::BadWorkspace),
Expand Down

0 comments on commit 312ad98

Please sign in to comment.