Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
anishnaik committed Jan 6, 2025
1 parent 4f8ec15 commit aefbfaf
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cmd/fuzz_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,14 @@ func addFuzzFlags() error {
fmt.Sprintf("print the execution trace for every element in a shrunken call sequence instead of only the last element (unless a config file is provided, default is %t)", defaultConfig.Fuzzing.Testing.TraceAll))

// Logging color
fuzzCmd.Flags().Bool("no-color", false, "disabled colored terminal output")
fuzzCmd.Flags().Bool("no-color", false, "disables colored terminal output")

// Enable stop on failed test
fuzzCmd.Flags().Bool("fail-fast", false, "enabled stop on failed test")
fuzzCmd.Flags().Bool("fail-fast", false, "enables stop on failed test")

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


return nil
}

Expand Down Expand Up @@ -171,21 +170,22 @@ func updateProjectConfigWithFuzzFlags(cmd *cobra.Command, projectConfig *config.
}
}


// Update StopOnFailedTest enablement
// Update stop on failed test feature
if cmd.Flags().Changed("fail-fast") {
projectConfig.Fuzzing.Testing.StopOnFailedTest, err = cmd.Flags().GetBool("fail-fast")
failFast, err := cmd.Flags().GetBool("fail-fast")
if err != nil {
return err
}
projectConfig.Fuzzing.Testing.StopOnFailedTest = failFast
}

// Update configuration to exploration mode
if cmd.Flags().Changed("explore") {
exploreBool, err := cmd.Flags().GetBool("explore")
explore, err := cmd.Flags().GetBool("explore")
if err != nil {
return err
}
if exploreBool {
if explore {
projectConfig.Fuzzing.Testing.StopOnFailedTest = false
projectConfig.Fuzzing.Testing.StopOnNoTests = false
projectConfig.Fuzzing.Testing.AssertionTesting.Enabled = false
Expand Down

0 comments on commit aefbfaf

Please sign in to comment.