@@ -69,14 +69,10 @@ var exeSuffix string = func() string {
69
69
return ""
70
70
}()
71
71
72
- func tooSlow (t * testing.T ) {
72
+ func tooSlow (t * testing.T , reason string ) {
73
73
if testing .Short () {
74
- // In -short mode; skip test, except run it on the {darwin,linux,windows}/amd64 builders.
75
- if testenv .Builder () != "" && runtime .GOARCH == "amd64" && (runtime .GOOS == "linux" || runtime .GOOS == "darwin" || runtime .GOOS == "windows" ) {
76
- return
77
- }
78
74
t .Helper ()
79
- t .Skip ("skipping test in -short mode" )
75
+ t .Skipf ("skipping test in -short mode: %s" , reason )
80
76
}
81
77
}
82
78
@@ -1085,7 +1081,7 @@ func TestPackageMainTestCompilerFlags(t *testing.T) {
1085
1081
1086
1082
// Issue 4104.
1087
1083
func TestGoTestWithPackageListedMultipleTimes (t * testing.T ) {
1088
- tooSlow (t )
1084
+ tooSlow (t , "links and runs a test" )
1089
1085
tg := testgo (t )
1090
1086
defer tg .cleanup ()
1091
1087
tg .parallel ()
@@ -1096,7 +1092,7 @@ func TestGoTestWithPackageListedMultipleTimes(t *testing.T) {
1096
1092
}
1097
1093
1098
1094
func TestGoListHasAConsistentOrder (t * testing.T ) {
1099
- tooSlow (t )
1095
+ tooSlow (t , "walks all of GOROOT/src twice" )
1100
1096
tg := testgo (t )
1101
1097
defer tg .cleanup ()
1102
1098
tg .parallel ()
@@ -1109,7 +1105,7 @@ func TestGoListHasAConsistentOrder(t *testing.T) {
1109
1105
}
1110
1106
1111
1107
func TestGoListStdDoesNotIncludeCommands (t * testing.T ) {
1112
- tooSlow (t )
1108
+ tooSlow (t , "walks all of GOROOT/src" )
1113
1109
tg := testgo (t )
1114
1110
defer tg .cleanup ()
1115
1111
tg .parallel ()
@@ -1119,7 +1115,7 @@ func TestGoListStdDoesNotIncludeCommands(t *testing.T) {
1119
1115
1120
1116
func TestGoListCmdOnlyShowsCommands (t * testing.T ) {
1121
1117
skipIfGccgo (t , "gccgo does not have GOROOT" )
1122
- tooSlow (t )
1118
+ tooSlow (t , "walks all of GOROOT/src/cmd" )
1123
1119
tg := testgo (t )
1124
1120
defer tg .cleanup ()
1125
1121
tg .parallel ()
@@ -1202,7 +1198,8 @@ func TestGoListTest(t *testing.T) {
1202
1198
}
1203
1199
1204
1200
func TestGoListCompiledCgo (t * testing.T ) {
1205
- tooSlow (t )
1201
+ tooSlow (t , "compiles cgo files" )
1202
+
1206
1203
tg := testgo (t )
1207
1204
defer tg .cleanup ()
1208
1205
tg .parallel ()
@@ -1423,7 +1420,7 @@ func TestDefaultGOPATHPrintedSearchList(t *testing.T) {
1423
1420
1424
1421
func TestLdflagsArgumentsWithSpacesIssue3941 (t * testing.T ) {
1425
1422
skipIfGccgo (t , "gccgo does not support -ldflags -X" )
1426
- tooSlow (t )
1423
+ tooSlow (t , "compiles and links a binary" )
1427
1424
tg := testgo (t )
1428
1425
defer tg .cleanup ()
1429
1426
tg .parallel ()
@@ -1440,7 +1437,7 @@ func TestLdFlagsLongArgumentsIssue42295(t *testing.T) {
1440
1437
// Test the extremely long command line arguments that contain '\n' characters
1441
1438
// get encoded and passed correctly.
1442
1439
skipIfGccgo (t , "gccgo does not support -ldflags -X" )
1443
- tooSlow (t )
1440
+ tooSlow (t , "compiles and links a binary" )
1444
1441
tg := testgo (t )
1445
1442
defer tg .cleanup ()
1446
1443
tg .parallel ()
@@ -1462,7 +1459,7 @@ func TestLdFlagsLongArgumentsIssue42295(t *testing.T) {
1462
1459
1463
1460
func TestGoTestDashCDashOControlsBinaryLocation (t * testing.T ) {
1464
1461
skipIfGccgo (t , "gccgo has no standard packages" )
1465
- tooSlow (t )
1462
+ tooSlow (t , "compiles and links a test binary" )
1466
1463
tg := testgo (t )
1467
1464
defer tg .cleanup ()
1468
1465
tg .parallel ()
@@ -1473,7 +1470,7 @@ func TestGoTestDashCDashOControlsBinaryLocation(t *testing.T) {
1473
1470
1474
1471
func TestGoTestDashOWritesBinary (t * testing.T ) {
1475
1472
skipIfGccgo (t , "gccgo has no standard packages" )
1476
- tooSlow (t )
1473
+ tooSlow (t , "compiles and runs a test binary" )
1477
1474
tg := testgo (t )
1478
1475
defer tg .cleanup ()
1479
1476
tg .parallel ()
@@ -1484,7 +1481,7 @@ func TestGoTestDashOWritesBinary(t *testing.T) {
1484
1481
1485
1482
// Issue 4515.
1486
1483
func TestInstallWithTags (t * testing.T ) {
1487
- tooSlow (t )
1484
+ tooSlow (t , "compiles and links binaries" )
1488
1485
tg := testgo (t )
1489
1486
defer tg .cleanup ()
1490
1487
tg .parallel ()
@@ -1553,7 +1550,7 @@ func TestCgoShowsFullPathNames(t *testing.T) {
1553
1550
}
1554
1551
1555
1552
func TestCgoHandlesWlORIGIN (t * testing.T ) {
1556
- tooSlow (t )
1553
+ tooSlow (t , "compiles cgo files" )
1557
1554
if ! canCgo {
1558
1555
t .Skip ("skipping because cgo not enabled" )
1559
1556
}
@@ -1571,7 +1568,7 @@ func TestCgoHandlesWlORIGIN(t *testing.T) {
1571
1568
}
1572
1569
1573
1570
func TestCgoPkgConfig (t * testing.T ) {
1574
- tooSlow (t )
1571
+ tooSlow (t , "compiles cgo files" )
1575
1572
if ! canCgo {
1576
1573
t .Skip ("skipping because cgo not enabled" )
1577
1574
}
@@ -1672,7 +1669,7 @@ func TestListTemplateContextFunction(t *testing.T) {
1672
1669
// accessed by a non-local import (found in a GOPATH/GOROOT).
1673
1670
// See golang.org/issue/17475.
1674
1671
func TestImportLocal (t * testing.T ) {
1675
- tooSlow (t )
1672
+ tooSlow (t , "builds a lot of sequential packages" )
1676
1673
1677
1674
tg := testgo (t )
1678
1675
tg .parallel ()
@@ -1830,7 +1827,7 @@ func TestGoInstallPkgdir(t *testing.T) {
1830
1827
// for the install.
1831
1828
t .Skip ("skipping because cgo not enabled" )
1832
1829
}
1833
- tooSlow (t )
1830
+ tooSlow (t , "builds a package with cgo dependencies" )
1834
1831
1835
1832
tg := testgo (t )
1836
1833
tg .parallel ()
@@ -1845,7 +1842,7 @@ func TestGoInstallPkgdir(t *testing.T) {
1845
1842
1846
1843
// For issue 14337.
1847
1844
func TestParallelTest (t * testing.T ) {
1848
- tooSlow (t )
1845
+ tooSlow (t , "links and runs test binaries" )
1849
1846
tg := testgo (t )
1850
1847
tg .parallel ()
1851
1848
defer tg .cleanup ()
@@ -1865,7 +1862,7 @@ func TestParallelTest(t *testing.T) {
1865
1862
}
1866
1863
1867
1864
func TestBinaryOnlyPackages (t * testing.T ) {
1868
- tooSlow (t )
1865
+ tooSlow (t , "compiles several packages sequentially" )
1869
1866
1870
1867
tg := testgo (t )
1871
1868
defer tg .cleanup ()
@@ -2067,7 +2064,7 @@ func TestFFLAGS(t *testing.T) {
2067
2064
// This is really a cmd/link issue but this is a convenient place to test it.
2068
2065
func TestDuplicateGlobalAsmSymbols (t * testing.T ) {
2069
2066
skipIfGccgo (t , "gccgo does not use cmd/asm" )
2070
- tooSlow (t )
2067
+ tooSlow (t , "links a binary with cgo dependencies" )
2071
2068
if runtime .GOARCH != "386" && runtime .GOARCH != "amd64" {
2072
2069
t .Skipf ("skipping test on %s" , runtime .GOARCH )
2073
2070
}
@@ -2366,10 +2363,11 @@ func TestUpxCompression(t *testing.T) {
2366
2363
var gocacheverify = godebug .New ("gocacheverify" )
2367
2364
2368
2365
func TestCacheListStale (t * testing.T ) {
2369
- tooSlow (t )
2366
+ tooSlow (t , "links a binary" )
2370
2367
if gocacheverify .Value () == "1" {
2371
2368
t .Skip ("GODEBUG gocacheverify" )
2372
2369
}
2370
+
2373
2371
tg := testgo (t )
2374
2372
defer tg .cleanup ()
2375
2373
tg .parallel ()
@@ -2388,8 +2386,7 @@ func TestCacheListStale(t *testing.T) {
2388
2386
}
2389
2387
2390
2388
func TestCacheCoverage (t * testing.T ) {
2391
- tooSlow (t )
2392
-
2389
+ tooSlow (t , "links and runs a test binary with coverage enabled" )
2393
2390
if gocacheverify .Value () == "1" {
2394
2391
t .Skip ("GODEBUG gocacheverify" )
2395
2392
}
@@ -2423,10 +2420,11 @@ func TestIssue22588(t *testing.T) {
2423
2420
}
2424
2421
2425
2422
func TestIssue22531 (t * testing.T ) {
2426
- tooSlow (t )
2423
+ tooSlow (t , "links binaries" )
2427
2424
if gocacheverify .Value () == "1" {
2428
2425
t .Skip ("GODEBUG gocacheverify" )
2429
2426
}
2427
+
2430
2428
tg := testgo (t )
2431
2429
defer tg .cleanup ()
2432
2430
tg .parallel ()
@@ -2452,10 +2450,11 @@ func TestIssue22531(t *testing.T) {
2452
2450
}
2453
2451
2454
2452
func TestIssue22596 (t * testing.T ) {
2455
- tooSlow (t )
2453
+ tooSlow (t , "links binaries" )
2456
2454
if gocacheverify .Value () == "1" {
2457
2455
t .Skip ("GODEBUG gocacheverify" )
2458
2456
}
2457
+
2459
2458
tg := testgo (t )
2460
2459
defer tg .cleanup ()
2461
2460
tg .parallel ()
@@ -2481,7 +2480,7 @@ func TestIssue22596(t *testing.T) {
2481
2480
}
2482
2481
2483
2482
func TestTestCache (t * testing.T ) {
2484
- tooSlow (t )
2483
+ tooSlow (t , "links and runs test binaries" )
2485
2484
2486
2485
if gocacheverify .Value () == "1" {
2487
2486
t .Skip ("GODEBUG gocacheverify" )
@@ -2588,7 +2587,8 @@ func TestTestSkipVetAfterFailedBuild(t *testing.T) {
2588
2587
}
2589
2588
2590
2589
func TestTestVetRebuild (t * testing.T ) {
2591
- tooSlow (t )
2590
+ tooSlow (t , "links and runs test binaries" )
2591
+
2592
2592
tg := testgo (t )
2593
2593
defer tg .cleanup ()
2594
2594
tg .parallel ()
@@ -2628,7 +2628,8 @@ func TestTestVetRebuild(t *testing.T) {
2628
2628
}
2629
2629
2630
2630
func TestInstallDeps (t * testing.T ) {
2631
- tooSlow (t )
2631
+ tooSlow (t , "links a binary" )
2632
+
2632
2633
tg := testgo (t )
2633
2634
defer tg .cleanup ()
2634
2635
tg .parallel ()
@@ -2659,7 +2660,8 @@ func TestInstallDeps(t *testing.T) {
2659
2660
2660
2661
// Issue 22986.
2661
2662
func TestImportPath (t * testing.T ) {
2662
- tooSlow (t )
2663
+ tooSlow (t , "links and runs a test binary" )
2664
+
2663
2665
tg := testgo (t )
2664
2666
defer tg .cleanup ()
2665
2667
tg .parallel ()
@@ -2760,7 +2762,8 @@ func TestTwoPkgConfigs(t *testing.T) {
2760
2762
if runtime .GOOS == "windows" || runtime .GOOS == "plan9" {
2761
2763
t .Skipf ("no shell scripts on %s" , runtime .GOOS )
2762
2764
}
2763
- tooSlow (t )
2765
+ tooSlow (t , "builds a package with cgo dependencies" )
2766
+
2764
2767
tg := testgo (t )
2765
2768
defer tg .cleanup ()
2766
2769
tg .parallel ()
@@ -2791,7 +2794,7 @@ func TestCgoCache(t *testing.T) {
2791
2794
if ! canCgo {
2792
2795
t .Skip ("no cgo" )
2793
2796
}
2794
- tooSlow (t )
2797
+ tooSlow (t , "builds a package with cgo dependencies" )
2795
2798
2796
2799
tg := testgo (t )
2797
2800
defer tg .cleanup ()
@@ -2844,7 +2847,7 @@ func TestLinkerTmpDirIsDeleted(t *testing.T) {
2844
2847
if ! canCgo {
2845
2848
t .Skip ("skipping because cgo not enabled" )
2846
2849
}
2847
- tooSlow (t )
2850
+ tooSlow (t , "builds a package with cgo dependencies" )
2848
2851
2849
2852
tg := testgo (t )
2850
2853
defer tg .cleanup ()
@@ -2891,7 +2894,8 @@ func TestLinkerTmpDirIsDeleted(t *testing.T) {
2891
2894
// Issue 25093.
2892
2895
func TestCoverpkgTestOnly (t * testing.T ) {
2893
2896
skipIfGccgo (t , "gccgo has no cover tool" )
2894
- tooSlow (t )
2897
+ tooSlow (t , "links and runs a test binary with coverage enabled" )
2898
+
2895
2899
tg := testgo (t )
2896
2900
defer tg .cleanup ()
2897
2901
tg .parallel ()
0 commit comments