]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: convert TestGoBuildDashODevNull to script framework
authorMichael Matloob <matloob@golang.org>
Wed, 8 Jan 2020 19:36:20 +0000 (14:36 -0500)
committerMichael Matloob <matloob@golang.org>
Wed, 19 Feb 2020 20:50:11 +0000 (20:50 +0000)
Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I85e0d168d4e9862a718872427f56213ddc21fa32
Reviewed-on: https://go-review.googlesource.com/c/go/+/213825
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/go_test.go
src/cmd/go/testdata/script/build_dash_o_dev_null.txt [new file with mode: 0644]
src/cmd/go/testdata/src/hello/hello.go [deleted file]

index a6b8a07b4db070031c2e71d6ee4d6ec88fb3c4d9..fa7a6af46434c7c8240fe33791c9d45a778b497b 100644 (file)
@@ -4542,18 +4542,6 @@ func TestCDAndGOPATHAreDifferent(t *testing.T) {
        }
 }
 
-// Issue 25579.
-func TestGoBuildDashODevNull(t *testing.T) {
-       tooSlow(t)
-       tg := testgo(t)
-       defer tg.cleanup()
-       tg.parallel()
-       tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata"))
-       tg.run("build", "-o", os.DevNull, filepath.Join(tg.pwd(), "testdata", "src", "hello", "hello.go"))
-       tg.mustNotExist("hello")
-       tg.mustNotExist("hello.exe")
-}
-
 // Issue 25093.
 func TestCoverpkgTestOnly(t *testing.T) {
        skipIfGccgo(t, "gccgo has no cover tool")
diff --git a/src/cmd/go/testdata/script/build_dash_o_dev_null.txt b/src/cmd/go/testdata/script/build_dash_o_dev_null.txt
new file mode 100644 (file)
index 0000000..e415fc2
--- /dev/null
@@ -0,0 +1,13 @@
+# Issue #25579
+
+[short] skip
+
+go build -o $devnull hello.go
+! exists 'hello'$GOEXE
+
+-- hello.go --
+package main
+
+func main() {
+       println("hello, world")
+}
diff --git a/src/cmd/go/testdata/src/hello/hello.go b/src/cmd/go/testdata/src/hello/hello.go
deleted file mode 100644 (file)
index 73d83e6..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-package main
-
-func main() {
-       println("hello, world")
-}