mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.typeparams] cmd/dist: add -G=3 test coverage
Change-Id: Icb85b93f0d98df722fffd70cf9a2554ac2098c60 Reviewed-on: https://go-review.googlesource.com/c/go/+/285052 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dan Scales <danscales@google.com> Reviewed-by: Robert Griesemer <gri@golang.org> Trust: Robert Griesemer <gri@golang.org> Trust: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
89ec17be9a
commit
0f054c5be0
1 changed files with 22 additions and 6 deletions
28
src/cmd/dist/test.go
vendored
28
src/cmd/dist/test.go
vendored
|
|
@ -309,14 +309,24 @@ var (
|
||||||
benchMatches []string
|
benchMatches []string
|
||||||
)
|
)
|
||||||
|
|
||||||
func (t *tester) registerStdTest(pkg string) {
|
func (t *tester) registerStdTest(pkg string, useG3 bool) {
|
||||||
testName := "go_test:" + pkg
|
heading := "Testing packages."
|
||||||
|
testPrefix := "go_test:"
|
||||||
|
gcflags := gogcflags
|
||||||
|
if useG3 {
|
||||||
|
heading = "Testing packages with -G=3."
|
||||||
|
testPrefix = "go_test_g3:"
|
||||||
|
gcflags += " -G=3"
|
||||||
|
}
|
||||||
|
|
||||||
|
testName := testPrefix + pkg
|
||||||
if t.runRx == nil || t.runRx.MatchString(testName) == t.runRxWant {
|
if t.runRx == nil || t.runRx.MatchString(testName) == t.runRxWant {
|
||||||
stdMatches = append(stdMatches, pkg)
|
stdMatches = append(stdMatches, pkg)
|
||||||
}
|
}
|
||||||
|
|
||||||
t.tests = append(t.tests, distTest{
|
t.tests = append(t.tests, distTest{
|
||||||
name: testName,
|
name: testName,
|
||||||
heading: "Testing packages.",
|
heading: heading,
|
||||||
fn: func(dt *distTest) error {
|
fn: func(dt *distTest) error {
|
||||||
if ranGoTest {
|
if ranGoTest {
|
||||||
return nil
|
return nil
|
||||||
|
|
@ -343,7 +353,7 @@ func (t *tester) registerStdTest(pkg string) {
|
||||||
"-short=" + short(),
|
"-short=" + short(),
|
||||||
t.tags(),
|
t.tags(),
|
||||||
t.timeout(timeoutSec),
|
t.timeout(timeoutSec),
|
||||||
"-gcflags=all=" + gogcflags,
|
"-gcflags=all=" + gcflags,
|
||||||
}
|
}
|
||||||
if t.race {
|
if t.race {
|
||||||
args = append(args, "-race")
|
args = append(args, "-race")
|
||||||
|
|
@ -408,7 +418,10 @@ func (t *tester) registerTests() {
|
||||||
if len(t.runNames) > 0 {
|
if len(t.runNames) > 0 {
|
||||||
for _, name := range t.runNames {
|
for _, name := range t.runNames {
|
||||||
if strings.HasPrefix(name, "go_test:") {
|
if strings.HasPrefix(name, "go_test:") {
|
||||||
t.registerStdTest(strings.TrimPrefix(name, "go_test:"))
|
t.registerStdTest(strings.TrimPrefix(name, "go_test:"), false)
|
||||||
|
}
|
||||||
|
if strings.HasPrefix(name, "go_test_g3:") {
|
||||||
|
t.registerStdTest(strings.TrimPrefix(name, "go_test_g3:"), true)
|
||||||
}
|
}
|
||||||
if strings.HasPrefix(name, "go_test_bench:") {
|
if strings.HasPrefix(name, "go_test_bench:") {
|
||||||
t.registerRaceBenchTest(strings.TrimPrefix(name, "go_test_bench:"))
|
t.registerRaceBenchTest(strings.TrimPrefix(name, "go_test_bench:"))
|
||||||
|
|
@ -432,7 +445,10 @@ func (t *tester) registerTests() {
|
||||||
}
|
}
|
||||||
pkgs := strings.Fields(string(all))
|
pkgs := strings.Fields(string(all))
|
||||||
for _, pkg := range pkgs {
|
for _, pkg := range pkgs {
|
||||||
t.registerStdTest(pkg)
|
t.registerStdTest(pkg, true)
|
||||||
|
}
|
||||||
|
for _, pkg := range pkgs {
|
||||||
|
t.registerStdTest(pkg, false)
|
||||||
}
|
}
|
||||||
if t.race {
|
if t.race {
|
||||||
for _, pkg := range pkgs {
|
for _, pkg := range pkgs {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue