Skip to content

Commit 891ca30

Browse files
authored
Merge pull request #526 from crytic/dev/explore-flag
Add exploration mode flag
2 parents 878b0f1 + 7460d3a commit 891ca30

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

cmd/fuzz_flags.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ func addFuzzFlags() error {
6363
// Logging color
6464
fuzzCmd.Flags().Bool("no-color", false, "disabled colored terminal output")
6565

66+
// Exploration mode
67+
fuzzCmd.Flags().Bool("explore", false, "enables exploration mode")
68+
6669
return nil
6770
}
6871

@@ -163,5 +166,20 @@ func updateProjectConfigWithFuzzFlags(cmd *cobra.Command, projectConfig *config.
163166
return err
164167
}
165168
}
169+
170+
// Update configuration to exploration mode
171+
if cmd.Flags().Changed("explore") {
172+
exploreBool, err := cmd.Flags().GetBool("explore")
173+
if err != nil {
174+
return err
175+
}
176+
if exploreBool {
177+
projectConfig.Fuzzing.Testing.StopOnFailedTest = false
178+
projectConfig.Fuzzing.Testing.StopOnNoTests = false
179+
projectConfig.Fuzzing.Testing.AssertionTesting.Enabled = false
180+
projectConfig.Fuzzing.Testing.PropertyTesting.Enabled = false
181+
projectConfig.Fuzzing.Testing.OptimizationTesting.Enabled = false
182+
}
183+
}
166184
return nil
167185
}

docs/src/cli/fuzz.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,12 @@ The `--no-color` flag disables colored console output (equivalent to
129129
# Disable colored output
130130
medusa fuzz --no-color
131131
```
132+
133+
### `--explore`
134+
135+
The `--explore` flag enables exploration mode. This sets the [`StopOnFailedTest`](../project_configuration/testing_config.md#stoponfailedtest) and [`StopOnNoTests`](../project_configuration/testing_config.md#stoponnotests) fields to `false` and turns off assertion, property, and optimization testing.
136+
137+
```shell
138+
# Enable exploration mode
139+
medusa fuzz --explore
140+
```

0 commit comments

Comments
 (0)