]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: convert TestGoTestWithoutTests to the script framework
authorMichael Matloob <matloob@golang.org>
Thu, 2 Jan 2020 20:39:28 +0000 (15:39 -0500)
committerMichael Matloob <matloob@golang.org>
Mon, 6 Jan 2020 17:43:15 +0000 (17:43 +0000)
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 <matloob@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/go_test.go
src/cmd/go/testdata/script/test_no_tests.txt [new file with mode: 0644]
src/cmd/go/testdata/src/testnorun/p.go [deleted file]

index f8771ddff77e47a7842a6700cb1bc71bc58881d7..b2d92b76686f33d73797a77ddc92e11400019514 100644 (file)
@@ -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 (file)
index 0000000..d75bcff
--- /dev/null
@@ -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 (file)
index 71a9a56..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-package p
-
-func init() {
-       panic("go test must not link and run test binaries without tests")
-}