]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: cut 'go test -short cmd/go' time by about half
authorRuss Cox <rsc@golang.org>
Wed, 15 May 2019 16:56:45 +0000 (12:56 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 16 May 2019 03:25:01 +0000 (03:25 +0000)
Was 50 seconds on unloaded Mac laptop; now 27.
Still longer than I would like, but every little bit helps.

For #26473.

Change-Id: Id4be016ee1555cbc3512eca0ae10236d7f06bd02
Reviewed-on: https://go-review.googlesource.com/c/go/+/177398
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
54 files changed:
src/cmd/go/go_test.go
src/cmd/go/testdata/script/build_GOTMPDIR.txt
src/cmd/go/testdata/script/build_cache_compile.txt
src/cmd/go/testdata/script/build_cache_gomips.txt
src/cmd/go/testdata/script/build_cache_link.txt
src/cmd/go/testdata/script/build_cache_output.txt
src/cmd/go/testdata/script/build_runtime_gcflags.txt
src/cmd/go/testdata/script/build_trimpath.txt
src/cmd/go/testdata/script/cgo_syso_issue29253.txt
src/cmd/go/testdata/script/clean_testcache.txt
src/cmd/go/testdata/script/gcflags_patterns.txt
src/cmd/go/testdata/script/get_dotfiles.txt
src/cmd/go/testdata/script/get_tilde.txt
src/cmd/go/testdata/script/get_unicode.txt
src/cmd/go/testdata/script/install_cleans_build.txt
src/cmd/go/testdata/script/install_cross_gobin.txt
src/cmd/go/testdata/script/list_bad_import.txt
src/cmd/go/testdata/script/list_find.txt
src/cmd/go/testdata/script/list_std.txt
src/cmd/go/testdata/script/mod_build_versioned.txt
src/cmd/go/testdata/script/mod_doc.txt
src/cmd/go/testdata/script/mod_download.txt
src/cmd/go/testdata/script/mod_file_proxy.txt
src/cmd/go/testdata/script/mod_get_commit.txt
src/cmd/go/testdata/script/mod_get_downgrade.txt
src/cmd/go/testdata/script/mod_get_indirect.txt
src/cmd/go/testdata/script/mod_get_local.txt
src/cmd/go/testdata/script/mod_get_main.txt
src/cmd/go/testdata/script/mod_get_moved.txt
src/cmd/go/testdata/script/mod_get_patterns.txt
src/cmd/go/testdata/script/mod_get_upgrade.txt
src/cmd/go/testdata/script/mod_gobuild_import.txt
src/cmd/go/testdata/script/mod_internal.txt
src/cmd/go/testdata/script/mod_list.txt
src/cmd/go/testdata/script/mod_list_dir.txt
src/cmd/go/testdata/script/mod_list_std.txt
src/cmd/go/testdata/script/mod_outside.txt
src/cmd/go/testdata/script/mod_patterns.txt
src/cmd/go/testdata/script/mod_readonly.txt
src/cmd/go/testdata/script/mod_replace.txt
src/cmd/go/testdata/script/mod_test.txt
src/cmd/go/testdata/script/mod_tidy_replace.txt
src/cmd/go/testdata/script/mod_tidy_sum.txt
src/cmd/go/testdata/script/mod_upgrade_patch_mod.txt
src/cmd/go/testdata/script/mod_upgrade_patch_pkg.txt
src/cmd/go/testdata/script/mod_vendor_build.txt
src/cmd/go/testdata/script/mod_verify.txt
src/cmd/go/testdata/script/mod_why.txt
src/cmd/go/testdata/script/run_set_executable_name.txt
src/cmd/go/testdata/script/sum_readonly.txt
src/cmd/go/testdata/script/test_init.txt
src/cmd/go/testdata/script/test_timeout.txt
src/cmd/go/testdata/script/version.txt
src/cmd/go/testdata/script/vet_asm.txt

index 49b0e6d255e748c6dc88e2b4d31dcb09b7e4daed..3fc147e1469a3db2d39ac0845c11ff29ffc9e295 100644 (file)
@@ -1898,6 +1898,7 @@ func TestGoListTest(t *testing.T) {
 }
 
 func TestGoListCompiledCgo(t *testing.T) {
+       tooSlow(t)
        tg := testgo(t)
        defer tg.cleanup()
        tg.parallel()
@@ -2537,6 +2538,7 @@ func TestCoverageRuns(t *testing.T) {
 
 func TestCoverageDotImport(t *testing.T) {
        skipIfGccgo(t, "gccgo has no cover tool")
+       tooSlow(t)
        tg := testgo(t)
        defer tg.cleanup()
        tg.parallel()
@@ -2716,6 +2718,7 @@ func TestCoverageFunc(t *testing.T) {
 // Issue 24588.
 func TestCoverageDashC(t *testing.T) {
        skipIfGccgo(t, "gccgo has no cover tool")
+       tooSlow(t)
        tg := testgo(t)
        defer tg.cleanup()
        tg.parallel()
@@ -3391,6 +3394,7 @@ func TestVetWithOnlyCgoFiles(t *testing.T) {
        if !canCgo {
                t.Skip("skipping because cgo not enabled")
        }
+       tooSlow(t)
 
        tg := testgo(t)
        defer tg.cleanup()
@@ -5654,6 +5658,7 @@ func TestTestSkipVetAfterFailedBuild(t *testing.T) {
 }
 
 func TestTestVetRebuild(t *testing.T) {
+       tooSlow(t)
        tg := testgo(t)
        defer tg.cleanup()
        tg.parallel()
@@ -5933,6 +5938,7 @@ func TestBadCgoDirectives(t *testing.T) {
        if !canCgo {
                t.Skip("no cgo")
        }
+       tooSlow(t)
        tg := testgo(t)
        defer tg.cleanup()
 
@@ -6047,6 +6053,7 @@ func TestTwoPkgConfigs(t *testing.T) {
        if runtime.GOOS == "windows" || runtime.GOOS == "plan9" {
                t.Skipf("no shell scripts on %s", runtime.GOOS)
        }
+       tooSlow(t)
        tg := testgo(t)
        defer tg.cleanup()
        tg.parallel()
@@ -6077,6 +6084,8 @@ func TestCgoCache(t *testing.T) {
        if !canCgo {
                t.Skip("no cgo")
        }
+       tooSlow(t)
+
        tg := testgo(t)
        defer tg.cleanup()
        tg.parallel()
@@ -6127,6 +6136,7 @@ func TestLinkerTmpDirIsDeleted(t *testing.T) {
        if !canCgo {
                t.Skip("skipping because cgo not enabled")
        }
+       tooSlow(t)
 
        tg := testgo(t)
        defer tg.cleanup()
@@ -6216,6 +6226,7 @@ func TestGoTestWithoutTests(t *testing.T) {
 
 // Issue 25579.
 func TestGoBuildDashODevNull(t *testing.T) {
+       tooSlow(t)
        tg := testgo(t)
        defer tg.cleanup()
        tg.parallel()
@@ -6228,6 +6239,7 @@ func TestGoBuildDashODevNull(t *testing.T) {
 // Issue 25093.
 func TestCoverpkgTestOnly(t *testing.T) {
        skipIfGccgo(t, "gccgo has no cover tool")
+       tooSlow(t)
        tg := testgo(t)
        defer tg.cleanup()
        tg.parallel()
index da54ced524214f7321fce7a2c52836a5533256dc..c93ca932cab5064aac1626df7f80d6fd4f1991f8 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=off
+[short] skip
 
 # Set GOCACHE to a clean directory to ensure that 'go build' has work to report.
 env GOCACHE=$WORK/gocache
index 04a6f9af1d0ee21b40fb8c2135941b65aa0d9f54..64b391f9aa4651dcac1826be4a74f95f7bc9d2f7 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=off
+[short] skip
 
 # Set up fresh GOCACHE.
 env GOCACHE=$WORK/gocache
index 3218354929f48c926ce863fc01ae71dd087571a9..0cbf16a923b8b2c129a9a7149afc761755e1f207 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=off
+[short] skip # rebuilds std for mips
 
 # Set up fresh GOCACHE.
 env GOCACHE=$WORK/gocache
index 658bb8849675c49a1c9a4b468b62c855246c1a6b..e80d776473c7ff98aeba328e6860ca0af87dab0a 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=off
+[short] skip
 
 # Set up fresh GOCACHE.
 env GOCACHE=$WORK/gocache
index 41c84ace7ad4885d9cb682ebaec7bd9c1cfe6897..89e3ff0f1ec377116f1b1010783587a9240d1fbe 100644 (file)
@@ -1,6 +1,7 @@
 env GO111MODULE=off
 
 [!gc] skip
+[short] skip # clears cache, rebuilds too much
 
 # Set up fresh GOCACHE.
 env GOCACHE=$WORK/gocache
index 5354a7393532c3e67f2e2b8df757c7b243bffd88..da1b65f06c849788fbf7b7b73a50ee0f40979892 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=off
+[short] skip # rebuilds all of std
 
 # Set up fresh GOCACHE.
 env GOCACHE=$WORK/gocache
index 0dc20a999979598d487df60a8944bdd67a25fdf2..f785b0cb9ec9d112937db49dff6d540694ff333e 100644 (file)
@@ -1,3 +1,5 @@
+[short] skip
+
 env -r GOROOT_REGEXP=$GOROOT
 env -r WORK_REGEXP=$WORK
 env GOROOT GOROOT_REGEXP WORK WORK_REGEXP
index 9825d1e3e987262daf589936306822726e8aedb4..4fb5ccab04e1813617bd8c6b0c5980f3a96c2843 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=off
+[short] skip
 
 # This test tests that we can link in-package syso files that provides symbols
 # for cgo. See issue 29253.
index 5ac968b7d0a6fca4b8c45059e548b8e55623a3eb..dd7846462e153a98b9c9d0f2c120ec40a0cbfc3a 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=off
+[short] skip
 
 # go clean -testcache
 # should work (see golang.org/issue/29757).
index c790ddda0aa5bd5f7480c4d1b8b2f5e069ffa127..dce8e39715d81e2fbfad6ee782ec673fda5594e1 100644 (file)
@@ -1,6 +1,7 @@
 env GO111MODULE=off
 
 [!gc] skip 'using -gcflags and -ldflags'
+[short] skip
 
 # -gcflags=-e applies to named packages, not dependencies
 go build -n -v -gcflags=-e z1 z2
index 38a3fac612235c67c56d268301acb4505f900e45..6757f9dce344f502cc532563ee2b0c954fd653f6 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=off
+[short] skip
 
 [!exec:git] skip
 
index 6d18174acc3154dac6e8265e8a1f0473cb0ad6bd..e520957359ca124caf8c5f6327a9e2133ed6c5ad 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=off
+[short] skip
 
 # Paths containing windows short names should be rejected before attempting to fetch.
 ! go get example.com/longna~1.dir/thing
index ab1b914f50659a8157bf0131265b522bc502b8d7..d3b82bdf250dd0b39f8e14d5dcd46a680a7ea016 100644 (file)
@@ -1,6 +1,7 @@
 env GO111MODULE=off
 
 [!exec:git] skip
+[short] skip
 
 # Construct a repository that imports a non-ASCII path.
 cd $WORK/_origin/example.com/unicode
index 7f1b9174397b18a515088ca6c3560ac6b6303bd3..a169a60bda1ffcde511f13035aa7f88dcefd4c19 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=off
+[short] skip
 
 # 'go install' with no arguments should clean up after go build
 cd mycmd
index d9ab35c2e16c8253790dea9e6cf6298ccb356321..57c18be602b63604d435bb1afa56c28166d1ccb4 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=off
+[!short] skip # rebuilds std for alternate architecture
 
 cd mycmd
 go build mycmd
index 958c576c53c54bbbe25a20f7d87f735b43897f34..b8f9d586f303566ad1c84ca0c680e8deb69c7175 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=off
+[short] skip
 
 # This test matches mod_list_bad_import, but in GOPATH mode.
 # Please keep them in sync.
index aaac6585dd55f96ed1d0ee6202cacf1b7f3c56ac..d450fc95549fa999cf6b21fece61ecc97f3a83ee 100644 (file)
@@ -12,6 +12,7 @@ stdout '^false \[\]'
 # should be identical. "go build" derives action IDs (which are used as cache
 # keys) from dependencies' action IDs. "go list -find" won't know what the
 # dependencies are, so it's can't construct the same action IDs.
+[short] skip
 go list -find -compiled net
 go list -find -compiled -x net
 ! stderr 'cgo'
index deddaa61ea138540b6a166a95a6874debe449a73..6ab1bd1674c99433106d200602c0cb5a897b5722 100644 (file)
@@ -1,12 +1,12 @@
 env GO111MODULE=off
 
 [!gc] skip
+[short] skip
 
 # Listing GOROOT should only find standard packages.
 cd $GOROOT/src
 go list -f '{{if not .Standard}}{{.ImportPath}}{{end}}' ./...
 ! stdout .
-# TODO: ignore _/blah/go/src in output
 
 # Standard packages should include cmd, but not cmd/vendor.
 go list ./...
index eb081c9be1f0fb7b0932895fb491a470924c7c40..1b387361a7613354e251f748b4f5dbe56155ef22 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=on
+[short] skip
 
 go get -m rsc.io/fortune/v2
 
index 223283d5f21396fe84fb5650de58ecc1d51abe1d..40acbc5ac083b48b0e60825bc1e0eb4718c7f48e 100644 (file)
@@ -1,6 +1,7 @@
 # go doc should find module documentation
 
 env GO111MODULE=on
+[short] skip
 
 go doc y
 stdout 'Package y is.*alphabet'
index 62b9eee54789474926cdfb94e4142cf3610ea517..c6729c71a299db0af28439283f04bc724b9ceb6a 100644 (file)
@@ -10,6 +10,7 @@ exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.0.mod
 exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.0.zip
 
 # download of an invalid path should report the error
+[short] skip
 ! go mod download this.domain.is.invalid/somemodule@v1.0.0
 stderr 'this.domain.is.invalid'
 ! go mod download -json this.domain.is.invalid/somemodule@v1.0.0
index 570ffc761a2e4a74f3cd877f5b7a203b7b8d947d..2769d4db07e068fa031c2337f3685434280c122a 100644 (file)
@@ -1,3 +1,5 @@
+[short] skip
+
 # Allow (cached) downloads for -mod=readonly.
 env GO111MODULE=on
 env GOPATH=$WORK/gopath1
index cc84490317c3ff7776039dc475b02b7588df2265..f88eb692fd7d606fea33c4bcc0bbdc3ddaf0c97d 100644 (file)
@@ -1,11 +1,12 @@
 env GO111MODULE=on
 env GOPROXY=$GOPROXY/quiet
+[short] skip
 
 # @commit should resolve
 
 # golang.org/x/text/language@commit should not resolve with -m,
 # because that's not a module path.
-! go get -m golang.org/x/text/language@14c0d48
+! go get -d -m golang.org/x/text/language@14c0d48
 
 # ... but it should work without -m.
 # because of -d, the compiler should not run
@@ -13,12 +14,13 @@ go get -d -x golang.org/x/text/language@14c0d48
 ! stderr 'compile|cp|gccgo .*language\.a$'
 
 # go get should skip build with no Go files in root
-go get golang.org/x/text@14c0d48
+go get -d golang.org/x/text@14c0d48
 
 # ... and go get should skip build with -m
 go get -m golang.org/x/text@14c0d48
 
 # dropping -d, we should see a build.
+[short] skip
 go get -x golang.org/x/text/language@14c0d48
 stderr 'compile|cp|gccgo .*language\.a$'
 
index ac814dae08fcabe4e1e7d008c8d2964da0aa9ac0..00cd93e59884e9b40230800a806917c1163a85c7 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=on
+[short] skip
 
 # downgrade sampler should downgrade quote
 go get rsc.io/sampler@v1.0.0
index 2ba99244f9e598f8ec72c15c49618ede9968b8c5..f25e170a499e97327dc31612bbf5cb6e0f294ac1 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=on
+[short] skip
 
 # get -u should not upgrade anything, since the package
 # in the current directory doesn't import anything.
index 2f78d44d2f4ace7b7b294d05fab756740da63f84..44a470ecfc1ba45c1362e5d7ed3d317942d28629 100644 (file)
@@ -1,4 +1,5 @@
 # Test 'go get' with a local module with a name that is not valid for network lookup.
+[short] skip
 
 env GO111MODULE=on
 go mod edit -fmt
index 06f9f238777eaead008bb410304e14241eaa91fd..14dcffeaad709a1a7d4ef06c419b720d418f76b6 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=on
+[short] skip
 
 # @patch and @latest within the main module refer to the current version.
 # The main module won't be upgraded, but missing dependencies will be added.
index 1cd0696d9764b22ab472797eda89c896f9a19f2c..edc41cf9488a26f4d53f86c13d79a4e1d4b43fd2 100644 (file)
@@ -1,5 +1,6 @@
 env GO111MODULE=on
 env GOPROXY=$GOPROXY/quiet
+[short] skip
 
 # A 'go get' that worked at a previous version should continue to work at that version,
 # even if the package was subsequently moved into a submodule.
index 733d4452d7af00800265fd3fc7f1d09791c65519..9521c4f84a5c1ad6c1e9d29d16f671bc995c359e 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=on
+[short] skip
 
 # If a pattern doesn't match any modules in the build list,
 # and -m is used, an error should be reported.
index d591b1146ba3951da538ba167ad1046704acb3d7..f6ba53381b91a42e0df8ca8934a5991694003ccf 100644 (file)
@@ -6,30 +6,30 @@ stdout 'rsc.io/quote v1.5.1'
 grep 'rsc.io/quote v1.5.1$' go.mod
 
 # get -m -u should update all dependencies
-go get -m -u
+go get -d -m -u
 grep 'rsc.io/quote v1.5.2$' go.mod
 grep 'golang.org/x/text [v0-9a-f\.-]+ // indirect' go.mod
 
 # get -u rsc.io/sampler should update only sampler's dependencies
 cp go.mod-v1.5.1 go.mod
-go get -u rsc.io/sampler
+go get -d -u rsc.io/sampler
 grep 'rsc.io/quote v1.5.1$' go.mod
 grep 'golang.org/x/text [v0-9a-f\.-]+ // indirect' go.mod
 
 # move to a pseudo-version after any tags
-go get -m rsc.io/quote@dd9747d
+go get -d -m rsc.io/quote@dd9747d
 grep 'rsc.io/quote v0.0.0-20180628003336-dd9747d19b04' go.mod
 
 # get -u should not jump off newer pseudo-version to earlier tag
-go get -m -u
+go get -d -m -u
 grep 'rsc.io/quote v0.0.0-20180628003336-dd9747d19b04' go.mod
 
 # move to earlier pseudo-version
-go get -m rsc.io/quote@e7a685a342
+go get -d -m rsc.io/quote@e7a685a342
 grep 'rsc.io/quote v0.0.0-20180214005133-e7a685a342c0' go.mod
 
 # get -u should jump off earlier pseudo-version to newer tag
-go get -m -u
+go get -d -m -u
 grep 'rsc.io/quote v1.5.2' go.mod
 
 -- go.mod --
index 25764b797e6f650f34cf24aa4277dbbe03ae70f6..eb2284e561a353c414109faf3bc0420cfa429a6c 100644 (file)
@@ -1,3 +1,5 @@
+[short] skip
+
 # go/build's Import should find modules by invoking the go command
 
 go build -o $WORK/testimport.exe ./testimport
index 5a47c3fa44ae6c78e9840b1bd61c76722af37c3d..5a361a4f42471f7c22fe7145588161a67c4f03c7 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=on
+[short] skip
 
 # golang.org/x/internal should be importable from other golang.org/x modules.
 rm go.mod
index c9797ea8364e42243c059cb47f46cfbfc8a4f0ac..a15f5bca63540cc40cff161431e6df844f3a7cea 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=on
+[short] skip
 
 # list {{.Dir}} shows main module and go.mod but not not-yet-downloaded dependency dir.
 go list -m -f '{{.Path}} {{.Main}} {{.GoMod}} {{.Dir}}' all
index 903651c9d58fd5b4dfb870826cb71753f2c47082..c4db045631155b106f4cd2573aeaf5c602699c14 100644 (file)
@@ -1,3 +1,5 @@
+[short] skip
+
 # go list with path to directory should work
 
 env GO111MODULE=off
index f5136a5de077c1653a45d2562f466ddfe1410b0c..8552aebf42cd4d3d0bc7d8d89f8a40d823dd65a0 100644 (file)
@@ -2,6 +2,7 @@ env GO111MODULE=on
 env GOPROXY=off
 
 [!gc] skip
+[short] skip
 
 # Outside of GOROOT, our vendored packages should be reported as part of the standard library.
 go list -f '{{if .Standard}}{{.ImportPath}}{{end}}' std cmd
index db994a1656703a8bf711ad0824d362dd6f33ad73..c3d53e035b2eca4db7197472964419db24c9c152 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=on
+[short] skip
 
 # This script tests commands in module mode outside of any module.
 #
index ab936a9ba455a0ae174ec587a48021253f931f65..1b4b4380b44af68ab7034bb427dbb2f7ee734680 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=on
+[short] skip
 
 cd m
 
@@ -29,10 +30,6 @@ stdout 'cmd/pprof: \[\.\.\.\]'
 
 stderr -count=1 '^go: warning: "./xyz..." matched no packages$'
 
-env CGO_ENABLED=0
-go list -f '{{.ImportPath}}: {{.Match}}' all ... example.com/m/... ./... ./xyz...
-! stdout example.com/m/useC
-
 # 'go list ./...' should not try to resolve the main module.
 cd ../empty
 go list -deps ./...
@@ -40,6 +37,12 @@ go list -deps ./...
 ! stderr 'finding'
 stderr -count=1 '^go: warning: "./..." matched no packages'
 
+# disabling cgo should drop useC
+[short] skip
+env CGO_ENABLED=0
+go list -f '{{.ImportPath}}: {{.Match}}' all ... example.com/m/... ./... ./xyz...
+! stdout example.com/m/useC
+
 -- m/go.mod --
 module example.com/m
 
index 188a66d0e15fa8826c526744332771a72e846327..ff25f4bfe2f46013ba55771d94960107386a06ea 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=on
+[short] skip
 
 # -mod=readonly must not resolve missing modules nor update go.mod
 #
index 78d6729fce322adb56306d30af1b6dd343caf430..35824b3a8a212f37c8b50a69e38153bd193ba49b 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=on
+[short] skip
 
 cp go.mod go.mod.orig
 
index af4fd76d706cff5a75c7da1fd6227621ee849f91..8f2da2f2a5b59593dcfb7c555b8baf1cd054c008 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=on
+[short] skip
 
 # TODO(bcmills): Convert the 'go test' calls below to 'go list -test' once 'go
 # list' is more sensitive to package loading errors.
@@ -6,8 +7,8 @@ env GO111MODULE=on
 # A test in the module's root package should work.
 cd a/
 cp go.mod.empty go.mod
-go test
-stdout PASS
+go list -test
+! stderr error
 
 cp go.mod.empty go.mod
 go list -deps
@@ -33,27 +34,27 @@ go list -test all
 stdout '^testing'
 
 cp go.mod.empty go.mod
-go test
-stdout PASS
+go list -test
+! stderr error
 
 # A test with the "_test" suffix in the module root should also work.
 cd ../b/
-go test
-stdout PASS
+go list -test
+! stderr error
 
 # A test with the "_test" suffix of a *package* with a "_test" suffix should
 # even work (not that you should ever do that).
 cd ../c_test
-go test
-stdout PASS
+go list -test
+! stderr error
 
 cd ../d_test
-go test
-stdout PASS
+go list -test
+! stderr error
 
 cd ../e
-go test
-stdout PASS
+go list -test
+! stderr error
 
 -- a/go.mod.empty --
 module example.com/user/a
index 86467a65451d328523d931468d87acc743616964..d5c22530944df3fd90337c4914b3d131eb3acd63 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=on
+[short] skip
 
 # golang.org/issue/30166: 'go mod tidy' should not crash if a replaced module is
 # involved in a cycle.
index 5a15818543ef2c4318d4f059624001ebc7d273df..c583f560586970c6741fc3d975da15ddb5384b9d 100644 (file)
@@ -1,12 +1,12 @@
 env GO111MODULE=on
 
 # go.sum should list directly used modules and dependencies
-go get rsc.io/quote@v1.5.2
+go get -d rsc.io/quote@v1.5.2
 go mod tidy
 grep rsc.io/sampler go.sum
 
 # go.sum should not normally lose old entries
-go get rsc.io/quote@v1.0.0
+go get -d rsc.io/quote@v1.0.0
 grep 'rsc.io/quote v1.0.0' go.sum
 grep 'rsc.io/quote v1.5.2' go.sum
 grep rsc.io/sampler go.sum
index 3427cd77859306125afd0f5950b0ad6c90fa03d6..a5390009646ec410765eea64b105dc7a2a3b4383 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=on
+[short] skip
 
 # Initially, we are at v1.0.0 for all dependencies.
 cp go.mod go.mod.orig
index 114dbc5f044839313b5d4a2622c2618ebb5c5921..9b6dd3795df9ac36c0619562921bdcbbdaee6b82 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=on
+[short] skip
 
 # Initially, we are at v1.0.0 for all dependencies.
 cp go.mod go.mod.orig
@@ -11,7 +12,7 @@ stdout '^patch.example.com/indirect v1.0.0'
 # of the package in the current directory, pulling in transitive dependencies
 # and also patching those.
 cp go.mod.orig go.mod
-go get -u=patch
+go get -d -u=patch
 go list -m all
 stdout '^patch.example.com/direct v1.0.1'
 stdout '^patch.example.com/indirect v1.0.1'
@@ -19,7 +20,7 @@ stdout '^patch.example.com/depofdirectpatch v1.0.0'
 
 # 'get all@patch' should be equivalent to 'get -u=patch all'
 cp go.mod.orig go.mod
-go get all@patch
+go get -d all@patch
 go list -m all
 stdout '^patch.example.com/direct v1.0.1'
 stdout '^patch.example.com/indirect v1.0.1'
@@ -28,7 +29,7 @@ stdout '^patch.example.com/depofdirectpatch v1.0.0'
 # Requesting the direct dependency with -u=patch but without an explicit version
 # should patch-update it and its dependencies.
 cp go.mod.orig go.mod
-go get -u=patch patch.example.com/direct
+go get -d -u=patch patch.example.com/direct
 go list -m all
 stdout '^patch.example.com/direct v1.0.1'
 stdout '^patch.example.com/indirect v1.0.1'
@@ -36,7 +37,7 @@ stdout '^patch.example.com/depofdirectpatch v1.0.0'
 
 # Requesting only the indirect dependency should not update the direct one.
 cp go.mod.orig go.mod
-go get -u=patch patch.example.com/indirect
+go get -d -u=patch patch.example.com/indirect
 go list -m all
 stdout '^patch.example.com/direct v1.0.0'
 stdout '^patch.example.com/indirect v1.0.1'
@@ -45,7 +46,7 @@ stdout '^patch.example.com/indirect v1.0.1'
 # @patch should apply only to the specific module,
 # but the result must reflect its upgraded requirements.
 cp go.mod.orig go.mod
-go get patch.example.com/direct@patch
+go get -d patch.example.com/direct@patch
 go list -m all
 stdout '^patch.example.com/direct v1.0.1'
 stdout '^patch.example.com/indirect v1.0.0'
@@ -53,7 +54,7 @@ stdout '^patch.example.com/depofdirectpatch v1.0.0'
 
 # An explicit @patch should override a general -u.
 cp go.mod.orig go.mod
-go get -u patch.example.com/direct@patch
+go get -d -u patch.example.com/direct@patch
 go list -m all
 stdout '^patch.example.com/direct v1.0.1'
 stdout '^patch.example.com/indirect v1.1.0'
@@ -61,7 +62,7 @@ stdout '^patch.example.com/depofdirectpatch v1.0.0'
 
 # An explicit @latest should override a general -u=patch.
 cp go.mod.orig go.mod
-go get -u=patch patch.example.com/direct@latest
+go get -d -u=patch patch.example.com/direct@latest
 go list -m all
 stdout '^patch.example.com/direct v1.1.0'
 stdout '^patch.example.com/indirect v1.0.1'
@@ -73,7 +74,7 @@ cp go.mod.orig go.mod
 stderr 'cannot use pattern .* with explicit version'
 
 # However, standard-library packages without explicit versions are fine.
-go get -u=patch -d cmd/go
+go get -d -u=patch -d cmd/go
 
 
 -- go.mod --
index da3fd9105536b74c06f3a722fa4155d1854253bc..24920a36b66e9aa8e420f536f597e1482210ac12 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=on
+[short] skip
 
 # initial conditions: using sampler v1.3.0, not listed in go.mod.
 go list -deps
index 50c9b4a43751aafacfc50a56e392fea0ae9f7454..646bc62bb7015b026392b480870c723bf4e96b0b 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=on
+[short] skip
 
 # With good go.sum, verify succeeds by avoiding download.
 cp go.sum.good go.sum
index 4d556fc73fff371565dfd02ba4a6326e692bcc33..10a4f9fbea7981745ab34cde46ebefd798645760 100644 (file)
@@ -1,4 +1,5 @@
 env GO111MODULE=on
+[short] skip
 
 go list -test all
 stdout rsc.io/quote
index e12aed0f0059f797ca9bb83d9043eb203fb983ff..54ddee9ae1f82a0a06120aa479fb32dd6422e6ec 100644 (file)
@@ -1,4 +1,6 @@
 env GO111MODULE=on
+[short] skip
+
 # Check for correct naming of temporary executable
 
 #Test for single file specified
index 6a24adbdf459861fa9ed0717ff607e84e4aa050e..8aa61166acf227572555b5a7716189068cb22e90 100644 (file)
@@ -1,17 +1,17 @@
 # Test that go.sum does not get updated when -mod=readonly flag is set
 env GO111MODULE=on
 
-go get rsc.io/quote
+go get -d rsc.io/quote
 go mod tidy
 
 # go.sum != dirty; -mod=readonly
-go build -mod=readonly
+go list -mod=readonly
 
 # dirty up go.sum by removing it.
 rm go.sum
 
 # go.sum == dirty; -mod=readonly
-! go build -mod=readonly
+! go list -mod=readonly
 
 stderr 'go: updates to go.sum needed, disabled by -mod=readonly'
 
index 43471557f3f6f053f3042025359708c0e8facdb2..73b4f3c7686f9de64ed86d9c7ee9174a67351e72 100644 (file)
@@ -4,61 +4,68 @@ env GO111MODULE=on
 
 # A TestMain should be able to access testing flags if it calls flag.Parse
 # without needing to use testing.Init.
-go test testmain_flag_test.go
-
 # Test code can use the name 'testing' without colliding with generated
 # testinginit code.
-go test testing_collision_test.go
-
 # Tests running under 'go test' should observe that testing.Init is called
 # before any user package initialization code runs.
-go test ./testinitflag
+go test
+stdout TestMain
+stdout TestInit
+stdout TestExt
+
+-- go.mod --
+module m
 
--- testmain_flag_test.go --
-package testmain_flag_test
+-- init_test.go --
+package testinitflag
 
 import (
        "flag"
        "fmt"
        "os"
-       "testing"
+       Testing "testing"
 )
 
-func TestMain(m *testing.M) {
-       flag.Parse()
+func testFlagsInitialized() bool {
        found := false
        flag.VisitAll(func(f *flag.Flag) {
                if f.Name == "test.count" {
                        found = true
                }
        })
-       if !found {
+       return found
+}
+
+var testing int
+var testingInitAtInitialization = testFlagsInitialized()
+
+func TestInit(t *Testing.T) {
+       if !testingInitAtInitialization {
+               t.Fatal("testing.Init not called before package initialization")
+       }
+       fmt.Printf("TestInit\n")
+}
+
+func TestMain(m *Testing.M) {
+       fmt.Printf("TestMain\n")
+       flag.Parse()
+       if !testFlagsInitialized() {
                fmt.Println("testing flags not registered")
                os.Exit(1)
        }
        os.Exit(m.Run())
 }
 
-func TestX(t *testing.T) {}
-
--- testing_collision_test.go --
-package testing_collision_test
-
-import testing2 "testing"
-
-var testing = 3
-
-func TestX(t *testing2.T) {}
-
--- go.mod --
-module m
-
--- testinitflag/init.go --
-package testinitflag
+-- external_test.go --
+package testinitflag_test
 
-import "flag"
+import (
+       "flag"
+       "fmt"
+       Testing "testing"
+)
 
-func TestFlagsInitialized() bool {
+func testFlagsInitialized() bool {
        found := false
        flag.VisitAll(func(f *flag.Flag) {
                if f.Name == "test.count" {
@@ -68,30 +75,11 @@ func TestFlagsInitialized() bool {
        return found
 }
 
--- testinitflag/init_test.go --
-package testinitflag
-
-import "testing"
-
-var testingInitAtInitialization = TestFlagsInitialized()
-
-func TestInit(t *testing.T) {
-       if !testingInitAtInitialization {
-               t.Fatal("testing.Init not called before package initialization")
-       }
-}
-
--- testinitflag/external_test.go --
-package testinitflag_test
-
-import (
-       "testing"
-       "m/testinitflag"
-)
-
-var testingInitAtInitialization = testinitflag.TestFlagsInitialized()
+var testing int
+var testingInitAtInitialization = testFlagsInitialized()
 
-func TestInitExternal(t *testing.T) {
+func TestExt(t *Testing.T) {
+       fmt.Printf("TestExt\n")
        if !testingInitAtInitialization {
                t.Fatal("testing.Init not called before package initialization")
        }
index 9087a9030e19e745a235e8b7d73e0e69c6b38497..8dead0a439ad2b124c9613c96ed88343685fa1cc 100644 (file)
@@ -1,3 +1,4 @@
+[short] skip
 env GO111MODULE=off
 cd a
 
index 84cb23a362b1f8e35aac4c393a4517bdd39babc9..cb4881f7a72ac3f1538bd049b7a99544f5a77c26 100644 (file)
@@ -1,4 +1,6 @@
 env GO111MODULE=on
+[short] skip
+
 go build -o fortune.exe rsc.io/fortune
 go version fortune.exe
 stdout '^fortune.exe: .+'
index ea920ea866c50ea3720af2e47415a7dbf23c4a93..59b35ec7c285890b11d7309aec89d063043dbc57 100644 (file)
@@ -2,8 +2,7 @@ env GO111MODULE=off
 
 # Issue 27665. Verify that "go vet" analyzes non-Go files.
 
-env GOOS=linux
-env GOARCH=amd64
+[!amd64] skip
 ! go vet -asmdecl a
 stderr 'f: invalid MOVW of x'