From: Rob Pike Date: Wed, 19 Nov 2008 19:50:58 +0000 (-0800) Subject: gotest, via testing.go, should warn you if you failed to create any tests. X-Git-Tag: weekly.2009-11-06~2670 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=572cad871961eed816a4935806ed65c53b1e0d03;p=gostls13.git gotest, via testing.go, should warn you if you failed to create any tests. when chatty, it should tell you how many there are. R=rsc DELTA=5 (5 added, 0 deleted, 0 changed) OCL=19590 CL=19590 --- diff --git a/src/lib/testing.go b/src/lib/testing.go index a5d960fe80..53a2c19d13 100644 --- a/src/lib/testing.go +++ b/src/lib/testing.go @@ -21,6 +21,11 @@ export type Test struct { export func Main(tests *[]Test) { flag.Parse(); ok := true; + if len(tests) == 0 { + println("warning: no tests available"); + } else if chatty { + println(len(tests), "tests to run"); + } for i := 0; i < len(tests); i++ { if chatty { println("=== RUN ", tests[i].name);