testing: rename cmdline flags to avoid conflicts

Flags defined in the testing package may conflict
with real flags defined in the main package, or in
any other imported package.

This change makes them less likely to be used for
other purposes.

R=r, rsc, r2
CC=golang-dev
https://golang.org/cl/4167055
This commit is contained in:
Gustavo Niemeyer 2011-02-17 16:17:33 -08:00 committed by Rob Pike
parent 8ba4df2e9a
commit 6d9db54be5
3 changed files with 13 additions and 13 deletions

View file

@ -47,8 +47,8 @@ import (
)
// Report as tests are run; default is silent for success.
var chatty = flag.Bool("v", false, "verbose: print additional output")
var match = flag.String("match", "", "regular expression to select tests to run")
var chatty = flag.Bool("test.v", false, "verbose: print additional output")
var match = flag.String("test.run", "", "regular expression to select tests to run")
// Insert final newline if needed and tabs after internal newlines.
@ -145,7 +145,7 @@ func Main(matchString func(pat, str string) (bool, os.Error), tests []InternalTe
for i := 0; i < len(tests); i++ {
matched, err := matchString(*match, tests[i].Name)
if err != nil {
println("invalid regexp for -match:", err.String())
println("invalid regexp for -test.run:", err.String())
os.Exit(1)
}
if !matched {