summaryrefslogtreecommitdiff
path: root/src/nacltest.bash
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-05-20 12:10:19 -0400
committerRuss Cox <rsc@golang.org>2014-05-20 12:10:19 -0400
commit098ea4458409e3dcdd22fe8d8bf60458c77bff92 (patch)
tree6fe56f650994801a51db4a1afde9cbc13fcd796f /src/nacltest.bash
parent20b83c2f8fee714eca0e3a80dbeebb4da8a377f6 (diff)
downloadgo-098ea4458409e3dcdd22fe8d8bf60458c77bff92.tar.gz
build: make nacl pass
Add nacl.bash, the NaCl version of all.bash. It's a separate script because it builds a variant of package syscall with a large zip file embedded in it, containing all the input files needed for tests. Disable various tests new since the last round, mostly the ones using os/exec. Fixes issue 7945. LGTM=dave R=golang-codereviews, remyoudompheng, dave, bradfitz CC=golang-codereviews https://codereview.appspot.com/100590044
Diffstat (limited to 'src/nacltest.bash')
-rw-r--r--src/nacltest.bash50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/nacltest.bash b/src/nacltest.bash
new file mode 100644
index 000000000..e53f0114b
--- /dev/null
+++ b/src/nacltest.bash
@@ -0,0 +1,50 @@
+#!/bin/bash
+# Copyright 2014 The Go Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
+
+# For testing Native Client on builders or locally.
+# Builds a test file system and embeds it into package syscall
+# in every generated binary.
+#
+# Assumes that sel_ldr binaries are in $PATH; see ../misc/nacl/README.
+
+set -e
+ulimit -c 0
+
+# Check GOARCH.
+naclGOARCH=${GOARCH:-386}
+case "$naclGOARCH" in
+amd64p32)
+ if ! which sel_ldr_x86_64 >/dev/null; then
+ echo 'cannot find sel_ldr_x86_64' 1>&2
+ exit 1
+ fi
+ ;;
+386)
+ if ! which sel_ldr_x86_32 >/dev/null; then
+ echo 'cannot find sel_ldr_x86_32' 1>&2
+ exit 1
+ fi
+ ;;
+*)
+ echo 'unsupported $GOARCH for nacl: '"$naclGOARCH" 1>&2
+ exit 1
+esac
+
+# Run host build to get toolchain for running zip generator.
+unset GOOS GOARCH
+if [ ! -f make.bash ]; then
+ echo 'nacl.bash must be run from $GOROOT/src' 1>&2
+ exit 1
+fi
+GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH ./make.bash
+
+# Build zip file embedded in package syscall.
+gobin=${GOBIN:-$(pwd)/../bin}
+rm -f pkg/syscall/fstest_nacl.go
+GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH $gobin/go run ../misc/nacl/mkzip.go -p syscall -r .. ../misc/nacl/testzip.proto pkg/syscall/fstest_nacl.go
+
+# Run standard build and tests.
+export PATH=$(pwd)/../misc/nacl:$PATH
+GOOS=nacl GOARCH=$naclGOARCH ./all.bash --no-clean