From f41378e22578db38bb15009c50e3e05f7f9c4743 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 21 Dec 2015 13:49:12 -0500 Subject: [PATCH] cmd/dist: run limited tests in race and libgcc=none modes Mostly we just care that the test binaries link and start up. No need to run the full test suites. Takes 12% off my all.bash run time. For #10571. Change-Id: I01af618f3d51deb841ea638424e1389a2df7d746 Reviewed-on: https://go-review.googlesource.com/18086 Reviewed-by: Brad Fitzpatrick Reviewed-by: Ian Lance Taylor Run-TryBot: Russ Cox --- src/cmd/dist/test.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index fc08cf7e694d29..9ac01616535a0d 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -386,11 +386,15 @@ func (t *tester) registerTests() { } pkg := pkg + var run string + if pkg == "net" { + run = "TestTCPStress" + } t.tests = append(t.tests, distTest{ name: "nolibgcc:" + pkg, heading: "Testing without libgcc.", fn: func() error { - return t.dirCmd("src", "go", "test", "-short", "-ldflags=-linkmode=internal -libgcc=none", t.tags(), pkg).Run() + return t.dirCmd("src", "go", "test", "-short", "-ldflags=-linkmode=internal -libgcc=none", t.tags(), pkg, "-run="+run).Run() }, }) } @@ -869,7 +873,7 @@ func (t *tester) raceTest() error { if err := t.dirCmd("src", "go", "test", "-race", "-run=Output", "runtime/race").Run(); err != nil { return err } - if err := t.dirCmd("src", "go", "test", "-race", "-short", "flag", "os/exec").Run(); err != nil { + if err := t.dirCmd("src", "go", "test", "-race", "-short", "-run=TestParse|TestEcho", "flag", "os/exec").Run(); err != nil { return err } if t.cgoEnabled { @@ -882,7 +886,7 @@ func (t *tester) raceTest() error { } if t.extLink() { // Test with external linking; see issue 9133. - if err := t.dirCmd("src", "go", "test", "-race", "-short", "-ldflags=-linkmode=external", "flag", "os/exec").Run(); err != nil { + if err := t.dirCmd("src", "go", "test", "-race", "-short", "-ldflags=-linkmode=external", "-run=TestParse|TestEcho", "flag", "os/exec").Run(); err != nil { return err } }