]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: convert TestPackageNotStaleWithTrailingSlash to script framework
authorMichael Matloob <matloob@golang.org>
Fri, 10 Jan 2020 23:15:38 +0000 (18:15 -0500)
committerMichael Matloob <matloob@golang.org>
Thu, 27 Feb 2020 21:24:40 +0000 (21:24 +0000)
Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I1020feaa4ddb40ff52c46728bc4973cea4c7b066
Reviewed-on: https://go-review.googlesource.com/c/go/+/214391
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/go_test.go
src/cmd/go/testdata/script/build_package_not_stale_trailing_slash.txt [new file with mode: 0644]

index edb4a6d71510777e463b84a34d7a53a8d724fbe6..a8ef36e6bbe2a5f5d31a1a06bdfec061cd8349b0 100644 (file)
@@ -1151,25 +1151,6 @@ func TestPackageMainTestCompilerFlags(t *testing.T) {
        tg.grepStderr(`([\\/]compile|gccgo).* (-p p1|-fgo-pkgpath=p1).*p1\.go`, "should have run compile -p p1 p1.go")
 }
 
-// Issue 12690
-func TestPackageNotStaleWithTrailingSlash(t *testing.T) {
-       skipIfGccgo(t, "gccgo does not have GOROOT")
-       tg := testgo(t)
-       defer tg.cleanup()
-
-       // Make sure the packages below are not stale.
-       tg.wantNotStale("runtime", "", "must be non-stale before test runs")
-       tg.wantNotStale("os", "", "must be non-stale before test runs")
-       tg.wantNotStale("io", "", "must be non-stale before test runs")
-
-       goroot := runtime.GOROOT()
-       tg.setenv("GOROOT", goroot+"/")
-
-       tg.wantNotStale("runtime", "", "with trailing slash in GOROOT, runtime listed as stale")
-       tg.wantNotStale("os", "", "with trailing slash in GOROOT, os listed as stale")
-       tg.wantNotStale("io", "", "with trailing slash in GOROOT, io listed as stale")
-}
-
 // Issue 4104.
 func TestGoTestWithPackageListedMultipleTimes(t *testing.T) {
        tooSlow(t)
diff --git a/src/cmd/go/testdata/script/build_package_not_stale_trailing_slash.txt b/src/cmd/go/testdata/script/build_package_not_stale_trailing_slash.txt
new file mode 100644 (file)
index 0000000..38a151e
--- /dev/null
@@ -0,0 +1,13 @@
+# Tests Issue #12690
+
+[gccgo] skip 'gccgo does not have GOROOT'
+
+! stale runtime
+! stale os
+! stale io
+
+env GOROOT=$GOROOT'/'
+
+! stale runtime
+! stale os
+! stale io
\ No newline at end of file