Skip to content

Commit

Permalink
Ensure that the output is not verbose unless -v is passed to go test.
Browse files Browse the repository at this point in the history
  • Loading branch information
knz committed Jul 14, 2020
1 parent a8a63ef commit bf6692d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions datadriven.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ var (

// Verbose returns true iff -datadriven-quiet was not passed.
func Verbose() bool {
return !*quietLog
return testing.Verbose() && !*quietLog
}

// In CockroachDB we want to quiesce all the logs across all packages.
Expand Down Expand Up @@ -366,7 +366,7 @@ func runDirective(t *testing.T, r *testDataReader, f func(*testing.T, *TestData)
t.Logf("Failed to produce diff %v", err)
}
t.Fatalf("\n%s: %s\nexpected:\n%s\nfound:\n%s", d.Pos, d.Input, d.Expected, actual)
} else if !*quietLog {
} else if Verbose() {
input := d.Input
if input == "" {
input = "<no input to command>"
Expand Down

0 comments on commit bf6692d

Please sign in to comment.