Commit 4ffd1a0f authored by Michael Matloob's avatar Michael Matloob

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 <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarJay Conrod <jayconrod@google.com>
parent 8cc2b73a
......@@ -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()
......
package p1
import _ "testcycle/p2"
func init() {
println("p1 init")
}
package p1
import "testing"
func Test(t *testing.T) {
}
package p2
import _ "testcycle/p3"
func init() {
println("p2 init")
}
package p3
func init() {
println("p3 init")
}
package p3
import (
"testing"
_ "testcycle/p1"
)
func Test(t *testing.T) {
}
package q1
import "testing"
import _ "testcycle/q1"
func Test(t *testing.T) {}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment