vendor: update all dependencies

This commit is contained in:
Nick Craig-Wood
2017-07-23 08:51:42 +01:00
parent 0b6fba34a3
commit eb87cf6f12
2008 changed files with 352617 additions and 1004734 deletions
+18 -3
View File
@@ -12,6 +12,7 @@ import (
"github.com/stretchr/testify/require"
)
var allTestsFilter = func(_, _ string) (bool, error) { return true, nil }
var matchMethod = flag.String("testify.m", "", "regular expression to select tests of the testify suite to run")
// Suite is a basic testing suite with methods for storing and
@@ -104,10 +105,20 @@ func Run(t *testing.T, suite TestingSuite) {
tests = append(tests, test)
}
}
runTests(t, tests)
}
if !testing.RunTests(func(_, _ string) (bool, error) { return true, nil },
tests) {
t.Fail()
func runTests(t testing.TB, tests []testing.InternalTest) {
r, ok := t.(runner)
if !ok { // backwards compatibility with Go 1.6 and below
if !testing.RunTests(allTestsFilter, tests) {
t.Fail()
}
return
}
for _, test := range tests {
r.Run(test.Name, test.F)
}
}
@@ -119,3 +130,7 @@ func methodFilter(name string) (bool, error) {
}
return regexp.MatchString(*matchMethod, name)
}
type runner interface {
Run(name string, f func(t *testing.T)) bool
}
+11 -7
View File
@@ -8,6 +8,7 @@ import (
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
// SuiteRequireTwice is intended to test the usage of suite.Require in two
@@ -19,7 +20,7 @@ type SuiteRequireTwice struct{ Suite }
// A regression would result on these tests panicking rather than failing.
func TestSuiteRequireTwice(t *testing.T) {
ok := testing.RunTests(
func(_, _ string) (bool, error) { return true, nil },
allTestsFilter,
[]testing.InternalTest{{
Name: "TestSuiteRequireTwice",
F: func(t *testing.T) {
@@ -267,16 +268,19 @@ func (sc *StdoutCapture) StopCapture() (string, error) {
}
func TestSuiteLogging(t *testing.T) {
testT := testing.T{}
suiteLoggingTester := new(SuiteLoggingTester)
capture := StdoutCapture{}
internalTest := testing.InternalTest{
Name: "SomeTest",
F: func(subT *testing.T) {
Run(subT, suiteLoggingTester)
},
}
capture.StartCapture()
Run(&testT, suiteLoggingTester)
testing.RunTests(allTestsFilter, []testing.InternalTest{internalTest})
output, err := capture.StopCapture()
assert.Nil(t, err, "Got an error trying to capture stdout!")
require.NoError(t, err, "Got an error trying to capture stdout and stderr!")
require.NotEmpty(t, output, "output content must not be empty")
// Failed tests' output is always printed
assert.Contains(t, output, "TESTLOGFAIL")