Commit 572cad87 authored by Rob Pike's avatar Rob Pike

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
parent 60ee27d9
...@@ -21,6 +21,11 @@ export type Test struct { ...@@ -21,6 +21,11 @@ export type Test struct {
export func Main(tests *[]Test) { export func Main(tests *[]Test) {
flag.Parse(); flag.Parse();
ok := true; 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++ { for i := 0; i < len(tests); i++ {
if chatty { if chatty {
println("=== RUN ", tests[i].name); println("=== RUN ", tests[i].name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment