]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: make test names consistent
authorJosh Bleecher Snyder <josharian@gmail.com>
Wed, 31 Aug 2016 01:11:10 +0000 (18:11 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Fri, 2 Sep 2016 00:15:24 +0000 (00:15 +0000)
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: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/dist/test.go

index e56d108ad4cebc9cc2c9b957bfc2475b747a60e5..7073992e6ed9064c83c3a08105473801b74ed63a 100644 (file)
@@ -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 {