For each version in `<versionlist>`, it will attempt to check out a
tree based on `test/213/$v` and do a build. If the branch does not
exist it will throw an error. (If no `<versionlist>` is supplied, it
-defaults to `all`.)
+defaults to `all`.) Output will be redirected to `build.log`.
`xsatool 213 test [<versionlist>]`
import (
"fmt"
"io"
- "io/ioutil"
"os"
"os/exec"
"path"
// Configure
os.Chdir(xenrepo.GetPath())
- out, err := exec.Command("./configure").CombinedOutput()
+ logfile, err := os.Create("build.log")
+ if err != nil {
+ return fmt.Errorf("Opening log file: %v", err)
+ }
+ defer logfile.Close()
+
+ cmd := exec.Command("./configure")
+ cmd.Stdout = logfile
+ cmd.Stderr = logfile
+ err = cmd.Run()
if err != nil {
- ioutil.WriteFile("build.log", out, 0666)
return fmt.Errorf("Configuring xen: %v\n", err)
}
// Build
- out, err = exec.Command("make", "-j", "8").CombinedOutput()
+ cmd = exec.Command("make", "-j", "8")
+ cmd.Stdout = logfile
+ cmd.Stderr = logfile
+ err = cmd.Run()
if err != nil {
- ioutil.WriteFile("build.log", out, 0666)
return fmt.Errorf("Building: %v\n", err)
}
- out, err = xenrepo.Checkout("master")
+ _, err = xenrepo.Checkout("master")
if err != nil {
return
}
- out, err = xenrepo.DeleteBranch(tmpBranch)
+ _, err = xenrepo.DeleteBranch(tmpBranch)
if err != nil {
return
}