mirror of https://github.com/stretchr/testify.git
Add warning in log when no tests are run within a suite
parent
36f3f1ec85
commit
a41f2db807
|
@ -179,16 +179,20 @@ func Run(t *testing.T, suite TestingSuite) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func runTests(t testing.TB, tests []testing.InternalTest) {
|
func runTests(t testing.TB, tests []testing.InternalTest) {
|
||||||
r, ok := t.(runner)
|
if len(tests) == 0 {
|
||||||
if !ok { // backwards compatibility with Go 1.6 and below
|
t.Log("warning: no tests to run")
|
||||||
if !testing.RunTests(allTestsFilter, tests) {
|
} else {
|
||||||
t.Fail()
|
r, ok := t.(runner)
|
||||||
|
if !ok { // backwards compatibility with Go 1.6 and below
|
||||||
|
if !testing.RunTests(allTestsFilter, tests) {
|
||||||
|
t.Fail()
|
||||||
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
r.Run(test.Name, test.F)
|
r.Run(test.Name, test.F)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue