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/ssl/test/runner/runner.go b/ssl/test/runner/runner.go
index f14833b..084ae46 100644
--- a/ssl/test/runner/runner.go
+++ b/ssl/test/runner/runner.go
@@ -3404,4 +3404,8 @@
 			fmt.Fprintf(os.Stderr, "Error: %s\n", err)
 		}
 	}
+
+	if !testOutput.allPassed {
+		os.Exit(1)
+	}
 }
diff --git a/ssl/test/runner/test_output.go b/ssl/test/runner/test_output.go
index f06da6f..bcb7a93 100644
--- a/ssl/test/runner/test_output.go
+++ b/ssl/test/runner/test_output.go
@@ -29,6 +29,7 @@
 	SecondsSinceEpoch float64               `json:"seconds_since_epoch"`
 	NumFailuresByType map[string]int        `json:"num_failures_by_type"`
 	Tests             map[string]testResult `json:"tests"`
+	allPassed         bool
 }
 
 type testResult struct {
@@ -44,6 +45,7 @@
 		SecondsSinceEpoch: float64(time.Now().UnixNano()) / float64(time.Second/time.Nanosecond),
 		NumFailuresByType: make(map[string]int),
 		Tests:             make(map[string]testResult),
+		allPassed:         true,
 	}
 }
 
@@ -57,6 +59,9 @@
 		IsUnexpected: result != "PASS",
 	}
 	t.NumFailuresByType[result]++
+	if result != "PASS" {
+		t.allPassed = false
+	}
 }
 
 func (t *testOutput) writeTo(name string) error {