test: reduce unnecessary pkgs compilation for llgo test

This commit is contained in:
Li Jie
2025-03-19 11:25:25 +08:00
parent fd4c22308d
commit a732fa237c

View File

@@ -175,6 +175,14 @@ func Do(args []string, conf *Config) ([]Package, error) {
}
case ModeRun:
return nil, fmt.Errorf("cannot run multiple packages")
case ModeTest:
newInitial := make([]*packages.Package, 0, len(initial))
for _, pkg := range initial {
if needLink(pkg, mode) {
newInitial = append(newInitial, pkg)
}
}
initial = newInitial
}
}