test helpers: Always print stack trace

This commit is contained in:
Alexander Neumann 2016-09-25 18:27:03 +02:00
parent eeec0d63c2
commit 0a752b9fab
2 changed files with 3 additions and 3 deletions

View file

@ -27,9 +27,9 @@ func IsFatal(err error) bool {
return ok && e.Fatal() return ok && e.Fatal()
} }
// Fatal returns an error which implements the Fataler interface. // Fatal returns a wrapped error which implements the Fataler interface.
func Fatal(s string) error { func Fatal(s string) error {
return fatalError(s) return Wrap(fatalError(s), "Fatal")
} }
// Fatalf returns an error which implements the Fataler interface. // Fatalf returns an error which implements the Fataler interface.

View file

@ -41,7 +41,7 @@ func OKs(tb testing.TB, errs []error) {
if err != nil { if err != nil {
errFound = true errFound = true
_, file, line, _ := runtime.Caller(1) _, file, line, _ := runtime.Caller(1)
fmt.Printf("\033[31m%s:%d: unexpected error: %s\033[39m\n\n", filepath.Base(file), line, err.Error()) fmt.Printf("\033[31m%s:%d: unexpected error: %+v\033[39m\n\n", filepath.Base(file), line, err.Error())
} }
} }
if errFound { if errFound {