--- /dev/null
+#!/bin/bash
+# Copyright 2009 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.
+
+# TODO(rsc): delete in favor of all.bash once nacl support is complete
+
+set -e
+bash make.bash
+
+xcd() {
+ echo
+ echo --- cd $1
+ builtin cd $1
+}
+
+(xcd ../test
+./run-nacl
+) || exit $?
RET
// func RawSyscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr);
-TEXT syscall·RawSyscall(SB),7,$0
-TEXT syscall·Syscall(SB),7,$20
+TEXT syscall·RawSyscall(SB),7,$20
MOVL trap+0(FP), AX // syscall entry
MOVL a1+4(FP), BX
MOVL a2+8(FP), CX
exit 1
esac
+case X"$GOOS" in
+Xnacl)
+ export E="nacl"
+esac
+
export G=${A}g
export L=${A}l
export GOTRACEBACK=0
# on thresher, 3GB suffices to run the tests; with 2GB, peano fails.
ulimit -v 4000000
+true >pass.out
+
for dir in . ken chan interface fixedbugs bugs
do
echo
do
export F=$(basename $i .go)
export D=$dir
- sed '/^\/\//!q' $i | sed 's@//@@; $d' |sed 's|./\$A.out|$E &|' >$RUNFILE
+ sed '/^\/\//!q' $i | sed 's@//@@; $d' |sed 's|./\$A.out|$E &|' >$RUNFILE
if ! sh $RUNFILE >$TMP1FILE 2>$TMP2FILE
then
echo
elif [ $dir = "bugs" ]
then
echo $i succeeded with no output.
+ else
+ echo $i >>pass.out
fi
done
done | # clean up some stack noise
--- /dev/null
+#!/bin/sh
+# Copyright 2009 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.
+
+case X"$GOARCH" in
+X386)
+ export A=8
+ export E=nacl
+ ;;
+*)
+ echo 1>&2 run: unsupported '$GOARCH'
+ exit 1
+esac
+
+export G=${A}g
+export L=${A}l
+export GOTRACEBACK=0
+
+failed=0
+
+PATH=/bin:/usr/bin:/usr/local/bin:${GOBIN:-$HOME/bin}:`pwd`
+
+RUNFILE=/tmp/gorun-$$-$USER
+TMP1FILE=/tmp/gotest1-$$-$USER
+TMP2FILE=/tmp/gotest2-$$-$USER
+
+# don't run the machine out of memory: limit individual processes to 4GB.
+# on thresher, 3GB suffices to run the tests; with 2GB, peano fails.
+ulimit -v 4000000
+
+for i in $(cat nacl-pass.txt)
+do
+ export F=$(basename $i .go)
+ dir=$(dirname $i)
+ export D=$dir
+ sed '/^\/\//!q; s|//||g; s|./\$A.out|$E &|' $i >$RUNFILE
+ if ! sh $RUNFILE >$TMP1FILE 2>$TMP2FILE
+ then
+ echo
+ echo "===========" $i
+ cat $TMP1FILE
+ cat $TMP2FILE
+ echo >&2 fail: $i
+ elif test -s $TMP1FILE || test -s $TMP2FILE
+ then
+ echo
+ echo "===========" $i
+ cat $TMP1FILE
+ cat $TMP2FILE
+ elif [ $dir = "bugs" ]
+ then
+ echo $i succeeded with no output.
+ fi
+done | # clean up some stack noise
+ egrep -v '^(r[0-9a-z]+|[cfg]s) +0x' |
+ sed '/tmp.*Bus error/s/.*Bus/Bus/; /tmp.*Trace.BPT/s/.*Trace/Trace/
+ s!'$RUNFILE'!$RUNFILE!g
+ s/ PC=0x[0-9a-f]*/ PC=xxx/
+ s/^pc: 0x[0-9a-f]*/pc: xxx/
+ /^Trace\/breakpoint trap/d
+ /^Trace\/BPT trap/d
+ /RUNFILE/ s/line 1: *[0-9]*/line 1: PID/
+ /^\$RUNFILE: line 1: PID Trace\/breakpoint trap/d
+ /^qemu: uncaught target signal 11 (Segmentation fault) - exiting/d' > run.out
+
+case $failed in
+0)
+ echo PASS
+ ;;
+1)
+ echo FAIL
+esac
+rm -f $RUNFILE $TMP1FILE $TMP2FILE *.$A $A.out
+
+exit $failed