From: Michael Matloob Date: Thu, 2 Jan 2020 20:39:28 +0000 (-0500) Subject: cmd/go: convert TestGoTestWithoutTests to the script framework X-Git-Tag: go1.14rc1~163 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d5967a710094b4e901175948727bbda7a197565c;p=gostls13.git cmd/go: convert TestGoTestWithoutTests to the script framework Part of converting all tests to script framework to improve test parallelism. Updates #36320 Updates #17751 Change-Id: Ibc3cb3823bd1c1b80058076f2c9933dc729447a5 Reviewed-on: https://go-review.googlesource.com/c/go/+/213127 Run-TryBot: Michael Matloob Reviewed-by: Jay Conrod --- diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index f8771ddff7..b2d92b7668 100644 --- a/src/cmd/go/go_test.go +++ b/src/cmd/go/go_test.go @@ -5271,16 +5271,6 @@ func TestCDAndGOPATHAreDifferent(t *testing.T) { } } -// Issue 26242. -func TestGoTestWithoutTests(t *testing.T) { - tg := testgo(t) - defer tg.cleanup() - tg.parallel() - tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata")) - tg.run("test", "testnorun") - tg.grepStdout(`testnorun\t\[no test files\]`, "do not want test to run") -} - // Issue 25579. func TestGoBuildDashODevNull(t *testing.T) { tooSlow(t) diff --git a/src/cmd/go/testdata/script/test_no_tests.txt b/src/cmd/go/testdata/script/test_no_tests.txt new file mode 100644 index 0000000000..d75bcff934 --- /dev/null +++ b/src/cmd/go/testdata/script/test_no_tests.txt @@ -0,0 +1,11 @@ +# Tests issue #26242 + +go test testnorun +stdout 'testnorun\t\[no test files\]' + +-- testnorun/p.go -- +package p + +func init() { + panic("go test must not link and run test binaries without tests") +} diff --git a/src/cmd/go/testdata/src/testnorun/p.go b/src/cmd/go/testdata/src/testnorun/p.go deleted file mode 100644 index 71a9a561ef..0000000000 --- a/src/cmd/go/testdata/src/testnorun/p.go +++ /dev/null @@ -1,5 +0,0 @@ -package p - -func init() { - panic("go test must not link and run test binaries without tests") -}