Skip to content

Commit

Permalink
Merge pull request #526 from crytic/dev/explore-flag
Browse files Browse the repository at this point in the history
Add exploration mode flag
  • Loading branch information
bsamuels453 authored Jan 6, 2025
2 parents 878b0f1 + 7460d3a commit 891ca30
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
18 changes: 18 additions & 0 deletions cmd/fuzz_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ func addFuzzFlags() error {
// Logging color
fuzzCmd.Flags().Bool("no-color", false, "disabled colored terminal output")

// Exploration mode
fuzzCmd.Flags().Bool("explore", false, "enables exploration mode")

return nil
}

Expand Down Expand Up @@ -163,5 +166,20 @@ func updateProjectConfigWithFuzzFlags(cmd *cobra.Command, projectConfig *config.
return err
}
}

// Update configuration to exploration mode
if cmd.Flags().Changed("explore") {
exploreBool, err := cmd.Flags().GetBool("explore")
if err != nil {
return err
}
if exploreBool {
projectConfig.Fuzzing.Testing.StopOnFailedTest = false
projectConfig.Fuzzing.Testing.StopOnNoTests = false
projectConfig.Fuzzing.Testing.AssertionTesting.Enabled = false
projectConfig.Fuzzing.Testing.PropertyTesting.Enabled = false
projectConfig.Fuzzing.Testing.OptimizationTesting.Enabled = false
}
}
return nil
}
9 changes: 9 additions & 0 deletions docs/src/cli/fuzz.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,12 @@ The `--no-color` flag disables colored console output (equivalent to
# Disable colored output
medusa fuzz --no-color
```

### `--explore`

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.

```shell
# Enable exploration mode
medusa fuzz --explore
```

0 comments on commit 891ca30

Please sign in to comment.