@@ -281,15 +281,16 @@ func buildFlags(env build.Environment, staticLinking bool, buildTags []string) (
281281
282282func doTest (cmdline []string ) {
283283 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" )
292292 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" )
293294 )
294295 flag .CommandLine .Parse (cmdline )
295296
@@ -320,7 +321,7 @@ func doTest(cmdline []string) {
320321
321322 // Test a single package at a time. CI builders are slow
322323 // and some tests run into timeouts under load.
323- gotest .Args = append (gotest .Args , "-p" , "1" )
324+ gotest .Args = append (gotest .Args , "-p" , * threads )
324325 if * coverage {
325326 gotest .Args = append (gotest .Args , "-covermode=atomic" , "-cover" )
326327 }
0 commit comments