2009-09-18 20:09:29 -06:00
|
|
|
#!/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.
|
|
|
|
|
|
|
|
export E=""
|
|
|
|
case X"$GOARCH" in
|
|
|
|
Xamd64)
|
|
|
|
export A=6
|
|
|
|
;;
|
|
|
|
X386)
|
|
|
|
export A=8
|
|
|
|
;;
|
|
|
|
Xarm)
|
|
|
|
export A=5
|
2010-02-10 16:01:02 -07:00
|
|
|
export E="${GORUN:-qemu-arm -cpu cortex-a8}"
|
2009-09-18 20:09:29 -06:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo 1>&2 run: unsupported '$GOARCH'
|
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
|
|
|
|
export G=${A}g
|
|
|
|
export L=${A}l
|
|
|
|
export GOTRACEBACK=0
|
|
|
|
|
|
|
|
PATH=/bin:/usr/bin:/usr/local/bin:${GOBIN:-$HOME/bin}:`pwd`
|
|
|
|
|
|
|
|
RUNFILE=/tmp/gorun-$$-$USER
|
|
|
|
TMP1FILE=/tmp/gotest1-$$-$USER
|
|
|
|
TMP2FILE=/tmp/gotest2-$$-$USER
|
2009-10-05 22:51:34 -06:00
|
|
|
FAILEDFILE=/tmp/gotest3-$$-$USER
|
2009-09-18 20:09:29 -06:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2010-04-16 04:06:45 -06:00
|
|
|
# no core files please
|
|
|
|
ulimit -c 0
|
|
|
|
|
|
|
|
true >times.out
|
|
|
|
|
|
|
|
# TODO(kaib): figure out why the GC makes things so utterly slow.
|
|
|
|
export GOGC=off
|
|
|
|
export GOTRACEBACK=0
|
2009-09-18 20:09:29 -06:00
|
|
|
|
2010-04-06 18:56:48 -06:00
|
|
|
for i in $(cat arm-pass.txt | sed 's/#.*//')
|
2009-09-18 20:09:29 -06:00
|
|
|
do
|
|
|
|
export F=$(basename $i .go)
|
|
|
|
dir=$(dirname $i)
|
|
|
|
export D=$dir
|
2009-09-22 14:13:23 -06:00
|
|
|
sed '/^\/\//!q' $i | sed 's@//@@; $d' |sed 's|./\$A.out|$E &|' >$RUNFILE
|
2010-04-16 04:06:45 -06:00
|
|
|
if ! { time -p bash -c "bash $RUNFILE >$TMP1FILE 2>&1" ; } 2>$TMP2FILE
|
2009-09-18 20:09:29 -06:00
|
|
|
then
|
|
|
|
echo
|
|
|
|
echo "===========" $i
|
|
|
|
cat $TMP1FILE
|
|
|
|
echo >&2 fail: $i
|
2009-10-05 22:51:34 -06:00
|
|
|
touch $FAILEDFILE
|
2010-02-10 16:01:02 -07:00
|
|
|
elif test -s $TMP1FILE
|
2009-09-18 20:09:29 -06:00
|
|
|
then
|
|
|
|
echo
|
|
|
|
echo "===========" $i
|
|
|
|
cat $TMP1FILE
|
|
|
|
elif [ $dir = "bugs" ]
|
|
|
|
then
|
|
|
|
echo $i succeeded with no output.
|
|
|
|
fi
|
2010-04-16 04:06:45 -06:00
|
|
|
echo $(awk 'NR==1{print $2}' $TMP2FILE) $D/$F >>times.out
|
2009-09-18 20:09:29 -06:00
|
|
|
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
|
2010-02-10 16:01:02 -07:00
|
|
|
s!'$GOROOT'!$GOROOT!g
|
2010-04-05 13:51:09 -06:00
|
|
|
/Segmentation fault/d
|
2009-09-18 20:09:29 -06:00
|
|
|
/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
|
|
|
|
|
2009-10-05 22:51:34 -06:00
|
|
|
failed=0
|
2010-02-10 16:01:02 -07:00
|
|
|
rm -f $RUNFILE $TMP1FILE $TMP2FILE *.$A $A.out
|
|
|
|
diffmsg=""
|
2010-04-16 04:06:45 -06:00
|
|
|
if ! diff -b run.out golden-arm.out
|
2010-02-10 16:01:02 -07:00
|
|
|
then
|
|
|
|
diffmsg="; test output differs"
|
2009-10-05 22:51:34 -06:00
|
|
|
failed=1
|
|
|
|
fi
|
|
|
|
|
2010-05-03 14:24:26 -06:00
|
|
|
notinbugs=$(sed '/== bugs/q' run.out | grep -c '^BUG')
|
|
|
|
inbugs=$(sed '1,/== bugs/d' run.out | grep -c '^BUG')
|
2010-02-10 16:01:02 -07:00
|
|
|
|
|
|
|
echo 2>&1 $inbugs known bugs';' $notinbugs unexpected bugs$diffmsg
|
|
|
|
|
|
|
|
if [ "$failed" != "0" ]; then
|
|
|
|
echo FAILED
|
|
|
|
fi
|
2009-09-18 20:09:29 -06:00
|
|
|
|
|
|
|
exit $failed
|