Commit 9262e218 authored by Michael Hudson-Doyle's avatar Michael Hudson-Doyle Committed by Ian Lance Taylor

misc/cgo/testshared: do not capture output of go commands in verbose mode

Change-Id: I8694ee5e5642c31815ae63cd414a3b1fcd9c95b0
Reviewed-on: https://go-review.googlesource.com/10411Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent cf2736c4
......@@ -47,10 +47,17 @@ func goCmd(t *testing.T, args ...string) {
}
newargs = append(newargs, args[1:]...)
c := exec.Command("go", newargs...)
var output []byte
var err error
if testing.Verbose() {
fmt.Printf("+ go %s\n", strings.Join(newargs, " "))
c.Stdout = os.Stdout
c.Stderr = os.Stderr
err = c.Run()
} else {
output, err = c.CombinedOutput()
}
if output, err := c.CombinedOutput(); err != nil {
if err != nil {
if t != nil {
t.Errorf("executing %s failed %v:\n%s", strings.Join(c.Args, " "), err, output)
} else {
......
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