@@ -705,45 +705,20 @@ func (t *tester) registerTests() {
705
705
706
706
// Runtime CPU tests.
707
707
if ! t .compileOnly && t .hasParallelism () {
708
- t .registerTest ("GOMAXPROCS=2 runtime -cpu=1 -quick" ,
709
- & goTest {
710
- variant : "cpu1" ,
711
- timeout : 300 * time .Second ,
712
- cpu : "1" ,
713
- short : true ,
714
- testFlags : []string {"-quick" },
715
- // We set GOMAXPROCS=2 in addition to -cpu=1,2,4 in order to test runtime bootstrap code,
716
- // creation of first goroutines and first garbage collections in the parallel setting.
717
- env : []string {"GOMAXPROCS=2" },
718
- pkg : "runtime" ,
719
- },
720
- )
721
- t .registerTest ("GOMAXPROCS=2 runtime -cpu=2 -quick" ,
722
- & goTest {
723
- variant : "cpu2" ,
724
- timeout : 300 * time .Second ,
725
- cpu : "2" ,
726
- short : true ,
727
- testFlags : []string {"-quick" },
728
- // We set GOMAXPROCS=2 in addition to -cpu=1,2,4 in order to test runtime bootstrap code,
729
- // creation of first goroutines and first garbage collections in the parallel setting.
730
- env : []string {"GOMAXPROCS=2" },
731
- pkg : "runtime" ,
732
- },
733
- )
734
- t .registerTest ("GOMAXPROCS=2 runtime -cpu=4 -quick" ,
735
- & goTest {
736
- variant : "cpu4" ,
737
- timeout : 300 * time .Second ,
738
- cpu : "4" ,
739
- short : true ,
740
- testFlags : []string {"-quick" },
741
- // We set GOMAXPROCS=2 in addition to -cpu=1,2,4 in order to test runtime bootstrap code,
742
- // creation of first goroutines and first garbage collections in the parallel setting.
743
- env : []string {"GOMAXPROCS=2" },
744
- pkg : "runtime" ,
745
- },
746
- )
708
+ for i := 1 ; i <= 4 ; i *= 2 {
709
+ t .registerTest (fmt .Sprintf ("GOMAXPROCS=2 runtime -cpu=%d -quick" , i ),
710
+ & goTest {
711
+ variant : "cpu" + strconv .Itoa (i ),
712
+ timeout : 300 * time .Second ,
713
+ cpu : strconv .Itoa (i ),
714
+ short : true ,
715
+ testFlags : []string {"-quick" },
716
+ // We set GOMAXPROCS=2 in addition to -cpu=1,2,4 in order to test runtime bootstrap code,
717
+ // creation of first goroutines and first garbage collections in the parallel setting.
718
+ env : []string {"GOMAXPROCS=2" },
719
+ pkg : "runtime" ,
720
+ })
721
+ }
747
722
}
748
723
749
724
// GOEXPERIMENT=rangefunc tests
0 commit comments