From 1536c2e0f6f2cf0b42b8f4db329f969cabc8eabb Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Fri, 18 Sep 2015 16:39:35 +0000 Subject: [PATCH] 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 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/cmd/dist/test.go | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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. -- 2.48.1