From: Josh Bleecher Snyder Date: Wed, 31 Aug 2016 01:11:10 +0000 (-0700) Subject: cmd/dist: make test names consistent X-Git-Tag: go1.8beta1~1520 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=98def53f5610247b3d635ff85bf47fd19e848c01;p=gostls13.git 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 Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index e56d108ad4..7073992e6e 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -502,7 +502,7 @@ func (t *tester) registerTests() { }) } 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") { t.registerTest("testcshared", "../misc/cgo/testcshared", "./test.bash") @@ -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{ name: name, - heading: dirBanner, + heading: heading, fn: func(dt *distTest) error { 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()) - defer os.Remove(filepath.Join(t.goroot, dirBanner, "test.test")) - cmd := t.dirCmd(dirBanner, "go", "test", t.tags(), "-c", "-o", "test.test", pkg) + defer os.Remove(filepath.Join(t.goroot, dir, "test.test")) + cmd := t.dirCmd(dir, "go", "test", t.tags(), "-c", "-o", "test.test", pkg) cmd.Env = env if err := cmd.Run(); err != nil { return err } - return t.dirCmd(dirBanner, "./test.test").Run() + return t.dirCmd(dir, "./test.test").Run() } func (t *tester) cgoTest(dt *distTest) error {