From: Michael Matloob Date: Mon, 30 Dec 2019 23:18:07 +0000 (-0500) Subject: cmd/go: remove TestGoTestDetectsTestOnlyImportCycles X-Git-Tag: go1.14rc1~189 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=4ffd1a0f1ca5f92d4185d02c3f1be00683d755e2;p=gostls13.git cmd/go: remove TestGoTestDetectsTestOnlyImportCycles 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 TryBot-Result: Gobot Gobot Reviewed-by: Jay Conrod --- diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index 2533c058fe..95c6202edd 100644 --- a/src/cmd/go/go_test.go +++ b/src/cmd/go/go_test.go @@ -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 index 65ab76d4e1..0000000000 --- a/src/cmd/go/testdata/src/testcycle/p1/p1.go +++ /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 index 75abb13e6d..0000000000 --- a/src/cmd/go/testdata/src/testcycle/p1/p1_test.go +++ /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 index 7e26cdf19c..0000000000 --- a/src/cmd/go/testdata/src/testcycle/p2/p2.go +++ /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 index bb0a2f4f65..0000000000 --- a/src/cmd/go/testdata/src/testcycle/p3/p3.go +++ /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 index 9b4b0757f8..0000000000 --- a/src/cmd/go/testdata/src/testcycle/p3/p3_test.go +++ /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 index 7a471f0cc0..0000000000 --- a/src/cmd/go/testdata/src/testcycle/q1/q1.go +++ /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 index ca81bd2bf8..0000000000 --- a/src/cmd/go/testdata/src/testcycle/q1/q1_test.go +++ /dev/null @@ -1,6 +0,0 @@ -package q1 - -import "testing" -import _ "testcycle/q1" - -func Test(t *testing.T) {}