diff options
author | Rob Pike <r@golang.org> | 2008-08-08 10:57:23 -0700 |
---|---|---|
committer | Rob Pike <r@golang.org> | 2008-08-08 10:57:23 -0700 |
commit | 384949f8e96d70c8ba53bdedb7507010cf5fc1cb (patch) | |
tree | 30ee014a93908db19df3b6e34f441d9389bcd039 /test/run | |
parent | 1773aa7be53f876dde3548b5698ee19675dc81fb (diff) | |
download | go-384949f8e96d70c8ba53bdedb7507010cf5fc1cb.tar.gz |
fix a couple of tests that had shell errors
clean up the golden file a bit to have less meaningless content and be more robust to spurious diffs.
now there is output only for tests that produce output or failure.
R=gri
OCL=14005
CL=14005
Diffstat (limited to 'test/run')
-rwxr-xr-x | test/run | 26 |
1 files changed, 20 insertions, 6 deletions
@@ -18,28 +18,42 @@ export L=${A}l failed=0 +# don't use $$ in file names to avoid spurious diffs +RUNFILE=/tmp/gorun-$USER +TMP1FILE=/tmp/gotest1-$USER +TMP2FILE=/tmp/gotest2-$USER + for dir in . ken chan bugs fixedbugs do for i in $dir/*.go do - echo - 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 + sed -n '1,/[^/]/p' $i | sed 's@//@@; $d' > $RUNFILE + if ! sh $RUNFILE >$TMP1FILE 2>$TMP2FILE then + echo + echo "===========" $i + cat $TMP1FILE + cat $TMP2FILE echo >&2 fail: $i + elif test -s $TMP1FILE + then + echo + echo "===========" $i + cat $TMP1FILE + cat $TMP2FILE fi done done | # clean up some stack noise - egrep -v '^(r[0-9a-z]+|[cfg]s) +0x' > run.out + egrep -v '^(r[0-9a-z]+|[cfg]s) +0x' | + sed '/tmp.*Bus error/s/.*Bus/Bus/; /tmp.*Trace.BPT/s/.*Trace/Trace/' > run.out case $failed in 1) echo FAIL esac -rm -f /tmp/$USER.$$.gotest *.6 6.out +rm -f $RUNFILE $TMP1FILE $TMP2FILE *.6 6.out if ! diff run.out golden.out then failed=1 |