aboutsummaryrefslogtreecommitdiff
path: root/test/run.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2019-05-16 00:12:34 -0400
committerRuss Cox <rsc@golang.org>2019-05-21 12:10:31 +0000
commit4f248e988aa67a122d3355f6a22d50c1675697bb (patch)
treea379ace010859a134902a2ccc6ef074cb1574633 /test/run.go
parent2d7cb295fdda94f3d62588b7bb01a4d8b445417a (diff)
downloadgo-4f248e988aa67a122d3355f6a22d50c1675697bb.tar.gz
go-4f248e988aa67a122d3355f6a22d50c1675697bb.zip
test: skip cross-arch codegen tests in all.bash
The test/codegen tests check all architectures mentioned in the test file, but this requires building at least the runtime for that architecture. This CL changes the test to only check the local architecture, leaving checking of other architectures to the relevant builders, as usual. This cuts 'go run run.go codegen' by 12r 78u 21s. After this change, all.bash runs in ~4:40 on my laptop. For #26473. Change-Id: Ia0354d1aff2df2949f838528c8171410bc42dc8b Reviewed-on: https://go-review.googlesource.com/c/go/+/177577 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'test/run.go')
-rw-r--r--test/run.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/run.go b/test/run.go
index f66db630c5..84f5cd991c 100644
--- a/test/run.go
+++ b/test/run.go
@@ -34,6 +34,7 @@ var (
keep = flag.Bool("k", false, "keep. keep temporary directory.")
numParallel = flag.Int("n", runtime.NumCPU(), "number of parallel tests to run")
summary = flag.Bool("summary", false, "show summary of results")
+ allCodegen = flag.Bool("all_codegen", false, "run all goos/goarch for codegen")
showSkips = flag.Bool("show_skips", false, "show skipped tests")
runSkips = flag.Bool("run_skips", false, "run skipped tests (ignore skip and build tags)")
linkshared = flag.Bool("linkshared", false, "")
@@ -653,7 +654,13 @@ func (t *test) run() {
// Compile Go file and match the generated assembly
// against a set of regexps in comments.
ops := t.wantedAsmOpcodes(long)
+ self := runtime.GOOS + "/" + runtime.GOARCH
for _, env := range ops.Envs() {
+ // Only run checks relevant to the current GOOS/GOARCH,
+ // to avoid triggering a cross-compile of the runtime.
+ if string(env) != self && !strings.HasPrefix(string(env), self+"/") && !*allCodegen {
+ continue
+ }
// -S=2 forces outermost line numbers when disassembling inlined code.
cmdline := []string{"build", "-gcflags", "-S=2"}
cmdline = append(cmdline, flags...)