Skip to content

Commit

Permalink
add verification for config
Browse files Browse the repository at this point in the history
  • Loading branch information
anishnaik committed Aug 30, 2023
1 parent a3e87bc commit 1a2c3e1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions fuzzing/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,22 @@ func (p *ProjectConfig) Validate() error {
return errors.New("project configuration must specify only a well-formed deployer address")
}

// Verify property testing fields.
if p.Fuzzing.Testing.PropertyTesting.Enabled {
// Test prefixes must be supplied if property testing is enabled.
if len(p.Fuzzing.Testing.PropertyTesting.TestPrefixes) == 0 {
return errors.New("project configuration must specify test name prefixes if property testing is enabled")
}
}

// Verify optimization testing fields.
if p.Fuzzing.Testing.OptimizationTesting.Enabled {
// Test prefixes must be supplied if property testing is enabled.
if len(p.Fuzzing.Testing.OptimizationTesting.TestPrefixes) == 0 {
return errors.New("project configuration must specify test name prefixes if optimization testing is enabled")
}
}

// Ensure that the log level is a valid one
if _, err := zerolog.ParseLevel(p.Logging.Level.String()); err != nil {
return err
Expand Down

0 comments on commit 1a2c3e1

Please sign in to comment.