]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: remove tests using testdata/flag_test.go
authorMichael Matloob <matloob@golang.org>
Fri, 3 Jan 2020 22:03:42 +0000 (17:03 -0500)
committerMichael Matloob <matloob@golang.org>
Tue, 7 Jan 2020 16:44:14 +0000 (16:44 +0000)
Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I6573185cf14f298c51f76265f18a75e4960ce791
Reviewed-on: https://go-review.googlesource.com/c/go/+/213220
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/go_test.go
src/cmd/go/testdata/script/test_flag.txt [moved from src/cmd/go/testdata/flag_test.go with 58% similarity]
src/cmd/go/testdata/script/test_minus_n.txt [new file with mode: 0644]

index 77917b84b67fea5ef41df825eea719a0fda48d34..0d657b2ef8734f035548ae53f64ff2fb102213ec 100644 (file)
@@ -2602,14 +2602,6 @@ func TestGoTestMainTwice(t *testing.T) {
        }
 }
 
-func TestGoTestFlagsAfterPackage(t *testing.T) {
-       tooSlow(t)
-       tg := testgo(t)
-       defer tg.cleanup()
-       tg.run("test", "testdata/flag_test.go", "-v", "-args", "-v=7") // Two distinct -v flags.
-       tg.run("test", "-v", "testdata/flag_test.go", "-args", "-v=7") // Two distinct -v flags.
-}
-
 func TestGoTestXtestonlyWorks(t *testing.T) {
        tg := testgo(t)
        defer tg.cleanup()
@@ -4767,14 +4759,6 @@ func TestInstallDeps(t *testing.T) {
        tg.mustExist(p1)
 }
 
-func TestGoTestMinusN(t *testing.T) {
-       // Intent here is to verify that 'go test -n' works without crashing.
-       // This reuses flag_test.go, but really any test would do.
-       tg := testgo(t)
-       defer tg.cleanup()
-       tg.run("test", "testdata/flag_test.go", "-n", "-args", "-v=7")
-}
-
 func TestGoTestJSON(t *testing.T) {
        skipIfGccgo(t, "gccgo does not have standard packages")
        tooSlow(t)
similarity index 58%
rename from src/cmd/go/testdata/flag_test.go
rename to src/cmd/go/testdata/script/test_flag.txt
index ddf613d870126ca62b6402718b2f1e466c77e4af..bbcad1c59c6f290fbc48853bed41630613fa634f 100644 (file)
@@ -1,3 +1,9 @@
+[short] skip
+
+go test flag_test.go -v -args -v=7 # Two distinct -v flags
+go test -v flag_test.go -args -v=7 # Two distinct -v flags
+
+-- flag_test.go --
 package flag_test
 
 import (
diff --git a/src/cmd/go/testdata/script/test_minus_n.txt b/src/cmd/go/testdata/script/test_minus_n.txt
new file mode 100644 (file)
index 0000000..9900dbc
--- /dev/null
@@ -0,0 +1,14 @@
+# The intent here is to verify that 'go test -n' works without crashing.
+# Any test will do.
+
+go test -n x_test.go
+
+-- x_test.go --
+package x_test
+
+import (
+       "testing"
+)
+
+func TestEmpty(t *testing.T) {
+}