@@ -281,15 +281,16 @@ func buildFlags(env build.Environment, staticLinking bool, buildTags []string) (
281
281
282
282
func doTest (cmdline []string ) {
283
283
var (
284
- dlgo = flag .Bool ("dlgo" , false , "Download Go and build with it" )
285
- arch = flag .String ("arch" , "" , "Run tests for given architecture" )
286
- cc = flag .String ("cc" , "" , "Sets C compiler binary" )
287
- coverage = flag .Bool ("coverage" , false , "Whether to record code coverage" )
288
- verbose = flag .Bool ("v" , false , "Whether to log verbosely" )
289
- race = flag .Bool ("race" , false , "Execute the race detector" )
290
- short = flag .Bool ("short" , false , "Pass the 'short'-flag to go test" )
291
- cachedir = flag .String ("cachedir" , "./build/cache" , "directory for caching downloads" )
284
+ dlgo = flag .Bool ("dlgo" , false , "Download Go and build with it" )
285
+ arch = flag .String ("arch" , "" , "Run tests for given architecture" )
286
+ cc = flag .String ("cc" , "" , "Sets C compiler binary" )
287
+ coverage = flag .Bool ("coverage" , false , "Whether to record code coverage" )
288
+ verbose = flag .Bool ("v" , false , "Whether to log verbosely" )
289
+ race = flag .Bool ("race" , false , "Execute the race detector" )
290
+ short = flag .Bool ("short" , false , "Pass the 'short'-flag to go test" )
291
+ cachedir = flag .String ("cachedir" , "./build/cache" , "directory for caching downloads" )
292
292
skipspectests = flag .Bool ("skip-spectests" , false , "Skip downloading execution-spec-tests fixtures" )
293
+ threads = flag .Int ("threads" , 1 , "Number of CPU threads to use for testing" )
293
294
)
294
295
flag .CommandLine .Parse (cmdline )
295
296
@@ -320,7 +321,7 @@ func doTest(cmdline []string) {
320
321
321
322
// Test a single package at a time. CI builders are slow
322
323
// and some tests run into timeouts under load.
323
- gotest .Args = append (gotest .Args , "-p" , "1" )
324
+ gotest .Args = append (gotest .Args , "-p" , * threads )
324
325
if * coverage {
325
326
gotest .Args = append (gotest .Args , "-covermode=atomic" , "-cover" )
326
327
}
0 commit comments