internal/build:switch workdir from testpkg like go behavior

This commit is contained in:
luoliwoshang
2025-06-12 16:40:10 +08:00
parent 26aaa65c1d
commit 48bd1d46af
2 changed files with 12 additions and 1 deletions

View File

@@ -508,6 +508,7 @@ func linkMainPkg(ctx *context, pkg *packages.Package, pkgs []*aPackage, conf *Co
switch mode {
case ModeTest:
cmd := exec.Command(app, conf.RunArgs...)
cmd.Dir = pkg.Dir
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Run()