]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: remove TestGoTestDetectsTestOnlyImportCycles
authorMichael Matloob <matloob@golang.org>
Mon, 30 Dec 2019 23:18:07 +0000 (18:18 -0500)
committerMichael Matloob <matloob@golang.org>
Fri, 3 Jan 2020 19:04:06 +0000 (19:04 +0000)
The error that's tested in this test is also tested in list_test_err.txt
which uses go list -test -deps. Because both commands are just loading
packages, the difference is not meaningful.

Updates #36320
Updates #17751

Change-Id: Ie712a77d64e8985dd908a1afb515ed3ecc0a9985
Reviewed-on: https://go-review.googlesource.com/c/go/+/212937
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/go_test.go
src/cmd/go/testdata/src/testcycle/p1/p1.go [deleted file]
src/cmd/go/testdata/src/testcycle/p1/p1_test.go [deleted file]
src/cmd/go/testdata/src/testcycle/p2/p2.go [deleted file]
src/cmd/go/testdata/src/testcycle/p3/p3.go [deleted file]
src/cmd/go/testdata/src/testcycle/p3/p3_test.go [deleted file]
src/cmd/go/testdata/src/testcycle/q1/q1.go [deleted file]
src/cmd/go/testdata/src/testcycle/q1/q1_test.go [deleted file]

index 2533c058fe6c217b4358e66d25bf084fa1eed3b4..95c6202edd4e1679ae3b6d829b5b088951c788bd 100644 (file)
@@ -2653,17 +2653,6 @@ func TestGoBuildTestOnly(t *testing.T) {
        tg.run("install", "./testonly...")
 }
 
-func TestGoTestDetectsTestOnlyImportCycles(t *testing.T) {
-       tg := testgo(t)
-       defer tg.cleanup()
-       tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata"))
-       tg.runFail("test", "-c", "testcycle/p3")
-       tg.grepStderr("import cycle not allowed in test", "go test testcycle/p3 produced unexpected error")
-
-       tg.runFail("test", "-c", "testcycle/q1")
-       tg.grepStderr("import cycle not allowed in test", "go test testcycle/q1 produced unexpected error")
-}
-
 func TestGoTestFooTestWorks(t *testing.T) {
        tg := testgo(t)
        defer tg.cleanup()
diff --git a/src/cmd/go/testdata/src/testcycle/p1/p1.go b/src/cmd/go/testdata/src/testcycle/p1/p1.go
deleted file mode 100644 (file)
index 65ab76d..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-package p1
-
-import _ "testcycle/p2"
-
-func init() {
-       println("p1 init")
-}
diff --git a/src/cmd/go/testdata/src/testcycle/p1/p1_test.go b/src/cmd/go/testdata/src/testcycle/p1/p1_test.go
deleted file mode 100644 (file)
index 75abb13..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-package p1
-
-import "testing"
-
-func Test(t *testing.T) {
-}
diff --git a/src/cmd/go/testdata/src/testcycle/p2/p2.go b/src/cmd/go/testdata/src/testcycle/p2/p2.go
deleted file mode 100644 (file)
index 7e26cdf..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-package p2
-
-import _ "testcycle/p3"
-
-func init() {
-       println("p2 init")
-}
diff --git a/src/cmd/go/testdata/src/testcycle/p3/p3.go b/src/cmd/go/testdata/src/testcycle/p3/p3.go
deleted file mode 100644 (file)
index bb0a2f4..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-package p3
-
-func init() {
-       println("p3 init")
-}
diff --git a/src/cmd/go/testdata/src/testcycle/p3/p3_test.go b/src/cmd/go/testdata/src/testcycle/p3/p3_test.go
deleted file mode 100644 (file)
index 9b4b075..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-package p3
-
-import (
-       "testing"
-
-       _ "testcycle/p1"
-)
-
-func Test(t *testing.T) {
-}
diff --git a/src/cmd/go/testdata/src/testcycle/q1/q1.go b/src/cmd/go/testdata/src/testcycle/q1/q1.go
deleted file mode 100644 (file)
index 7a471f0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-package q1
diff --git a/src/cmd/go/testdata/src/testcycle/q1/q1_test.go b/src/cmd/go/testdata/src/testcycle/q1/q1_test.go
deleted file mode 100644 (file)
index ca81bd2..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-package q1
-
-import "testing"
-import _ "testcycle/q1"
-
-func Test(t *testing.T) {}