]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: add package . to 'go test' commands
authorBryan C. Mills <bcmills@google.com>
Thu, 16 Jun 2022 19:45:25 +0000 (15:45 -0400)
committerGopher Robot <gobot@golang.org>
Thu, 16 Jun 2022 21:58:40 +0000 (21:58 +0000)
This suppresses verbose output if the test passes,
eliminating some "hello from C" noise for the ../misc/cgo test.

Change-Id: I6324bfb4b3633c20e0eb0ae03aa25d40fab9fcfb
Reviewed-on: https://go-review.googlesource.com/c/go/+/412776
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/cmd/dist/test.go

index 26d7fe0f73760b8c49e8c3190df9cc82600fd439..846d0c0d85e7158b2850237f4907156082ca6924 100644 (file)
@@ -766,7 +766,7 @@ func (t *tester) registerTests() {
                                name:    "swig_stdio",
                                heading: "../misc/swig/stdio",
                                fn: func(dt *distTest) error {
-                                       t.addCmd(dt, "misc/swig/stdio", t.goTest())
+                                       t.addCmd(dt, "misc/swig/stdio", t.goTest(), ".")
                                        return nil
                                },
                        })
@@ -776,7 +776,7 @@ func (t *tester) registerTests() {
                                                name:    "swig_callback",
                                                heading: "../misc/swig/callback",
                                                fn: func(dt *distTest) error {
-                                                       t.addCmd(dt, "misc/swig/callback", t.goTest())
+                                                       t.addCmd(dt, "misc/swig/callback", t.goTest(), ".")
                                                        return nil
                                                },
                                        },
@@ -784,7 +784,7 @@ func (t *tester) registerTests() {
                                                name:    "swig_callback_lto",
                                                heading: "../misc/swig/callback",
                                                fn: func(dt *distTest) error {
-                                                       cmd := t.addCmd(dt, "misc/swig/callback", t.goTest())
+                                                       cmd := t.addCmd(dt, "misc/swig/callback", t.goTest(), ".")
                                                        setEnv(cmd, "CGO_CFLAGS", "-flto -Wno-lto-type-mismatch -Wno-unknown-warning-option")
                                                        setEnv(cmd, "CGO_CXXFLAGS", "-flto -Wno-lto-type-mismatch -Wno-unknown-warning-option")
                                                        setEnv(cmd, "CGO_LDFLAGS", "-flto -Wno-lto-type-mismatch -Wno-unknown-warning-option")
@@ -1185,11 +1185,11 @@ func (t *tester) runHostTest(dir, pkg string) error {
 }
 
 func (t *tester) cgoTest(dt *distTest) error {
-       cmd := t.addCmd(dt, "misc/cgo/test", t.goTest())
+       cmd := t.addCmd(dt, "misc/cgo/test", t.goTest(), ".")
        setEnv(cmd, "GOFLAGS", "-ldflags=-linkmode=auto")
 
        if t.internalLink() {
-               cmd := t.addCmd(dt, "misc/cgo/test", t.goTest(), "-tags=internal")
+               cmd := t.addCmd(dt, "misc/cgo/test", t.goTest(), "-tags=internal", ".")
                setEnv(cmd, "GOFLAGS", "-ldflags=-linkmode=internal")
        }
 
@@ -1201,15 +1201,15 @@ func (t *tester) cgoTest(dt *distTest) error {
                if !t.extLink() {
                        break
                }
-               cmd := t.addCmd(dt, "misc/cgo/test", t.goTest())
+               cmd := t.addCmd(dt, "misc/cgo/test", t.goTest(), ".")
                setEnv(cmd, "GOFLAGS", "-ldflags=-linkmode=external")
 
-               t.addCmd(dt, "misc/cgo/test", t.goTest(), "-ldflags", "-linkmode=external -s")
+               t.addCmd(dt, "misc/cgo/test", t.goTest(), "-ldflags", "-linkmode=external -s", ".")
 
                if t.supportedBuildmode("pie") {
-                       t.addCmd(dt, "misc/cgo/test", t.goTest(), "-buildmode=pie")
+                       t.addCmd(dt, "misc/cgo/test", t.goTest(), "-buildmode=pie", ".")
                        if t.internalLink() && t.internalLinkPIE() {
-                               t.addCmd(dt, "misc/cgo/test", t.goTest(), "-buildmode=pie", "-ldflags=-linkmode=internal", "-tags=internal,internal_pie")
+                               t.addCmd(dt, "misc/cgo/test", t.goTest(), "-buildmode=pie", "-ldflags=-linkmode=internal", "-tags=internal,internal_pie", ".")
                        }
                }
 
@@ -1221,14 +1221,14 @@ func (t *tester) cgoTest(dt *distTest) error {
                "netbsd-386", "netbsd-amd64",
                "openbsd-386", "openbsd-amd64", "openbsd-arm", "openbsd-arm64", "openbsd-mips64":
 
-               cmd := t.addCmd(dt, "misc/cgo/test", t.goTest())
+               cmd := t.addCmd(dt, "misc/cgo/test", t.goTest(), ".")
                setEnv(cmd, "GOFLAGS", "-ldflags=-linkmode=external")
                // cgo should be able to cope with both -g arguments and colored
                // diagnostics.
                setEnv(cmd, "CGO_CFLAGS", "-g0 -fdiagnostics-color")
 
-               t.addCmd(dt, "misc/cgo/testtls", t.goTest(), "-ldflags", "-linkmode=auto")
-               t.addCmd(dt, "misc/cgo/testtls", t.goTest(), "-ldflags", "-linkmode=external")
+               t.addCmd(dt, "misc/cgo/testtls", t.goTest(), "-ldflags", "-linkmode=auto", ".")
+               t.addCmd(dt, "misc/cgo/testtls", t.goTest(), "-ldflags", "-linkmode=external", ".")
 
                switch pair {
                case "aix-ppc64", "netbsd-386", "netbsd-amd64":
@@ -1247,28 +1247,28 @@ func (t *tester) cgoTest(dt *distTest) error {
                                fmt.Println("No support for static linking found (lacks libc.a?), skip cgo static linking test.")
                        } else {
                                if goos != "android" {
-                                       t.addCmd(dt, "misc/cgo/testtls", t.goTest(), "-ldflags", `-linkmode=external -extldflags "-static -pthread"`)
+                                       t.addCmd(dt, "misc/cgo/testtls", t.goTest(), "-ldflags", `-linkmode=external -extldflags "-static -pthread"`, ".")
                                }
-                               t.addCmd(dt, "misc/cgo/nocgo", t.goTest())
-                               t.addCmd(dt, "misc/cgo/nocgo", t.goTest(), "-ldflags", `-linkmode=external`)
+                               t.addCmd(dt, "misc/cgo/nocgo", t.goTest(), ".")
+                               t.addCmd(dt, "misc/cgo/nocgo", t.goTest(), "-ldflags", `-linkmode=external`, ".")
                                if goos != "android" {
-                                       t.addCmd(dt, "misc/cgo/nocgo", t.goTest(), "-ldflags", `-linkmode=external -extldflags "-static -pthread"`)
-                                       t.addCmd(dt, "misc/cgo/test", t.goTest(), "-tags=static", "-ldflags", `-linkmode=external -extldflags "-static -pthread"`)
+                                       t.addCmd(dt, "misc/cgo/nocgo", t.goTest(), "-ldflags", `-linkmode=external -extldflags "-static -pthread"`, ".")
+                                       t.addCmd(dt, "misc/cgo/test", t.goTest(), "-tags=static", "-ldflags", `-linkmode=external -extldflags "-static -pthread"`, ".")
                                        // -static in CGO_LDFLAGS triggers a different code path
                                        // than -static in -extldflags, so test both.
                                        // See issue #16651.
-                                       cmd := t.addCmd(dt, "misc/cgo/test", t.goTest(), "-tags=static")
+                                       cmd := t.addCmd(dt, "misc/cgo/test", t.goTest(), "-tags=static", ".")
                                        setEnv(cmd, "CGO_LDFLAGS", "-static -pthread")
                                }
                        }
 
                        if t.supportedBuildmode("pie") {
-                               t.addCmd(dt, "misc/cgo/test", t.goTest(), "-buildmode=pie")
+                               t.addCmd(dt, "misc/cgo/test", t.goTest(), "-buildmode=pie", ".")
                                if t.internalLink() && t.internalLinkPIE() {
-                                       t.addCmd(dt, "misc/cgo/test", t.goTest(), "-buildmode=pie", "-ldflags=-linkmode=internal", "-tags=internal,internal_pie")
+                                       t.addCmd(dt, "misc/cgo/test", t.goTest(), "-buildmode=pie", "-ldflags=-linkmode=internal", "-tags=internal,internal_pie", ".")
                                }
-                               t.addCmd(dt, "misc/cgo/testtls", t.goTest(), "-buildmode=pie")
-                               t.addCmd(dt, "misc/cgo/nocgo", t.goTest(), "-buildmode=pie")
+                               t.addCmd(dt, "misc/cgo/testtls", t.goTest(), "-buildmode=pie", ".")
+                               t.addCmd(dt, "misc/cgo/nocgo", t.goTest(), "-buildmode=pie", ".")
                        }
                }
        }