1
0
mirror of https://github.com/golang/go synced 2024-11-26 05:17:58 -07:00

[dev.typeparams] cmd/compile: do not skip TestUnifiedCompare in short mode

Instead, just testing the runtime package in short mode instead of std.
So trybot can help catching any mistake earlier.

Change-Id: I5bc859a59afa13a10d436a798258ac154c7d27b2
Reviewed-on: https://go-review.googlesource.com/c/go/+/330836
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Cuong Manh Le 2021-06-27 00:51:16 +07:00
parent 27e3b797bb
commit 3ea0fcfe15

View File

@ -16,7 +16,7 @@ import (
)
var (
flagPkgs = flag.String("pkgs", "std", "list of packages to compare")
flagPkgs = flag.String("pkgs", "std", "list of packages to compare (ignored in -short mode)")
flagAll = flag.Bool("all", false, "enable testing of all GOOS/GOARCH targets")
flagParallel = flag.Bool("parallel", false, "test GOOS/GOARCH targets in parallel")
)
@ -37,10 +37,6 @@ var (
// command's -run flag for subtest matching is recommended for less
// powerful machines.
func TestUnifiedCompare(t *testing.T) {
if testing.Short() {
t.Skip("skipping test in short mode")
}
targets, err := exec.Command("go", "tool", "dist", "list").Output()
if err != nil {
t.Fatal(err)
@ -112,11 +108,17 @@ type pkg struct {
func loadPackages(t *testing.T, goos, goarch, gcflags string) []pkg {
args := []string{"list", "-e", "-export", "-json", "-gcflags=all=" + gcflags, "--"}
args = append(args, strings.Fields(*flagPkgs)...)
if testing.Short() {
t.Log("short testing mode; only testing package runtime")
args = append(args, "runtime")
} else {
args = append(args, strings.Fields(*flagPkgs)...)
}
cmd := exec.Command("go", args...)
cmd.Env = append(os.Environ(), "GOOS="+goos, "GOARCH="+goarch)
cmd.Stderr = os.Stderr
t.Logf("running %v", cmd)
stdout, err := cmd.StdoutPipe()
if err != nil {
t.Fatal(err)