"errors"
"flag"
"fmt"
+ "io/ioutil"
"log"
"os"
"os/exec"
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")
).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.