Commit 1536c2e0 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

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/14738Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 49065cbf
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment