mirror of
https://github.com/golang/go
synced 2024-10-05 16:41:21 -06:00
[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 <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
d2107fc987
commit
6b9b618787
42
src/cmd/dist/test.go
vendored
42
src/cmd/dist/test.go
vendored
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user