Skip to content

Commit

Permalink
wrap Verbose() helper in resource/testing
Browse files Browse the repository at this point in the history
  • Loading branch information
appilon authored and kmoe committed Apr 23, 2020
1 parent 71c6b0c commit ac1c092
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 1 addition & 2 deletions helper/resource/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"regexp"
"strings"
"syscall"
gotesting "testing"

"github.com/hashicorp/go-multierror"
"github.com/hashicorp/logutils"
Expand Down Expand Up @@ -540,7 +539,7 @@ func Test(t testing.T, c TestCase) {
log.SetOutput(logWriter)

// We require verbose mode so that the user knows what is going on.
if !gotesting.Verbose() && !c.IsUnitTest {
if !testing.Verbose() && !c.IsUnitTest {
t.Fatal("Acceptance tests must be run with the -v flag on tests")
}

Expand Down
9 changes: 9 additions & 0 deletions helper/resource/testing/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// importers of the SDK
package testing

import "testing"

// T is the interface used to handle the test lifecycle of a test.
//
// Users should just use a *testing.T object, which implements this.
Expand All @@ -22,3 +24,10 @@ type T interface {
type M interface {
Run() int
}

// Verbose just wraps the official testing package's helper of the same name.
// This is the final reference to the testing package in non *_test.go files
// in the SDK.
func Verbose() bool {
return testing.Verbose()
}

0 comments on commit ac1c092

Please sign in to comment.