return ""
}()
-func tooSlow(t *testing.T) {
+func tooSlow(t *testing.T, reason string) {
if testing.Short() {
- // In -short mode; skip test, except run it on the {darwin,linux,windows}/amd64 builders.
- if testenv.Builder() != "" && runtime.GOARCH == "amd64" && (runtime.GOOS == "linux" || runtime.GOOS == "darwin" || runtime.GOOS == "windows") {
- return
- }
t.Helper()
- t.Skip("skipping test in -short mode")
+ t.Skipf("skipping test in -short mode: %s", reason)
}
}
// Issue 4104.
func TestGoTestWithPackageListedMultipleTimes(t *testing.T) {
- tooSlow(t)
+ tooSlow(t, "links and runs a test")
tg := testgo(t)
defer tg.cleanup()
tg.parallel()
}
func TestGoListHasAConsistentOrder(t *testing.T) {
- tooSlow(t)
+ tooSlow(t, "walks all of GOROOT/src twice")
tg := testgo(t)
defer tg.cleanup()
tg.parallel()
}
func TestGoListStdDoesNotIncludeCommands(t *testing.T) {
- tooSlow(t)
+ tooSlow(t, "walks all of GOROOT/src")
tg := testgo(t)
defer tg.cleanup()
tg.parallel()
func TestGoListCmdOnlyShowsCommands(t *testing.T) {
skipIfGccgo(t, "gccgo does not have GOROOT")
- tooSlow(t)
+ tooSlow(t, "walks all of GOROOT/src/cmd")
tg := testgo(t)
defer tg.cleanup()
tg.parallel()
}
func TestGoListCompiledCgo(t *testing.T) {
- tooSlow(t)
+ tooSlow(t, "compiles cgo files")
+
tg := testgo(t)
defer tg.cleanup()
tg.parallel()
func TestLdflagsArgumentsWithSpacesIssue3941(t *testing.T) {
skipIfGccgo(t, "gccgo does not support -ldflags -X")
- tooSlow(t)
+ tooSlow(t, "compiles and links a binary")
tg := testgo(t)
defer tg.cleanup()
tg.parallel()
// Test the extremely long command line arguments that contain '\n' characters
// get encoded and passed correctly.
skipIfGccgo(t, "gccgo does not support -ldflags -X")
- tooSlow(t)
+ tooSlow(t, "compiles and links a binary")
tg := testgo(t)
defer tg.cleanup()
tg.parallel()
func TestGoTestDashCDashOControlsBinaryLocation(t *testing.T) {
skipIfGccgo(t, "gccgo has no standard packages")
- tooSlow(t)
+ tooSlow(t, "compiles and links a test binary")
tg := testgo(t)
defer tg.cleanup()
tg.parallel()
func TestGoTestDashOWritesBinary(t *testing.T) {
skipIfGccgo(t, "gccgo has no standard packages")
- tooSlow(t)
+ tooSlow(t, "compiles and runs a test binary")
tg := testgo(t)
defer tg.cleanup()
tg.parallel()
// Issue 4515.
func TestInstallWithTags(t *testing.T) {
- tooSlow(t)
+ tooSlow(t, "compiles and links binaries")
tg := testgo(t)
defer tg.cleanup()
tg.parallel()
}
func TestCgoHandlesWlORIGIN(t *testing.T) {
- tooSlow(t)
+ tooSlow(t, "compiles cgo files")
if !canCgo {
t.Skip("skipping because cgo not enabled")
}
}
func TestCgoPkgConfig(t *testing.T) {
- tooSlow(t)
+ tooSlow(t, "compiles cgo files")
if !canCgo {
t.Skip("skipping because cgo not enabled")
}
// accessed by a non-local import (found in a GOPATH/GOROOT).
// See golang.org/issue/17475.
func TestImportLocal(t *testing.T) {
- tooSlow(t)
+ tooSlow(t, "builds a lot of sequential packages")
tg := testgo(t)
tg.parallel()
// for the install.
t.Skip("skipping because cgo not enabled")
}
- tooSlow(t)
+ tooSlow(t, "builds a package with cgo dependencies")
tg := testgo(t)
tg.parallel()
// For issue 14337.
func TestParallelTest(t *testing.T) {
- tooSlow(t)
+ tooSlow(t, "links and runs test binaries")
tg := testgo(t)
tg.parallel()
defer tg.cleanup()
}
func TestBinaryOnlyPackages(t *testing.T) {
- tooSlow(t)
+ tooSlow(t, "compiles several packages sequentially")
tg := testgo(t)
defer tg.cleanup()
// This is really a cmd/link issue but this is a convenient place to test it.
func TestDuplicateGlobalAsmSymbols(t *testing.T) {
skipIfGccgo(t, "gccgo does not use cmd/asm")
- tooSlow(t)
+ tooSlow(t, "links a binary with cgo dependencies")
if runtime.GOARCH != "386" && runtime.GOARCH != "amd64" {
t.Skipf("skipping test on %s", runtime.GOARCH)
}
var gocacheverify = godebug.New("gocacheverify")
func TestCacheListStale(t *testing.T) {
- tooSlow(t)
+ tooSlow(t, "links a binary")
if gocacheverify.Value() == "1" {
t.Skip("GODEBUG gocacheverify")
}
+
tg := testgo(t)
defer tg.cleanup()
tg.parallel()
}
func TestCacheCoverage(t *testing.T) {
- tooSlow(t)
-
+ tooSlow(t, "links and runs a test binary with coverage enabled")
if gocacheverify.Value() == "1" {
t.Skip("GODEBUG gocacheverify")
}
}
func TestIssue22531(t *testing.T) {
- tooSlow(t)
+ tooSlow(t, "links binaries")
if gocacheverify.Value() == "1" {
t.Skip("GODEBUG gocacheverify")
}
+
tg := testgo(t)
defer tg.cleanup()
tg.parallel()
}
func TestIssue22596(t *testing.T) {
- tooSlow(t)
+ tooSlow(t, "links binaries")
if gocacheverify.Value() == "1" {
t.Skip("GODEBUG gocacheverify")
}
+
tg := testgo(t)
defer tg.cleanup()
tg.parallel()
}
func TestTestCache(t *testing.T) {
- tooSlow(t)
+ tooSlow(t, "links and runs test binaries")
if gocacheverify.Value() == "1" {
t.Skip("GODEBUG gocacheverify")
}
func TestTestVetRebuild(t *testing.T) {
- tooSlow(t)
+ tooSlow(t, "links and runs test binaries")
+
tg := testgo(t)
defer tg.cleanup()
tg.parallel()
}
func TestInstallDeps(t *testing.T) {
- tooSlow(t)
+ tooSlow(t, "links a binary")
+
tg := testgo(t)
defer tg.cleanup()
tg.parallel()
// Issue 22986.
func TestImportPath(t *testing.T) {
- tooSlow(t)
+ tooSlow(t, "links and runs a test binary")
+
tg := testgo(t)
defer tg.cleanup()
tg.parallel()
if runtime.GOOS == "windows" || runtime.GOOS == "plan9" {
t.Skipf("no shell scripts on %s", runtime.GOOS)
}
- tooSlow(t)
+ tooSlow(t, "builds a package with cgo dependencies")
+
tg := testgo(t)
defer tg.cleanup()
tg.parallel()
if !canCgo {
t.Skip("no cgo")
}
- tooSlow(t)
+ tooSlow(t, "builds a package with cgo dependencies")
tg := testgo(t)
defer tg.cleanup()
if !canCgo {
t.Skip("skipping because cgo not enabled")
}
- tooSlow(t)
+ tooSlow(t, "builds a package with cgo dependencies")
tg := testgo(t)
defer tg.cleanup()
// Issue 25093.
func TestCoverpkgTestOnly(t *testing.T) {
skipIfGccgo(t, "gccgo has no cover tool")
- tooSlow(t)
+ tooSlow(t, "links and runs a test binary with coverage enabled")
+
tg := testgo(t)
defer tg.cleanup()
tg.parallel()