Commit 190fb818 authored by meowsbits's avatar meowsbits Committed by Felix Lange

build: add test cmd flag -v for verbose logs (#20298)

Adds flags akin to -coverage flag enabling the test runner
to use go test's -v flag, signaling verbose test log output.
parent b02afb6b
...@@ -318,6 +318,7 @@ func goToolArch(arch string, cc string, subcmd string, args ...string) *exec.Cmd ...@@ -318,6 +318,7 @@ func goToolArch(arch string, cc string, subcmd string, args ...string) *exec.Cmd
func doTest(cmdline []string) { func doTest(cmdline []string) {
coverage := flag.Bool("coverage", false, "Whether to record code coverage") coverage := flag.Bool("coverage", false, "Whether to record code coverage")
verbose := flag.Bool("v", false, "Whether to log verbosely")
flag.CommandLine.Parse(cmdline) flag.CommandLine.Parse(cmdline)
env := build.Env() env := build.Env()
...@@ -334,6 +335,9 @@ func doTest(cmdline []string) { ...@@ -334,6 +335,9 @@ func doTest(cmdline []string) {
if *coverage { if *coverage {
gotest.Args = append(gotest.Args, "-covermode=atomic", "-cover") gotest.Args = append(gotest.Args, "-covermode=atomic", "-cover")
} }
if *verbose {
gotest.Args = append(gotest.Args, "-v")
}
gotest.Args = append(gotest.Args, packages...) gotest.Args = append(gotest.Args, packages...)
build.MustRun(gotest) build.MustRun(gotest)
......
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