2008-06-06 13:57:00 -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.
|
|
|
|
|
|
|
|
case X"$GOARCH" in
|
|
|
|
Xamd64)
|
|
|
|
export A=6
|
|
|
|
;;
|
2009-05-31 13:35:11 -06:00
|
|
|
X386)
|
|
|
|
export A=8
|
|
|
|
;;
|
|
|
|
Xarm)
|
|
|
|
export A=5
|
|
|
|
;;
|
2008-06-06 13:57:00 -06:00
|
|
|
*)
|
2009-05-31 13:35:11 -06:00
|
|
|
echo 1>&2 run: unsupported '$GOARCH'
|
2008-06-06 13:57:00 -06:00
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
|
|
|
|
export G=${A}g
|
|
|
|
export L=${A}l
|
2008-09-22 14:47:53 -06:00
|
|
|
export GOTRACEBACK=0
|
2008-06-06 13:57:00 -06:00
|
|
|
|
|
|
|
failed=0
|
|
|
|
|
2008-09-19 15:39:49 -06:00
|
|
|
PATH=/bin:/usr/bin:$HOME/bin:`pwd`
|
|
|
|
|
2009-06-17 14:21:01 -06:00
|
|
|
RUNFILE=/tmp/gorun-$$-$USER
|
|
|
|
TMP1FILE=/tmp/gotest1-$$-$USER
|
|
|
|
TMP2FILE=/tmp/gotest2-$$-$USER
|
2008-08-08 11:57:23 -06:00
|
|
|
|
2008-09-08 16:22:45 -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
|
|
|
|
|
2009-05-21 14:46:20 -06:00
|
|
|
for dir in . ken chan interface bugs fixedbugs
|
2008-06-06 13:57:00 -06:00
|
|
|
do
|
2008-06-06 15:27:34 -06:00
|
|
|
for i in $dir/*.go
|
|
|
|
do
|
|
|
|
export F=$(basename $i .go)
|
|
|
|
export D=$dir
|
2009-05-31 13:35:11 -06:00
|
|
|
sed '/^\/\//!q' $i | sed 's@//@@; $d' > $RUNFILE
|
2008-08-08 11:57:23 -06:00
|
|
|
if ! sh $RUNFILE >$TMP1FILE 2>$TMP2FILE
|
2008-06-06 15:27:34 -06:00
|
|
|
then
|
2008-08-08 11:57:23 -06:00
|
|
|
echo
|
|
|
|
echo "===========" $i
|
|
|
|
cat $TMP1FILE
|
|
|
|
cat $TMP2FILE
|
2008-06-06 15:27:34 -06:00
|
|
|
echo >&2 fail: $i
|
2008-11-17 13:44:22 -07:00
|
|
|
elif test -s $TMP1FILE || test -s $TMP2FILE
|
2008-08-08 11:57:23 -06:00
|
|
|
then
|
|
|
|
echo
|
|
|
|
echo "===========" $i
|
|
|
|
cat $TMP1FILE
|
|
|
|
cat $TMP2FILE
|
2008-11-17 13:44:22 -07:00
|
|
|
elif [ $dir = "bugs" ]
|
|
|
|
then
|
|
|
|
echo $i succeeded with no output.
|
2008-06-06 15:27:34 -06:00
|
|
|
fi
|
|
|
|
done
|
2008-07-07 11:03:10 -06:00
|
|
|
done | # clean up some stack noise
|
2008-08-08 11:57:23 -06:00
|
|
|
egrep -v '^(r[0-9a-z]+|[cfg]s) +0x' |
|
2008-09-02 15:26:59 -06:00
|
|
|
sed '/tmp.*Bus error/s/.*Bus/Bus/; /tmp.*Trace.BPT/s/.*Trace/Trace/
|
|
|
|
s!'$RUNFILE'!$RUNFILE!g
|
2008-09-22 14:47:53 -06:00
|
|
|
s/ PC=0x[0-9a-f]*/ PC=xxx/
|
|
|
|
s/^pc: 0x[0-9a-f]*/pc: xxx/
|
|
|
|
/^Trace\/breakpoint trap/d
|
2009-06-05 11:59:37 -06:00
|
|
|
/^Trace\/BPT trap/d
|
2008-11-11 11:01:51 -07:00
|
|
|
/RUNFILE/ s/line 1: *[0-9]*/line 1: PID/
|
|
|
|
/^\$RUNFILE: line 1: PID Trace\/breakpoint trap/d' > run.out
|
2008-06-06 14:28:03 -06:00
|
|
|
|
2008-06-06 13:57:00 -06:00
|
|
|
case $failed in
|
|
|
|
1)
|
|
|
|
echo FAIL
|
|
|
|
esac
|
2008-08-08 11:57:23 -06:00
|
|
|
rm -f $RUNFILE $TMP1FILE $TMP2FILE *.6 6.out
|
2008-06-06 13:57:00 -06:00
|
|
|
if ! diff run.out golden.out
|
|
|
|
then
|
|
|
|
failed=1
|
|
|
|
fi
|
2008-06-06 14:38:16 -06:00
|
|
|
|
2008-06-06 17:56:18 -06:00
|
|
|
echo 2>&1 $(grep -c '^BUG' run.out) tests are behaving incorrectly
|
2008-06-06 14:38:16 -06:00
|
|
|
|
2008-06-06 13:57:00 -06:00
|
|
|
exit $failed
|