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
|
|
|
|
;;
|
|
|
|
*)
|
2008-06-08 18:29:57 -06:00
|
|
|
export A=6
|
|
|
|
echo 1>&2 run: assuming amd64
|
2008-06-06 13:57:00 -06:00
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
|
|
|
|
export G=${A}g
|
|
|
|
export L=${A}l
|
|
|
|
|
|
|
|
failed=0
|
|
|
|
|
2008-06-06 17:56:18 -06:00
|
|
|
for dir in . ken 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
|
2008-06-06 16:08:24 -06:00
|
|
|
echo
|
2008-06-06 15:27:34 -06:00
|
|
|
echo '===========' $i
|
|
|
|
export F=$(basename $i .go)
|
|
|
|
export D=$dir
|
|
|
|
sed -n '1,/[^/]/p' $i | sed 's@//@@; $d' > /tmp/$USER.$$.gotest
|
|
|
|
if ! sh /tmp/$USER.$$.gotest
|
|
|
|
then
|
|
|
|
echo >&2 fail: $i
|
|
|
|
fi
|
|
|
|
done
|
2008-06-26 18:08:39 -06:00
|
|
|
done > 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-06-06 14:32:59 -06:00
|
|
|
rm -f /tmp/$USER.$$.gotest *.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
|