aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2017-08-18 17:43:33 -0700
committerIan Lance Taylor <iant@golang.org>2017-08-23 22:38:02 +0000
commit645ecf5d4806bfef470da2ac1fad8df40c73beb8 (patch)
tree8776d67da383af6a834d5e6d069e852a69aa11a1 /src
parent75fbc8a3d00cf310a5f67aae946fbc346dbb725d (diff)
downloadgo-645ecf5d4806bfef470da2ac1fad8df40c73beb8.tar.xz
cmd/dist: rearrange a couple of tests
Run "cmd/go terminal test" after standard library tests. Run "testing race detector" before cgo tests, not in the middle of them. Fixes #21524 Change-Id: I32964ec6377dd070242138ec452bd8ab1821dcc5 Reviewed-on: https://go-review.googlesource.com/57230 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Joe Tsai <joetsai@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/dist/test.go58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go
index 0b041117dd..89014e5d0a 100644
--- a/src/cmd/dist/test.go
+++ b/src/cmd/dist/test.go
@@ -353,27 +353,6 @@ func (t *tester) registerTests() {
return
}
- // This test needs its stdout/stderr to be terminals, so we don't run it from cmd/go's tests.
- // See issue 18153.
- if t.goos == "linux" {
- t.tests = append(t.tests, distTest{
- name: "cmd_go_test_terminal",
- heading: "cmd/go terminal test",
- fn: func(dt *distTest) error {
- t.runPending(dt)
- if !stdOutErrAreTerminals() {
- fmt.Println("skipping terminal test; stdout/stderr not terminals")
- return nil
- }
- cmd := exec.Command("go", "test")
- cmd.Dir = filepath.Join(os.Getenv("GOROOT"), "src/cmd/go/testdata/testterminal18153")
- cmd.Stdout = os.Stdout
- cmd.Stderr = os.Stderr
- return cmd.Run()
- },
- })
- }
-
// Fast path to avoid the ~1 second of `go list std cmd` when
// the caller lists specific tests to run. (as the continuous
// build coordinator does).
@@ -434,6 +413,27 @@ func (t *tester) registerTests() {
})
}
+ // This test needs its stdout/stderr to be terminals, so we don't run it from cmd/go's tests.
+ // See issue 18153.
+ if t.goos == "linux" {
+ t.tests = append(t.tests, distTest{
+ name: "cmd_go_test_terminal",
+ heading: "cmd/go terminal test",
+ fn: func(dt *distTest) error {
+ t.runPending(dt)
+ if !stdOutErrAreTerminals() {
+ fmt.Println("skipping terminal test; stdout/stderr not terminals")
+ return nil
+ }
+ cmd := exec.Command("go", "test")
+ cmd.Dir = filepath.Join(os.Getenv("GOROOT"), "src/cmd/go/testdata/testterminal18153")
+ cmd.Stdout = os.Stdout
+ cmd.Stderr = os.Stderr
+ return cmd.Run()
+ },
+ })
+ }
+
// On the builders only, test that a moved GOROOT still works.
// Fails on iOS because CC_FOR_TARGET refers to clangwrap.sh
// in the unmoved GOROOT.
@@ -535,6 +535,14 @@ func (t *tester) registerTests() {
},
})
+ if t.raceDetectorSupported() {
+ t.tests = append(t.tests, distTest{
+ name: "race",
+ heading: "Testing race detector",
+ fn: t.raceTest,
+ })
+ }
+
if t.cgoEnabled && !t.iOS() {
// Disabled on iOS. golang.org/issue/15919
t.tests = append(t.tests, distTest{
@@ -576,14 +584,6 @@ func (t *tester) registerTests() {
})
}
- if t.raceDetectorSupported() {
- t.tests = append(t.tests, distTest{
- name: "race",
- heading: "Testing race detector",
- fn: t.raceTest,
- })
- }
-
if t.hasBash() && t.cgoEnabled && t.goos != "android" && t.goos != "darwin" {
t.registerTest("testgodefs", "../misc/cgo/testgodefs", "./test.bash")
}