From 270f0a77617ef2a00eb3e3a50a00f2fe58827e38 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Thu, 17 Mar 2016 14:41:36 -0400 Subject: [PATCH] Print an error if no tests match in runner. Otherwise it's confusing if you mistype the test name. Change-Id: Idf32081958f85f3b5aeb8993a07f6975c27644f8 Reviewed-on: https://boringssl-review.googlesource.com/7500 Reviewed-by: Emily Stark (Dunn) Reviewed-by: David Benjamin --- ssl/test/runner/runner.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ssl/test/runner/runner.go b/ssl/test/runner/runner.go index 9754ad73..91007521 100644 --- a/ssl/test/runner/runner.go +++ b/ssl/test/runner/runner.go @@ -5087,11 +5087,17 @@ func main() { go worker(statusChan, testChan, *shimPath, &wg) } + var foundTest bool for i := range testCases { if len(*testToRun) == 0 || *testToRun == testCases[i].name { + foundTest = true testChan <- &testCases[i] } } + if !foundTest { + fmt.Fprintf(os.Stderr, "No test named '%s'\n", *testToRun) + os.Exit(1) + } close(testChan) wg.Wait()