@@ -62,14 +62,10 @@ var exeSuffix string = func() string {
62
62
return ""
63
63
}()
64
64
65
- func tooSlow (t * testing.T ) {
65
+ func tooSlow (t * testing.T , reason string ) {
66
66
if testing .Short () {
67
- // In -short mode; skip test, except run it on the {darwin,linux,windows}/amd64 builders.
68
- if testenv .Builder () != "" && runtime .GOARCH == "amd64" && (runtime .GOOS == "linux" || runtime .GOOS == "darwin" || runtime .GOOS == "windows" ) {
69
- return
70
- }
71
67
t .Helper ()
72
- t .Skip ("skipping test in -short mode" )
68
+ t .Skipf ("skipping test in -short mode: %s" , reason )
73
69
}
74
70
}
75
71
@@ -1080,7 +1076,7 @@ func TestPackageMainTestCompilerFlags(t *testing.T) {
1080
1076
1081
1077
// Issue 4104.
1082
1078
func TestGoTestWithPackageListedMultipleTimes (t * testing.T ) {
1083
- tooSlow (t )
1079
+ tooSlow (t , "links and runs a test" )
1084
1080
tg := testgo (t )
1085
1081
defer tg .cleanup ()
1086
1082
tg .parallel ()
@@ -1091,7 +1087,7 @@ func TestGoTestWithPackageListedMultipleTimes(t *testing.T) {
1091
1087
}
1092
1088
1093
1089
func TestGoListHasAConsistentOrder (t * testing.T ) {
1094
- tooSlow (t )
1090
+ tooSlow (t , "walks all of GOROOT/src twice" )
1095
1091
tg := testgo (t )
1096
1092
defer tg .cleanup ()
1097
1093
tg .parallel ()
@@ -1104,7 +1100,7 @@ func TestGoListHasAConsistentOrder(t *testing.T) {
1104
1100
}
1105
1101
1106
1102
func TestGoListStdDoesNotIncludeCommands (t * testing.T ) {
1107
- tooSlow (t )
1103
+ tooSlow (t , "walks all of GOROOT/src" )
1108
1104
tg := testgo (t )
1109
1105
defer tg .cleanup ()
1110
1106
tg .parallel ()
@@ -1114,7 +1110,7 @@ func TestGoListStdDoesNotIncludeCommands(t *testing.T) {
1114
1110
1115
1111
func TestGoListCmdOnlyShowsCommands (t * testing.T ) {
1116
1112
skipIfGccgo (t , "gccgo does not have GOROOT" )
1117
- tooSlow (t )
1113
+ tooSlow (t , "walks all of GOROOT/src/cmd" )
1118
1114
tg := testgo (t )
1119
1115
defer tg .cleanup ()
1120
1116
tg .parallel ()
@@ -1197,7 +1193,8 @@ func TestGoListTest(t *testing.T) {
1197
1193
}
1198
1194
1199
1195
func TestGoListCompiledCgo (t * testing.T ) {
1200
- tooSlow (t )
1196
+ tooSlow (t , "compiles cgo files" )
1197
+
1201
1198
tg := testgo (t )
1202
1199
defer tg .cleanup ()
1203
1200
tg .parallel ()
@@ -1418,7 +1415,7 @@ func TestDefaultGOPATHPrintedSearchList(t *testing.T) {
1418
1415
1419
1416
func TestLdflagsArgumentsWithSpacesIssue3941 (t * testing.T ) {
1420
1417
skipIfGccgo (t , "gccgo does not support -ldflags -X" )
1421
- tooSlow (t )
1418
+ tooSlow (t , "compiles and links a binary" )
1422
1419
tg := testgo (t )
1423
1420
defer tg .cleanup ()
1424
1421
tg .parallel ()
@@ -1435,7 +1432,7 @@ func TestLdFlagsLongArgumentsIssue42295(t *testing.T) {
1435
1432
// Test the extremely long command line arguments that contain '\n' characters
1436
1433
// get encoded and passed correctly.
1437
1434
skipIfGccgo (t , "gccgo does not support -ldflags -X" )
1438
- tooSlow (t )
1435
+ tooSlow (t , "compiles and links a binary" )
1439
1436
tg := testgo (t )
1440
1437
defer tg .cleanup ()
1441
1438
tg .parallel ()
@@ -1457,7 +1454,7 @@ func TestLdFlagsLongArgumentsIssue42295(t *testing.T) {
1457
1454
1458
1455
func TestGoTestDashCDashOControlsBinaryLocation (t * testing.T ) {
1459
1456
skipIfGccgo (t , "gccgo has no standard packages" )
1460
- tooSlow (t )
1457
+ tooSlow (t , "compiles and links a test binary" )
1461
1458
tg := testgo (t )
1462
1459
defer tg .cleanup ()
1463
1460
tg .parallel ()
@@ -1468,7 +1465,7 @@ func TestGoTestDashCDashOControlsBinaryLocation(t *testing.T) {
1468
1465
1469
1466
func TestGoTestDashOWritesBinary (t * testing.T ) {
1470
1467
skipIfGccgo (t , "gccgo has no standard packages" )
1471
- tooSlow (t )
1468
+ tooSlow (t , "compiles and runs a test binary" )
1472
1469
tg := testgo (t )
1473
1470
defer tg .cleanup ()
1474
1471
tg .parallel ()
@@ -1479,7 +1476,7 @@ func TestGoTestDashOWritesBinary(t *testing.T) {
1479
1476
1480
1477
func TestGoTestDashIDashOWritesBinary (t * testing.T ) {
1481
1478
skipIfGccgo (t , "gccgo has no standard packages" )
1482
- tooSlow (t )
1479
+ tooSlow (t , "links a test binary" )
1483
1480
tg := testgo (t )
1484
1481
defer tg .cleanup ()
1485
1482
tg .parallel ()
@@ -1495,7 +1492,7 @@ func TestGoTestDashIDashOWritesBinary(t *testing.T) {
1495
1492
1496
1493
// Issue 4515.
1497
1494
func TestInstallWithTags (t * testing.T ) {
1498
- tooSlow (t )
1495
+ tooSlow (t , "compiles and links binaries" )
1499
1496
tg := testgo (t )
1500
1497
defer tg .cleanup ()
1501
1498
tg .parallel ()
@@ -1564,7 +1561,7 @@ func TestCgoShowsFullPathNames(t *testing.T) {
1564
1561
}
1565
1562
1566
1563
func TestCgoHandlesWlORIGIN (t * testing.T ) {
1567
- tooSlow (t )
1564
+ tooSlow (t , "compiles cgo files" )
1568
1565
if ! canCgo {
1569
1566
t .Skip ("skipping because cgo not enabled" )
1570
1567
}
@@ -1582,7 +1579,7 @@ func TestCgoHandlesWlORIGIN(t *testing.T) {
1582
1579
}
1583
1580
1584
1581
func TestCgoPkgConfig (t * testing.T ) {
1585
- tooSlow (t )
1582
+ tooSlow (t , "compiles cgo files" )
1586
1583
if ! canCgo {
1587
1584
t .Skip ("skipping because cgo not enabled" )
1588
1585
}
@@ -1667,7 +1664,7 @@ func TestListTemplateContextFunction(t *testing.T) {
1667
1664
// accessed by a non-local import (found in a GOPATH/GOROOT).
1668
1665
// See golang.org/issue/17475.
1669
1666
func TestImportLocal (t * testing.T ) {
1670
- tooSlow (t )
1667
+ tooSlow (t , "builds a lot of sequential packages" )
1671
1668
1672
1669
tg := testgo (t )
1673
1670
tg .parallel ()
@@ -1819,7 +1816,7 @@ func TestImportLocal(t *testing.T) {
1819
1816
1820
1817
func TestGoInstallPkgdir (t * testing.T ) {
1821
1818
skipIfGccgo (t , "gccgo has no standard packages" )
1822
- tooSlow (t )
1819
+ tooSlow (t , "installs archives in GOROOT" )
1823
1820
1824
1821
tg := testgo (t )
1825
1822
tg .parallel ()
@@ -1836,7 +1833,7 @@ func TestGoInstallPkgdir(t *testing.T) {
1836
1833
1837
1834
// For issue 14337.
1838
1835
func TestParallelTest (t * testing.T ) {
1839
- tooSlow (t )
1836
+ tooSlow (t , "links and runs test binaries" )
1840
1837
tg := testgo (t )
1841
1838
tg .parallel ()
1842
1839
defer tg .cleanup ()
@@ -1856,7 +1853,7 @@ func TestParallelTest(t *testing.T) {
1856
1853
}
1857
1854
1858
1855
func TestBinaryOnlyPackages (t * testing.T ) {
1859
- tooSlow (t )
1856
+ tooSlow (t , "compiles several packages sequentially" )
1860
1857
1861
1858
tg := testgo (t )
1862
1859
defer tg .cleanup ()
@@ -2058,7 +2055,7 @@ func TestFFLAGS(t *testing.T) {
2058
2055
// This is really a cmd/link issue but this is a convenient place to test it.
2059
2056
func TestDuplicateGlobalAsmSymbols (t * testing.T ) {
2060
2057
skipIfGccgo (t , "gccgo does not use cmd/asm" )
2061
- tooSlow (t )
2058
+ tooSlow (t , "links a binary with cgo dependencies" )
2062
2059
if runtime .GOARCH != "386" && runtime .GOARCH != "amd64" {
2063
2060
t .Skipf ("skipping test on %s" , runtime .GOARCH )
2064
2061
}
@@ -2351,10 +2348,11 @@ func TestUpxCompression(t *testing.T) {
2351
2348
}
2352
2349
2353
2350
func TestCacheListStale (t * testing.T ) {
2354
- tooSlow (t )
2351
+ tooSlow (t , "links a binary" )
2355
2352
if godebug .Get ("gocacheverify" ) == "1" {
2356
2353
t .Skip ("GODEBUG gocacheverify" )
2357
2354
}
2355
+
2358
2356
tg := testgo (t )
2359
2357
defer tg .cleanup ()
2360
2358
tg .parallel ()
@@ -2373,7 +2371,7 @@ func TestCacheListStale(t *testing.T) {
2373
2371
}
2374
2372
2375
2373
func TestCacheCoverage (t * testing.T ) {
2376
- tooSlow (t )
2374
+ tooSlow (t , "links and runs a test binary with coverage enabled" )
2377
2375
2378
2376
if godebug .Get ("gocacheverify" ) == "1" {
2379
2377
t .Skip ("GODEBUG gocacheverify" )
@@ -2406,10 +2404,11 @@ func TestIssue22588(t *testing.T) {
2406
2404
}
2407
2405
2408
2406
func TestIssue22531 (t * testing.T ) {
2409
- tooSlow (t )
2407
+ tooSlow (t , "links binaries" )
2410
2408
if godebug .Get ("gocacheverify" ) == "1" {
2411
2409
t .Skip ("GODEBUG gocacheverify" )
2412
2410
}
2411
+
2413
2412
tg := testgo (t )
2414
2413
defer tg .cleanup ()
2415
2414
tg .parallel ()
@@ -2435,10 +2434,11 @@ func TestIssue22531(t *testing.T) {
2435
2434
}
2436
2435
2437
2436
func TestIssue22596 (t * testing.T ) {
2438
- tooSlow (t )
2437
+ tooSlow (t , "links binaries" )
2439
2438
if godebug .Get ("gocacheverify" ) == "1" {
2440
2439
t .Skip ("GODEBUG gocacheverify" )
2441
2440
}
2441
+
2442
2442
tg := testgo (t )
2443
2443
defer tg .cleanup ()
2444
2444
tg .parallel ()
@@ -2464,7 +2464,7 @@ func TestIssue22596(t *testing.T) {
2464
2464
}
2465
2465
2466
2466
func TestTestCache (t * testing.T ) {
2467
- tooSlow (t )
2467
+ tooSlow (t , "links and runs test binaries" )
2468
2468
2469
2469
if godebug .Get ("gocacheverify" ) == "1" {
2470
2470
t .Skip ("GODEBUG gocacheverify" )
@@ -2571,7 +2571,8 @@ func TestTestSkipVetAfterFailedBuild(t *testing.T) {
2571
2571
}
2572
2572
2573
2573
func TestTestVetRebuild (t * testing.T ) {
2574
- tooSlow (t )
2574
+ tooSlow (t , "links and runs test binaries" )
2575
+
2575
2576
tg := testgo (t )
2576
2577
defer tg .cleanup ()
2577
2578
tg .parallel ()
@@ -2611,7 +2612,8 @@ func TestTestVetRebuild(t *testing.T) {
2611
2612
}
2612
2613
2613
2614
func TestInstallDeps (t * testing.T ) {
2614
- tooSlow (t )
2615
+ tooSlow (t , "links a binary" )
2616
+
2615
2617
tg := testgo (t )
2616
2618
defer tg .cleanup ()
2617
2619
tg .parallel ()
@@ -2652,7 +2654,8 @@ func TestInstallDeps(t *testing.T) {
2652
2654
2653
2655
// Issue 22986.
2654
2656
func TestImportPath (t * testing.T ) {
2655
- tooSlow (t )
2657
+ tooSlow (t , "links and runs a test binary" )
2658
+
2656
2659
tg := testgo (t )
2657
2660
defer tg .cleanup ()
2658
2661
tg .parallel ()
@@ -2753,7 +2756,8 @@ func TestTwoPkgConfigs(t *testing.T) {
2753
2756
if runtime .GOOS == "windows" || runtime .GOOS == "plan9" {
2754
2757
t .Skipf ("no shell scripts on %s" , runtime .GOOS )
2755
2758
}
2756
- tooSlow (t )
2759
+ tooSlow (t , "builds a package with cgo dependencies" )
2760
+
2757
2761
tg := testgo (t )
2758
2762
defer tg .cleanup ()
2759
2763
tg .parallel ()
@@ -2784,7 +2788,7 @@ func TestCgoCache(t *testing.T) {
2784
2788
if ! canCgo {
2785
2789
t .Skip ("no cgo" )
2786
2790
}
2787
- tooSlow (t )
2791
+ tooSlow (t , "builds a package with cgo dependencies" )
2788
2792
2789
2793
tg := testgo (t )
2790
2794
defer tg .cleanup ()
@@ -2837,7 +2841,7 @@ func TestLinkerTmpDirIsDeleted(t *testing.T) {
2837
2841
if ! canCgo {
2838
2842
t .Skip ("skipping because cgo not enabled" )
2839
2843
}
2840
- tooSlow (t )
2844
+ tooSlow (t , "builds a package with cgo dependencies" )
2841
2845
2842
2846
tg := testgo (t )
2843
2847
defer tg .cleanup ()
@@ -2884,7 +2888,8 @@ func TestLinkerTmpDirIsDeleted(t *testing.T) {
2884
2888
// Issue 25093.
2885
2889
func TestCoverpkgTestOnly (t * testing.T ) {
2886
2890
skipIfGccgo (t , "gccgo has no cover tool" )
2887
- tooSlow (t )
2891
+ tooSlow (t , "links and runs a test binary with coverage enabled" )
2892
+
2888
2893
tg := testgo (t )
2889
2894
defer tg .cleanup ()
2890
2895
tg .parallel ()
0 commit comments