Fix up all_tests.go parallelism support.

A len(tests) should have been len(testCases), the code never added to the
sync.WaitGroup, and feeding tests to the tests channel blocks on the tests
completing, so with one worker the results didn't stream. (And if the results
channel wasn't large enough, we'd deadlock.)

Change-Id: Iee37507b9706b14cffddd9c1b55fc311ee9b666d
Reviewed-on: https://boringssl-review.googlesource.com/7292
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/util/all_tests.go b/util/all_tests.go
index ddc3313..38899bb 100644
--- a/util/all_tests.go
+++ b/util/all_tests.go
@@ -253,18 +253,19 @@
 
 	var wg sync.WaitGroup
 	tests := make(chan test, *numWorkers)
-	results := make(chan result, len(testCases))
+	results := make(chan result, *numWorkers)
 
 	for i := 0; i < *numWorkers; i++ {
+		wg.Add(1)
 		go worker(tests, results, &wg)
 	}
 
-	for _, test := range testCases {
-		tests <- test
-	}
-	close(tests)
-
 	go func() {
+		for _, test := range testCases {
+			tests <- test
+		}
+		close(tests)
+
 		wg.Wait()
 		close(results)
 	}()
@@ -296,7 +297,7 @@
 	}
 
 	if len(failed) > 0 {
-		fmt.Printf("\n%d of %d tests failed:\n", len(failed), len(tests))
+		fmt.Printf("\n%d of %d tests failed:\n", len(failed), len(testCases))
 		for _, test := range failed {
 			fmt.Printf("\t%s\n", strings.Join([]string(test), " "))
 		}