Commit 98def53f authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

cmd/dist: make test names consistent

Current banners are:

##### Building Go bootstrap tool.
##### Building Go toolchain using /Users/josh/go/1.4.
##### Building go_bootstrap for host, darwin/amd64.
##### Building packages and commands for darwin/amd64.
##### Testing packages.
##### GOMAXPROCS=2 runtime -cpu=1,2,4
##### Testing without libgcc.
##### sync -cpu=10
##### ../misc/cgo/stdio
##### ../misc/cgo/life
##### ../misc/cgo/fortran
##### ../misc/cgo/test
##### Testing race detector
##### ../misc/cgo/testso
##### ../misc/cgo/testsovar
##### misc/cgo/testcarchive
##### ../misc/cgo/testcshared
##### ../misc/cgo/errors
##### ../test/bench/go1
##### ../test
##### API check

One of these things is not like the others.
Fix that.

Change-Id: If0bd8ea9293d73b5d1b70d6bf676bd9192991505
Reviewed-on: https://go-review.googlesource.com/26759
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 7eddaf5f
...@@ -502,7 +502,7 @@ func (t *tester) registerTests() { ...@@ -502,7 +502,7 @@ func (t *tester) registerTests() {
}) })
} }
if t.supportedBuildmode("c-archive") { if t.supportedBuildmode("c-archive") {
t.registerHostTest("testcarchive", "misc/cgo/testcarchive", "carchive_test.go") t.registerHostTest("testcarchive", "../misc/cgo/testcarchive", "misc/cgo/testcarchive", "carchive_test.go")
} }
if t.supportedBuildmode("c-shared") { if t.supportedBuildmode("c-shared") {
t.registerTest("testcshared", "../misc/cgo/testcshared", "./test.bash") t.registerTest("testcshared", "../misc/cgo/testcshared", "./test.bash")
...@@ -700,26 +700,26 @@ func (t *tester) supportedBuildmode(mode string) bool { ...@@ -700,26 +700,26 @@ func (t *tester) supportedBuildmode(mode string) bool {
} }
} }
func (t *tester) registerHostTest(name, dirBanner, pkg string) { func (t *tester) registerHostTest(name, heading, dir, pkg string) {
t.tests = append(t.tests, distTest{ t.tests = append(t.tests, distTest{
name: name, name: name,
heading: dirBanner, heading: heading,
fn: func(dt *distTest) error { fn: func(dt *distTest) error {
t.runPending(dt) t.runPending(dt)
return t.runHostTest(dirBanner, pkg) return t.runHostTest(dir, pkg)
}, },
}) })
} }
func (t *tester) runHostTest(dirBanner, pkg string) error { func (t *tester) runHostTest(dir, pkg string) error {
env := mergeEnvLists([]string{"GOARCH=" + t.gohostarch, "GOOS=" + t.gohostos}, os.Environ()) env := mergeEnvLists([]string{"GOARCH=" + t.gohostarch, "GOOS=" + t.gohostos}, os.Environ())
defer os.Remove(filepath.Join(t.goroot, dirBanner, "test.test")) defer os.Remove(filepath.Join(t.goroot, dir, "test.test"))
cmd := t.dirCmd(dirBanner, "go", "test", t.tags(), "-c", "-o", "test.test", pkg) cmd := t.dirCmd(dir, "go", "test", t.tags(), "-c", "-o", "test.test", pkg)
cmd.Env = env cmd.Env = env
if err := cmd.Run(); err != nil { if err := cmd.Run(); err != nil {
return err return err
} }
return t.dirCmd(dirBanner, "./test.test").Run() return t.dirCmd(dir, "./test.test").Run()
} }
func (t *tester) cgoTest(dt *distTest) error { func (t *tester) cgoTest(dt *distTest) error {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment