diff options
| author | Brad Fitzpatrick <bradfitz@golang.org> | 2015-09-18 16:39:35 +0000 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2015-09-18 18:32:56 +0000 |
| commit | 1536c2e0f6f2cf0b42b8f4db329f969cabc8eabb (patch) | |
| tree | 3996090883d1eddb91952d062b097a89a767595c /src | |
| parent | 49065cbfe41877747f4e0bb67e2dd0833ec01b7a (diff) | |
| download | go-1536c2e0f6f2cf0b42b8f4db329f969cabc8eabb.tar.xz | |
cmd/dist: shard shootout test units
Instead of a 10 second test unit, make it 13 sub-second ones. This
takes advantage of multiple builders better.
Fixes #12623
Change-Id: I3fb2eb02f899f25749e34b546b9d41b742a746cd
Reviewed-on: https://go-review.googlesource.com/14738
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/dist/test.go | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index 510dc30f94..fa1a5e67d6 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -9,6 +9,7 @@ import ( "errors" "flag" "fmt" + "io/ioutil" "log" "os" "os/exec" @@ -449,7 +450,9 @@ func (t *tester) registerTests() { t.registerTest("doc_progs", "../doc/progs", "time", "go", "run", "run.go") t.registerTest("wiki", "../doc/articles/wiki", "./test.bash") t.registerTest("codewalk", "../doc/codewalk", "time", "./run") - t.registerTest("shootout", "../test/bench/shootout", "time", "./timing.sh", "-test") + for _, name := range t.shootoutTests() { + t.registerTest("shootout:"+name, "../test/bench/shootout", "time", "./timing.sh", "-test", name) + } } if t.goos != "android" && !t.iOS() { t.registerTest("bench_go1", "../test/bench/go1", "go", "test") @@ -847,6 +850,18 @@ func (t *tester) testDirTest(shard, shards int) error { ).Run() } +func (t *tester) shootoutTests() []string { + sh, err := ioutil.ReadFile(filepath.Join(t.goroot, "test", "bench", "shootout", "timing.sh")) + if err != nil { + log.Fatal(err) + } + m := regexp.MustCompile(`(?m)^\s+run="([\w+ ]+)"\s*$`).FindSubmatch(sh) + if m == nil { + log.Fatal("failed to find run=\"...\" line in test/bench/shootout/timing.sh") + } + return strings.Fields(string(m[1])) +} + // mergeEnvLists merges the two environment lists such that // variables with the same name in "in" replace those in "out". // out may be mutated. |
