]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: convert TestDotDotDotOutsideGOPATH to script framework
authorMichael Matloob <matloob@golang.org>
Fri, 10 Jan 2020 22:58:20 +0000 (17:58 -0500)
committerMichael Matloob <matloob@golang.org>
Wed, 19 Feb 2020 21:53:11 +0000 (21:53 +0000)
Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

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

index 918fd6fceca74b20d0e9261bc859f2913539a11a..2f50d7d83dc9e8f7cedce031c4ea605afcfbf8d4 100644 (file)
@@ -2404,29 +2404,6 @@ GLOBL ·constants<>(SB),8,$8
        tg.run("build", "p")
 }
 
-// Issue 18778.
-func TestDotDotDotOutsideGOPATH(t *testing.T) {
-       tg := testgo(t)
-       defer tg.cleanup()
-
-       tg.tempFile("pkgs/a.go", `package x`)
-       tg.tempFile("pkgs/a_test.go", `package x_test
-import "testing"
-func TestX(t *testing.T) {}`)
-
-       tg.tempFile("pkgs/a/a.go", `package a`)
-       tg.tempFile("pkgs/a/a_test.go", `package a_test
-import "testing"
-func TestA(t *testing.T) {}`)
-
-       tg.cd(tg.path("pkgs"))
-       tg.run("build", "./...")
-       tg.run("test", "./...")
-       tg.run("list", "./...")
-       tg.grepStdout("pkgs$", "expected package not listed")
-       tg.grepStdout("pkgs/a", "expected package not listed")
-}
-
 // Issue 18975.
 func TestFFLAGS(t *testing.T) {
        if !canCgo {
diff --git a/src/cmd/go/testdata/script/build_patterns_outside_gopath.txt b/src/cmd/go/testdata/script/build_patterns_outside_gopath.txt
new file mode 100644 (file)
index 0000000..f36e90f
--- /dev/null
@@ -0,0 +1,29 @@
+# Tests issue #18778
+
+cd pkgs
+go build ./...
+! stdout .
+go test ./...
+stdout '^ok'
+go list ./...
+stdout 'pkgs$'
+stdout 'pkgs/a'
+
+-- pkgs/a.go --
+package x
+-- pkgs/a_test.go --
+package x_test
+
+import "testing"
+
+func TestX(t *testing.T) {
+}
+-- pkgs/a/a.go --
+package a
+-- pkgs/a/a_test.go --
+package a_test
+
+import "testing"
+
+func TestA(t *testing.T) {
+}
\ No newline at end of file