mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/go: simplify flags for coverage
The single flag -cover provides the default simplest behavior. The other flags, -covermode and -coverprofile, provide more control. The three flags interconnect to work well. R=rsc, adg CC=golang-dev https://golang.org/cl/10364044
This commit is contained in:
parent
8e8b8b85c2
commit
27cca31ee1
4 changed files with 69 additions and 35 deletions
|
|
@ -122,7 +122,7 @@ var (
|
|||
|
||||
// Report as tests are run; default is silent for success.
|
||||
chatty = flag.Bool("test.v", false, "verbose: print additional output")
|
||||
cover = flag.String("test.cover", "", "cover mode: set, count, atomic; default is none")
|
||||
coverMode = flag.String("test.covermode", "", "cover mode: set, count, atomic; default is none")
|
||||
coverProfile = flag.String("test.coverprofile", "", "write a coveraage profile to the named file after execution")
|
||||
match = flag.String("test.run", "", "regular expression to select tests and examples to run")
|
||||
memProfile = flag.String("test.memprofile", "", "write a memory profile to the named file after execution")
|
||||
|
|
@ -520,7 +520,7 @@ func after() {
|
|||
}
|
||||
f.Close()
|
||||
}
|
||||
if *cover != "" {
|
||||
if *coverMode != "" {
|
||||
coverReport()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue