run_tests: Exit with error if failed tests were found

This commit is contained in:
Alexander Neumann 2015-06-28 13:51:55 +02:00
parent c410cd5584
commit d9a8dcfd67
1 changed files with 6 additions and 0 deletions

View File

@ -145,6 +145,7 @@ func main() {
fmt.Fprintln(file, "mode: set")
failedTests := false
for _, dir := range dirs {
err := filepath.Walk(dir,
func(p string, fi os.FileInfo, e error) error {
@ -169,10 +170,15 @@ func main() {
if err != nil {
fmt.Fprintf(os.Stderr, "walk(%q): %v\n", dir, err)
failedTests = true
}
}
err = file.Close()
fmt.Printf("coverprofile: %v\n", file.Name())
if failedTests {
os.Exit(1)
}
}