mirror of https://github.com/golang/go.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 <matloob@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
This commit is contained in:
parent
8cc2b73a74
commit
4ffd1a0f1c
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
package p1
|
||||
|
||||
import _ "testcycle/p2"
|
||||
|
||||
func init() {
|
||||
println("p1 init")
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
package p1
|
||||
|
||||
import "testing"
|
||||
|
||||
func Test(t *testing.T) {
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
package p2
|
||||
|
||||
import _ "testcycle/p3"
|
||||
|
||||
func init() {
|
||||
println("p2 init")
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
package p3
|
||||
|
||||
func init() {
|
||||
println("p3 init")
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
package p3
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
_ "testcycle/p1"
|
||||
)
|
||||
|
||||
func Test(t *testing.T) {
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
package q1
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
package q1
|
||||
|
||||
import "testing"
|
||||
import _ "testcycle/q1"
|
||||
|
||||
func Test(t *testing.T) {}
|
||||
Loading…
Reference in New Issue