From: Josh Bleecher Snyder Date: Fri, 4 Sep 2015 15:50:28 +0000 (-0700) Subject: [dev.ssa] cmd/compile: run std tests with SSA codegen as part of all.bash X-Git-Tag: go1.7beta1~1623^2^2~201 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=6b9b618787156dea53d14dde924b71639548da33;p=gostls13.git [dev.ssa] cmd/compile: run std tests with SSA codegen as part of all.bash Todd Neal has made all the stdlib tests pass. Now the trybots and build dashboard can help us keep them passing. All of this code will be unwound bit by bit as SSA matures and then becomes the default. Change-Id: I52ac7e72a87d329ccce974d6671c054374828d11 Reviewed-on: https://go-review.googlesource.com/14294 Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index d0e634640c..4cc181f610 100755 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -12,6 +12,7 @@ import ( "log" "os" "os/exec" + "path" "path/filepath" "regexp" "strconv" @@ -274,6 +275,39 @@ func (t *tester) registerStdTest(pkg string) { }) } +// TODO: Remove when SSA codegen is used by default. +func (t *tester) registerSSATest(pkg string) { + switch pkg { + // known failures due to GOGC=off + case "runtime", "runtime/pprof", "runtime/trace", "sync": + return + // TODO: fix these failures + case "math/big", "cmd/compile/internal/big": + return + } + t.tests = append(t.tests, distTest{ + name: "go_test_ssa:" + pkg, + heading: "Testing packages with SSA codegen.", + fn: func() error { + args := []string{ + "test", + "-short", + t.timeout(180 * 3), // SSA generates slower code right now + "-gcflags=" + os.Getenv("GO_GCFLAGS"), + } + if t.race { + args = append(args, "-race") + } + args = append(args, pkg) + cmd := exec.Command("go", args...) + cmd.Env = mergeEnvLists([]string{"GOSSAPKG=" + path.Base(pkg), "GOGC=off"}, os.Environ()) + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + return cmd.Run() + }, + }) +} + func (t *tester) registerRaceBenchTest(pkg string) { testName := "go_test_bench:" + pkg if t.runRx == nil || t.runRx.MatchString(testName) { @@ -317,6 +351,9 @@ func (t *tester) registerTests() { if strings.HasPrefix(name, "go_test_bench:") { t.registerRaceBenchTest(strings.TrimPrefix(name, "go_test_bench:")) } + if t.goarch == "amd64" && strings.HasPrefix(name, "go_test_ssa:") { + t.registerSSATest(strings.TrimPrefix(name, "go_test_ssa:")) + } } } else { // Use a format string to only list packages and commands that have tests. @@ -333,6 +370,11 @@ func (t *tester) registerTests() { for _, pkg := range pkgs { t.registerStdTest(pkg) } + if t.goarch == "amd64" { + for _, pkg := range pkgs { + t.registerSSATest(pkg) + } + } if t.race { for _, pkg := range pkgs { t.registerRaceBenchTest(pkg)