diff options
Diffstat (limited to 'libgo/go/testing/testing.go')
-rw-r--r-- | libgo/go/testing/testing.go | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libgo/go/testing/testing.go b/libgo/go/testing/testing.go index ab8cf99..d189390 100644 --- a/libgo/go/testing/testing.go +++ b/libgo/go/testing/testing.go @@ -48,6 +48,13 @@ import ( ) var ( + // The short flag requests that tests run more quickly, but its functionality + // is provided by test writers themselves. The testing package is just its + // home. The all.bash installation script sets it to make installation more + // efficient, but by default the flag is off so a plain "gotest" will do a + // full test of the package. + short = flag.Bool("test.short", false, "run smaller test suite to save time") + // Report as tests are run; default is silent for success. chatty = flag.Bool("test.v", false, "verbose: print additional output") match = flag.String("test.run", "", "regular expression to select tests to run") @@ -56,6 +63,11 @@ var ( cpuProfile = flag.String("test.cpuprofile", "", "write a cpu profile to the named file during execution") ) +// Short reports whether the -test.short flag is set. +func Short() bool { + return *short +} + // Insert final newline if needed and tabs after internal newlines. func tabify(s string) string { @@ -174,7 +186,7 @@ func RunTests(matchString func(pat, str string) (bool, os.Error), tests []Intern go tRunner(t, &tests[i]) <-t.ch ns += time.Nanoseconds() - tstr := fmt.Sprintf("(%.1f seconds)", float64(ns)/1e9) + tstr := fmt.Sprintf("(%.2f seconds)", float64(ns)/1e9) if t.failed { println("--- FAIL:", tests[i].Name, tstr) print(t.errors) |