go/build: exclude cgo test from arm

go/build: include command output in error values
go/build: add syslist.go to .hgignore

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4550118
This commit is contained in:
Andrew Gerrand 2011-06-06 09:25:30 +10:00
parent b47a38dedb
commit eb72403bb6
3 changed files with 11 additions and 1 deletions

View file

@ -42,6 +42,7 @@ src/cmd/gc/yerr.h
src/cmd/goinstall/syslist.go
src/pkg/Make.deps
src/pkg/exp/ogle/ogle
src/pkg/go/build/syslist.go
src/pkg/os/signal/unix.go
src/pkg/runtime/*/asm.h
src/pkg/runtime/goc2c

View file

@ -6,6 +6,7 @@
package build
import (
"bytes"
"exec"
"fmt"
"os"
@ -79,8 +80,11 @@ func (c *Cmd) String() string {
}
func (c *Cmd) Run(dir string) os.Error {
out := new(bytes.Buffer)
cmd := exec.Command(c.Args[0], c.Args[1:]...)
cmd.Dir = dir
cmd.Stdout = out
cmd.Stderr = out
if c.Stdout != "" {
f, err := os.Create(filepath.Join(dir, c.Stdout))
if err != nil {
@ -90,7 +94,7 @@ func (c *Cmd) Run(dir string) os.Error {
cmd.Stdout = f
}
if err := cmd.Run(); err != nil {
return fmt.Errorf("command %q: %v", c, err)
return fmt.Errorf("command %q: %v\n%v", c, err, out)
}
return nil
}

View file

@ -8,6 +8,7 @@ import (
"os"
"path/filepath"
"runtime"
"strings"
"testing"
)
@ -24,6 +25,10 @@ func TestBuild(t *testing.T) {
t.Fatal(err)
}
for _, d := range buildDirs {
if runtime.GOARCH == "arm" && strings.Contains(d, "/cgo") {
// no cgo for arm, yet.
continue
}
dir := filepath.Join(runtime.GOROOT(), "src", d)
testBuild(t, dir, out)
}