summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Gerrand <adg@golang.org>2011-06-06 09:25:30 +1000
committerAndrew Gerrand <adg@golang.org>2011-06-06 09:25:30 +1000
commit09a8cd9100ecd158c760f9a99df151576aae9844 (patch)
tree52238e779371cddf8a01155df16b70d11c8b1221
parent90e3bddde3de27c5914499d544ef5f59e82d15e2 (diff)
downloadgo-09a8cd9100ecd158c760f9a99df151576aae9844.tar.gz
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 http://codereview.appspot.com/4550118
-rw-r--r--.hgignore1
-rw-r--r--src/pkg/go/build/build.go6
-rw-r--r--src/pkg/go/build/build_test.go5
3 files changed, 11 insertions, 1 deletions
diff --git a/.hgignore b/.hgignore
index dd4fb5a04..f920966eb 100644
--- a/.hgignore
+++ b/.hgignore
@@ -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
diff --git a/src/pkg/go/build/build.go b/src/pkg/go/build/build.go
index 2d1795276..3cb8efe47 100644
--- a/src/pkg/go/build/build.go
+++ b/src/pkg/go/build/build.go
@@ -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
}
diff --git a/src/pkg/go/build/build_test.go b/src/pkg/go/build/build_test.go
index 790cdac3d..c543eddbd 100644
--- a/src/pkg/go/build/build_test.go
+++ b/src/pkg/go/build/build_test.go
@@ -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)
}