Skip to content

Commit 6c270ae

Browse files
committed
Re-order logic to give TestMain-specific error messages precedence
1 parent 15d38c0 commit 6c270ae

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tool.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,10 +334,6 @@ func main() {
334334

335335
tests := &testFuncs{Package: pkg.Package}
336336
collectTests := func(testPkg *gbuild.PackageData, testPkgName string, needVar *bool) error {
337-
_, err := s.BuildPackage(testPkg)
338-
if err != nil {
339-
return err
340-
}
341337
if testPkgName == "_test" {
342338
for _, file := range pkg.TestGoFiles {
343339
if err := tests.load(filepath.Join(pkg.Package.Dir, file), testPkgName, &tests.ImportTest, &tests.NeedTest); err != nil {
@@ -351,6 +347,10 @@ func main() {
351347
}
352348
}
353349
}
350+
_, err := s.BuildPackage(testPkg)
351+
if err != nil {
352+
return err
353+
}
354354
return nil
355355
}
356356

0 commit comments

Comments
 (0)