Merge pull request #1128 from luoliwoshang/test/exit

build:exit when test fail
This commit is contained in:
xushiwei
2025-05-22 05:50:49 +08:00
committed by GitHub

View File

@@ -513,6 +513,7 @@ func linkMainPkg(ctx *context, pkg *packages.Package, pkgs []*aPackage, conf *Co
cmd.Run() cmd.Run()
if s := cmd.ProcessState; s != nil { if s := cmd.ProcessState; s != nil {
fmt.Fprintf(os.Stderr, "%s: exit code %d\n", app, s.ExitCode()) fmt.Fprintf(os.Stderr, "%s: exit code %d\n", app, s.ExitCode())
mockable.Exit(s.ExitCode())
} }
case ModeRun: case ModeRun:
args := make([]string, 0, len(conf.RunArgs)+1) args := make([]string, 0, len(conf.RunArgs)+1)