diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-01-17 12:40:45 +0100 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-01-17 12:40:45 +0100 |
commit | 3e45412327a2654a77944249962b3652e6142299 (patch) | |
tree | bc3bf69452afa055423cbe0c5cfa8ca357df6ccf /test/run | |
parent | c533680039762cacbc37db8dc7eed074c3e497be (diff) | |
download | golang-3e45412327a2654a77944249962b3652e6142299.tar.gz |
Imported Upstream version 2011.01.12upstream/2011.01.12
Diffstat (limited to 'test/run')
-rwxr-xr-x | test/run | 39 |
1 files changed, 31 insertions, 8 deletions
@@ -3,7 +3,8 @@ # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. -export E="" +eval $(gomake --no-print-directory -f ../src/Make.inc go-env) + case X"$GOARCH" in Xamd64) export A=6 @@ -13,7 +14,7 @@ X386) ;; Xarm) export A=5 - export E=${GORUN:-qemu-arm -cpu cortex-a8} + export E="$GORUN" ;; *) echo 1>&2 run: unsupported '$GOARCH' @@ -33,7 +34,7 @@ unset GREP_OPTIONS # in case user has a non-standard set failed=0 -PATH=/bin:/usr/bin:/usr/local/bin:${GOBIN:-$HOME/bin}:`pwd` +PATH=/bin:/usr/bin:/usr/local/bin:${GOBIN:-$GOROOT/bin}:`pwd` RUNFILE=/tmp/gorun-$$-$USER TMP1FILE=/tmp/gotest1-$$-$USER @@ -48,26 +49,47 @@ ulimit -c 0 true >pass.out >times.out +exclude=false # exclude nothing +golden=golden.out + +filterout() { + grep '^'"$2"'$' $1 >/dev/null +} + for dir in . ken chan interface nilptr syntax fixedbugs bugs do echo echo '==' $dir'/' for i in $(ls $dir/*.go 2>/dev/null) - do + do ( + if $exclude $i; then + exit 0 # continues for loop + fi 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 &|g' >$RUNFILE if ! { time -p bash -c "bash $RUNFILE >$TMP1FILE 2>&1" ; } 2>$TMP2FILE then echo echo "===========" $i cat $TMP1FILE echo >&2 fail: $i + echo "# $i # fail" >>pass.out elif test -s $TMP1FILE then echo echo "===========" $i cat $TMP1FILE + if grep -q '^BUG' $TMP1FILE + then + if [ $dir != bugs ] + then + echo >&2 bug: $i + fi + echo "# $i # fail, BUG" >>pass.out + else + echo $i >>pass.out + fi elif [ $dir = "bugs" ] then echo $i succeeded with no output. @@ -75,7 +97,7 @@ do echo $i >>pass.out fi echo $(awk 'NR==1{print $2}' $TMP2FILE) $D/$F >>times.out - done + ) done 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/ @@ -87,12 +109,13 @@ done | # clean up some stack noise /^Trace\/BPT trap/d /RUNFILE/ s/line 1: *[0-9]*/line 1: PID/ /^\$RUNFILE: line 1: PID Trace\/breakpoint trap/d + /Fault in NaCl untrusted code/d /Segmentation fault/d /^qemu: uncaught target signal 11 (Segmentation fault) - exiting/d' > run.out -rm -f $RUNFILE $TMP1FILE $TMP2FILE *.$A $A.out +rm -f $RUNFILE $TMP1FILE $TMP2FILE *.$A *.a $A.out diffmsg="" -if ! diff run.out golden.out +if ! diff $golden run.out then diffmsg="; test output differs" failed=1 |