return false, err
}
cmd.Args = append(cmd.Args, "-dM", "-E", "../../../src/runtime/cgo/libcgo.h")
+ cmdStr := strings.Join(cmd.Args, " ")
out, err := cmd.CombinedOutput()
if err != nil {
- return false, fmt.Errorf("%#q exited with %v\n%s", strings.Join(cmd.Args, " "), err, out)
+ return false, fmt.Errorf("%#q exited with %v\n%s", cmdStr, err, out)
}
if !bytes.Contains(out, []byte("#define CGO_TSAN")) {
- return true, fmt.Errorf("%#q did not define CGO_TSAN")
+ return true, fmt.Errorf("%#q did not define CGO_TSAN", cmdStr)
}
return false, nil
}
}
runAction = installAction // make sure runAction != nil even if not running test
}
+ var vetRunAction *work.Action
if testC {
printAction = &work.Action{Mode: "test print (nop)", Package: p, Deps: []*work.Action{runAction}} // nop
+ vetRunAction = printAction
} else {
// run test
c := new(runCache)
TryCache: c.tryCache,
Objdir: testDir,
}
- if len(ptest.GoFiles)+len(ptest.CgoFiles) > 0 {
- addTestVet(b, ptest, runAction, installAction)
- }
- if pxtest != nil {
- addTestVet(b, pxtest, runAction, installAction)
- }
+ vetRunAction = runAction
cleanAction = &work.Action{
Mode: "test clean",
Func: builderCleanTest,
IgnoreFail: true, // print even if test failed
}
}
+
+ if len(ptest.GoFiles)+len(ptest.CgoFiles) > 0 {
+ addTestVet(b, ptest, vetRunAction, installAction)
+ }
+ if pxtest != nil {
+ addTestVet(b, pxtest, vetRunAction, installAction)
+ }
+
if installAction != nil {
if runAction != installAction {
installAction.Deps = append(installAction.Deps, runAction)