Skip to content

Commit 8118be6

Browse files
n
Change-Id: I48401c6ef1e05e40e1f9abacc048861fad21dfca
1 parent 78be88c commit 8118be6

File tree

1 file changed

+14
-39
lines changed

1 file changed

+14
-39
lines changed

src/cmd/dist/test.go

+14-39
Original file line numberDiff line numberDiff line change
@@ -705,45 +705,20 @@ func (t *tester) registerTests() {
705705

706706
// Runtime CPU tests.
707707
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+
}
747722
}
748723

749724
// GOEXPERIMENT=rangefunc tests

0 commit comments

Comments
 (0)