runner and all_tests should exit with failure on failing tests.
Otherwise the bots don't notice.
BUG=473924
Change-Id: Idb8cc4c255723ebbe2d52478040a70648910bf37
Reviewed-on: https://boringssl-review.googlesource.com/4232
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/util/all_tests.go b/util/all_tests.go
index 1a0651a..785e423 100644
--- a/util/all_tests.go
+++ b/util/all_tests.go
@@ -219,18 +219,19 @@
}
}
- if len(failed) == 0 {
- fmt.Printf("\nAll tests passed!\n")
- } else {
- fmt.Printf("\n%d of %d tests failed:\n", len(failed), len(tests))
- for _, test := range failed {
- fmt.Printf("\t%s\n", strings.Join([]string(test), " "))
- }
- }
-
if *jsonOutput != "" {
if err := testOutput.writeTo(*jsonOutput); err != nil {
fmt.Fprintf(os.Stderr, "Error: %s\n", err)
}
}
+
+ if len(failed) > 0 {
+ fmt.Printf("\n%d of %d tests failed:\n", len(failed), len(tests))
+ for _, test := range failed {
+ fmt.Printf("\t%s\n", strings.Join([]string(test), " "))
+ }
+ os.Exit(1)
+ }
+
+ fmt.Printf("\nAll tests passed!\n")
}