tests/qemu-iotests: re-format output to for make check-block
[qemu/ar7.git] / tests / qemu-iotests / check
blob95162c6cf900c0f3d4ff52a65c6affed5aaa760c
1 #!/usr/bin/env bash
3 # Copyright (C) 2009 Red Hat, Inc.
4 # Copyright (c) 2000-2002,2006 Silicon Graphics, Inc. All Rights Reserved.
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation.
10 # This program is distributed in the hope that it would be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 # Control script for QA
22 status=0
23 needwrap=true
24 try=0
25 n_bad=0
26 bad=""
27 notrun=""
28 casenotrun=""
29 interrupt=true
30 makecheck=false
32 _init_error()
34 echo "check: $1" >&2
35 exit 1
38 if [ -L "$0" ]
39 then
40 # called from the build tree
41 source_iotests=$(dirname "$(readlink "$0")")
42 if [ -z "$source_iotests" ]
43 then
44 _init_error "failed to obtain source tree name from check symlink"
46 source_iotests=$(cd "$source_iotests"; pwd) || _init_error "failed to enter source tree"
47 build_iotests=$PWD
48 else
49 # called from the source tree
50 source_iotests=$PWD
51 # this may be an in-tree build (note that in the following code we may not
52 # assume that it truly is and have to test whether the build results
53 # actually exist)
54 build_iotests=$PWD
57 build_root="$build_iotests/../.."
59 # we need common.env
60 if ! . "$build_iotests/common.env"
61 then
62 _init_error "failed to source common.env (make sure the qemu-iotests are run from tests/qemu-iotests in the build tree)"
65 # we need common.config
66 if ! . "$source_iotests/common.config"
67 then
68 _init_error "failed to source common.config"
71 _full_imgfmt_details()
73 if [ -n "$IMGOPTS" ]; then
74 echo "$IMGFMT ($IMGOPTS)"
75 else
76 echo "$IMGFMT"
80 _full_platform_details()
82 os=$(uname -s)
83 host=$(hostname -s)
84 kernel=$(uname -r)
85 platform=$(uname -m)
86 echo "$os/$platform $host $kernel"
89 _full_env_details()
91 cat <<EOF
92 QEMU -- "$QEMU_PROG" $QEMU_OPTIONS
93 QEMU_IMG -- "$QEMU_IMG_PROG" $QEMU_IMG_OPTIONS
94 QEMU_IO -- "$QEMU_IO_PROG" $QEMU_IO_OPTIONS
95 QEMU_NBD -- "$QEMU_NBD_PROG" $QEMU_NBD_OPTIONS
96 IMGFMT -- $FULL_IMGFMT_DETAILS
97 IMGPROTO -- $IMGPROTO
98 PLATFORM -- $FULL_HOST_DETAILS
99 TEST_DIR -- $TEST_DIR
100 SOCKET_SCM_HELPER -- $SOCKET_SCM_HELPER
105 # $1 = prog to look for
106 set_prog_path()
108 p=$(command -v $1 2> /dev/null)
109 if [ -n "$p" -a -x "$p" ]; then
110 type -p "$p"
111 else
112 return 1
116 if [ -z "$TEST_DIR" ]; then
117 TEST_DIR=$PWD/scratch
120 if [ ! -e "$TEST_DIR" ]; then
121 mkdir "$TEST_DIR"
124 diff="diff -u"
125 verbose=false
126 debug=false
127 group=false
128 xgroup=false
129 imgopts=false
130 showme=false
131 sortme=false
132 expunge=true
133 have_test_arg=false
134 cachemode=false
136 tmp="${TEST_DIR}"/$$
137 rm -f $tmp.list $tmp.tmp $tmp.sed
139 export IMGFMT=raw
140 export IMGFMT_GENERIC=true
141 export IMGPROTO=file
142 export IMGOPTS=""
143 export CACHEMODE="writeback"
144 export QEMU_IO_OPTIONS=""
145 export QEMU_IO_OPTIONS_NO_FMT=""
146 export CACHEMODE_IS_DEFAULT=true
147 export VALGRIND_QEMU=
148 export IMGKEYSECRET=
149 export IMGOPTSSYNTAX=false
151 # Save current tty settings, since an aborting qemu call may leave things
152 # screwed up
153 STTY_RESTORE=
154 if test -t 0; then
155 STTY_RESTORE=$(stty -g)
158 for r
161 if $group
162 then
163 # arg after -g
164 group_list=$(sed -n <"$source_iotests/group" -e 's/$/ /' -e "/^[0-9][0-9][0-9].* $r /"'{
165 s/ .*//p
167 if [ -z "$group_list" ]
168 then
169 echo "Group \"$r\" is empty or not defined?"
170 exit 1
172 [ ! -s $tmp.list ] && touch $tmp.list
173 for t in $group_list
175 if grep -s "^$t\$" $tmp.list >/dev/null
176 then
178 else
179 echo "$t" >>$tmp.list
181 done
182 group=false
183 continue
185 elif $xgroup
186 then
187 # arg after -x
188 # Populate $tmp.list with all tests
189 awk '/^[0-9]{3,}/ {print $1}' "${source_iotests}/group" > $tmp.list 2>/dev/null
190 group_list=$(sed -n <"$source_iotests/group" -e 's/$/ /' -e "/^[0-9][0-9][0-9].* $r /"'{
191 s/ .*//p
193 if [ -z "$group_list" ]
194 then
195 echo "Group \"$r\" is empty or not defined?"
196 exit 1
198 numsed=0
199 rm -f $tmp.sed
200 for t in $group_list
202 if [ $numsed -gt 100 ]
203 then
204 sed -f $tmp.sed <$tmp.list >$tmp.tmp
205 mv $tmp.tmp $tmp.list
206 numsed=0
207 rm -f $tmp.sed
209 echo "/^$t\$/d" >>$tmp.sed
210 numsed=$(expr $numsed + 1)
211 done
212 sed -f $tmp.sed <$tmp.list >$tmp.tmp
213 mv $tmp.tmp $tmp.list
214 xgroup=false
215 continue
217 elif $imgopts
218 then
219 IMGOPTS="$r"
220 imgopts=false
221 continue
222 elif $cachemode
223 then
224 CACHEMODE="$r"
225 CACHEMODE_IS_DEFAULT=false
226 cachemode=false
227 continue
230 xpand=true
231 case "$r"
234 -\? | -h | --help) # usage
235 echo "Usage: $0 [options] [testlist]"'
237 common options
238 -v verbose
239 -d debug
241 image format options
242 -raw test raw (default)
243 -bochs test bochs
244 -cloop test cloop
245 -parallels test parallels
246 -qcow test qcow
247 -qcow2 test qcow2
248 -qed test qed
249 -vdi test vdi
250 -vpc test vpc
251 -vhdx test vhdx
252 -vmdk test vmdk
253 -luks test luks
254 -dmg test dmg
256 image protocol options
257 -file test file (default)
258 -rbd test rbd
259 -sheepdog test sheepdog
260 -nbd test nbd
261 -ssh test ssh
262 -nfs test nfs
263 -vxhs test vxhs
265 other options
266 -xdiff graphical mode diff
267 -nocache use O_DIRECT on backing file
268 -misalign misalign memory allocations
269 -n show me, do not run tests
270 -o options -o options to pass to qemu-img create/convert
271 -c mode cache mode
272 -makecheck pretty print output for make check
274 testlist options
275 -g group[,group...] include tests from these groups
276 -x group[,group...] exclude tests from these groups
277 NNN include test NNN
278 NNN-NNN include test range (eg. 012-021)
280 exit 0
283 -raw)
284 IMGFMT=raw
285 xpand=false
288 -bochs)
289 IMGFMT=bochs
290 IMGFMT_GENERIC=false
291 xpand=false
294 -cloop)
295 IMGFMT=cloop
296 IMGFMT_GENERIC=false
297 xpand=false
300 -parallels)
301 IMGFMT=parallels
302 xpand=false
305 -qcow)
306 IMGFMT=qcow
307 xpand=false
310 -qcow2)
311 IMGFMT=qcow2
312 xpand=false
315 -luks)
316 IMGOPTSSYNTAX=true
317 IMGFMT=luks
318 IMGKEYSECRET=123456
319 xpand=false
322 -dmg)
323 IMGFMT=dmg
324 IMGFMT_GENERIC=false
325 xpand=false
328 -qed)
329 IMGFMT=qed
330 xpand=false
333 -vdi)
334 IMGFMT=vdi
335 xpand=false
338 -vmdk)
339 IMGFMT=vmdk
340 xpand=false
343 -vpc)
344 IMGFMT=vpc
345 xpand=false
348 -vhdx)
349 IMGFMT=vhdx
350 xpand=false
353 -file)
354 IMGPROTO=file
355 xpand=false
358 -rbd)
359 IMGPROTO=rbd
360 xpand=false
363 -sheepdog)
364 IMGPROTO=sheepdog
365 xpand=false
368 -nbd)
369 IMGPROTO=nbd
370 xpand=false
373 -vxhs)
374 IMGPROTO=vxhs
375 xpand=false
378 -ssh)
379 IMGPROTO=ssh
380 xpand=false
383 -nfs)
384 IMGPROTO=nfs
385 xpand=false
388 -nocache)
389 CACHEMODE="none"
390 CACHEMODE_IS_DEFAULT=false
391 xpand=false
394 -misalign)
395 QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --misalign"
396 xpand=false
399 -valgrind)
400 VALGRIND_QEMU='y'
401 xpand=false
404 -g) # -g group ... pick from group file
405 group=true
406 xpand=false
409 -xdiff) # graphical diff mode
410 xpand=false
412 if [ ! -z "$DISPLAY" ]
413 then
414 command -v xdiff >/dev/null 2>&1 && diff=xdiff
415 command -v gdiff >/dev/null 2>&1 && diff=gdiff
416 command -v tkdiff >/dev/null 2>&1 && diff=tkdiff
417 command -v xxdiff >/dev/null 2>&1 && diff=xxdiff
420 -makecheck) # makecheck friendly output
421 makecheck=true
422 xpand=false
424 -n) # show me, don't do it
425 showme=true
426 xpand=false
429 imgopts=true
430 xpand=false
433 cachemode=true
434 xpand=false
436 -T) # deprecated timestamp option
437 xpand=false
441 verbose=true
442 xpand=false
445 debug=true
446 xpand=false
448 -x) # -x group ... exclude from group file
449 xgroup=true
450 xpand=false
452 '[0-9][0-9][0-9] [0-9][0-9][0-9][0-9]')
453 echo "No tests?"
454 status=1
455 exit $status
458 [0-9]*-[0-9]*)
459 eval $(echo $r | sed -e 's/^/start=/' -e 's/-/ end=/')
462 [0-9]*-)
463 eval $(echo $r | sed -e 's/^/start=/' -e 's/-//')
464 end=$(echo [0-9][0-9][0-9] [0-9][0-9][0-9][0-9] | sed -e 's/\[0-9]//g' -e 's/ *$//' -e 's/.* //')
465 if [ -z "$end" ]
466 then
467 echo "No tests in range \"$r\"?"
468 status=1
469 exit $status
474 start=$r
475 end=$r
478 esac
480 # get rid of leading 0s as can be interpreted as octal
481 start=$(echo $start | sed 's/^0*//')
482 end=$(echo $end | sed 's/^0*//')
484 if $xpand
485 then
486 have_test_arg=true
487 awk </dev/null '
488 BEGIN { for (t='$start'; t<='$end'; t++) printf "%03d\n",t }' \
489 | while read id
491 if grep -s "^$id " "$source_iotests/group" >/dev/null
492 then
493 # in group file ... OK
494 echo $id >>$tmp.list
495 else
496 if [ -f expunged ] && $expunge && egrep "^$id([ ]|\$)" expunged >/dev/null
497 then
498 # expunged ... will be reported, but not run, later
499 echo $id >>$tmp.list
500 else
501 # oops
502 if [ "$start" == "$end" -a "$id" == "$end" ]
503 then
504 echo "$id - unknown test"
505 exit 1
506 else
507 echo "$id - unknown test, ignored"
511 done || exit 1
514 done
516 # Set qemu-io cache mode with $CACHEMODE we have
517 QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --cache $CACHEMODE"
519 QEMU_IO_OPTIONS_NO_FMT="$QEMU_IO_OPTIONS"
520 if [ "$IMGOPTSSYNTAX" != "true" ]; then
521 QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS -f $IMGFMT"
524 # Set default options for qemu-img create -o if they were not specified
525 if [ "$IMGFMT" == "qcow2" ] && ! (echo "$IMGOPTS" | grep "compat=" > /dev/null); then
526 IMGOPTS=$(_optstr_add "$IMGOPTS" "compat=1.1")
528 if [ "$IMGFMT" == "luks" ] && ! (echo "$IMGOPTS" | grep "iter-time=" > /dev/null); then
529 IMGOPTS=$(_optstr_add "$IMGOPTS" "iter-time=10")
532 if [ -z "$SAMPLE_IMG_DIR" ]; then
533 SAMPLE_IMG_DIR="$source_iotests/sample_images"
536 export TEST_DIR
537 export SAMPLE_IMG_DIR
539 if [ -s $tmp.list ]
540 then
541 # found some valid test numbers ... this is good
543 else
544 if $have_test_arg
545 then
546 # had test numbers, but none in group file ... do nothing
547 touch $tmp.list
548 else
549 # no test numbers, do everything from group file
550 sed -n -e '/^[0-9][0-9][0-9]*/s/[ ].*//p' <"$source_iotests/group" >$tmp.list
554 # should be sort -n, but this did not work for Linux when this
555 # was ported from IRIX
557 list=$(sort $tmp.list)
558 rm -f $tmp.list $tmp.tmp $tmp.sed
560 if [ -z "$QEMU_PROG" ]
561 then
562 if [ -x "$build_iotests/qemu" ]; then
563 export QEMU_PROG="$build_iotests/qemu"
564 elif [ -x "$build_root/${qemu_arch}-softmmu/qemu-system-${qemu_arch}" ]; then
565 export QEMU_PROG="$build_root/${qemu_arch}-softmmu/qemu-system-${qemu_arch}"
566 else
567 pushd "$build_root" > /dev/null
568 for binary in *-softmmu/qemu-system-*
570 if [ -x "$binary" ]
571 then
572 export QEMU_PROG="$build_root/$binary"
573 break
575 done
576 popd > /dev/null
577 [ "$QEMU_PROG" = "" ] && _init_error "qemu not found"
580 export QEMU_PROG="$(type -p "$QEMU_PROG")"
582 case "$QEMU_PROG" in
583 *qemu-system-arm|*qemu-system-aarch64)
584 export QEMU_OPTIONS="-nodefaults -machine virt,accel=qtest"
586 *qemu-system-tricore)
587 export QEMU_OPTIONS="-nodefaults -machine tricore_testboard,accel=qtest"
590 export QEMU_OPTIONS="-nodefaults -machine accel=qtest"
592 esac
594 if [ -z "$QEMU_IMG_PROG" ]; then
595 if [ -x "$build_iotests/qemu-img" ]; then
596 export QEMU_IMG_PROG="$build_iotests/qemu-img"
597 elif [ -x "$build_root/qemu-img" ]; then
598 export QEMU_IMG_PROG="$build_root/qemu-img"
599 else
600 _init_error "qemu-img not found"
603 export QEMU_IMG_PROG="$(type -p "$QEMU_IMG_PROG")"
605 if [ -z "$QEMU_IO_PROG" ]; then
606 if [ -x "$build_iotests/qemu-io" ]; then
607 export QEMU_IO_PROG="$build_iotests/qemu-io"
608 elif [ -x "$build_root/qemu-io" ]; then
609 export QEMU_IO_PROG="$build_root/qemu-io"
610 else
611 _init_error "qemu-io not found"
614 export QEMU_IO_PROG="$(type -p "$QEMU_IO_PROG")"
616 if [ -z $QEMU_NBD_PROG ]; then
617 if [ -x "$build_iotests/qemu-nbd" ]; then
618 export QEMU_NBD_PROG="$build_iotests/qemu-nbd"
619 elif [ -x "$build_root/qemu-nbd" ]; then
620 export QEMU_NBD_PROG="$build_root/qemu-nbd"
621 else
622 _init_error "qemu-nbd not found"
625 export QEMU_NBD_PROG="$(type -p "$QEMU_NBD_PROG")"
627 if [ -z "$QEMU_VXHS_PROG" ]; then
628 export QEMU_VXHS_PROG="$(set_prog_path qnio_server)"
631 if [ -x "$build_iotests/socket_scm_helper" ]
632 then
633 export SOCKET_SCM_HELPER="$build_iotests/socket_scm_helper"
636 default_machine=$($QEMU_PROG -machine help | sed -n '/(default)/ s/ .*//p')
637 default_alias_machine=$($QEMU_PROG -machine help | \
638 sed -n "/(alias of $default_machine)/ { s/ .*//p; q; }")
639 if [[ "$default_alias_machine" ]]; then
640 default_machine="$default_alias_machine"
643 export QEMU_DEFAULT_MACHINE="$default_machine"
645 TIMESTAMP_FILE=check.time-$IMGPROTO-$IMGFMT
647 _wallclock()
649 date "+%H %M %S" | awk '{ print $1*3600 + $2*60 + $3 }'
652 _wrapup()
654 if $showme
655 then
657 elif $needwrap
658 then
659 if [ -f $TIMESTAMP_FILE -a -f $tmp.time ]
660 then
661 cat $TIMESTAMP_FILE $tmp.time \
662 | awk '
663 { t[$1] = $2 }
664 END { if (NR > 0) {
665 for (i in t) print i " " t[i]
667 }' \
668 | sort -n >$tmp.out
669 mv $tmp.out $TIMESTAMP_FILE
672 if [ -f $tmp.expunged ]
673 then
674 notrun=$(wc -l <$tmp.expunged | sed -e 's/ *//g')
675 try=$(expr $try - $notrun)
676 list=$(echo "$list" | sed -f $tmp.expunged)
679 echo "" >>check.log
680 date >>check.log
681 echo $list | fmt | sed -e 's/^/ /' >>check.log
682 $interrupt && echo "Interrupted!" >>check.log
684 if [ ! -z "$notrun" ]
685 then
686 echo "Not run:$notrun"
687 echo "Not run:$notrun" >>check.log
689 if [ ! -z "$casenotrun" ]
690 then
691 echo "Some cases not run in:$casenotrun"
692 echo "Some cases not run in:$casenotrun" >>check.log
694 if [ ! -z "$n_bad" -a $n_bad != 0 ]
695 then
696 echo "Failures:$bad"
697 echo "Failed $n_bad of $try tests"
698 echo "Failures:$bad" | fmt >>check.log
699 echo "Failed $n_bad of $try tests" >>check.log
700 else
701 echo "Passed all $try tests"
702 echo "Passed all $try tests" >>check.log
704 needwrap=false
707 if test -n "$STTY_RESTORE"; then
708 stty $STTY_RESTORE
710 rm -f "${TEST_DIR}"/*.out "${TEST_DIR}"/*.err "${TEST_DIR}"/*.time
711 rm -f "${TEST_DIR}"/check.pid "${TEST_DIR}"/check.sts
712 rm -f $tmp.*
715 trap "_wrapup; exit \$status" 0 1 2 3 15
717 # Report the test start and results. For makecheck we want to pretty
718 # print the whole report at the end of the execution.
719 # args: $seq, $starttime, $lasttime
720 _report_test_start()
722 if ! $makecheck; then
723 if [ -n "$3" ]; then
724 local lasttime=" (last: $3s)"
726 printf "%-8s %-10s [%s] %4s%-14s\r" "$1" "..." "$2" "..." "$lasttime"
729 # args:$seq $status $starttime $lasttime $thistime $details
730 _report_test_result()
732 local status lasttime thistime
733 if $makecheck; then
734 if [ -n "$2" ] && [ "$2" != "pass" ]; then
735 status=" [$2]"
737 printf " TEST iotest-$IMGFMT: %s%s\n" "$1" "$status"
738 return
741 if [ -n "$4" ]; then
742 lasttime=" (last: $4s)"
744 if [ -n "$5" ]; then
745 thistime=" $5s"
747 case "$2" in
748 "pass") status=$(printf "\e[32m%-10s\e[0m" "$2") ;;
749 "fail") status=$(printf "\e[1m\e[31m%-10s\e[0m" "$2") ;;
750 "not run") status=$(printf "\e[33m%-10s\e[0m" "$2") ;;
751 *) status=$(printf "%-10s" "$2") ;;
752 esac
754 printf "%-8s %s [%s] [%s] %4s%-14s %s\n" "$1" "$status" "$3" "$(date '+%T')" "$thistime" "$lasttime" "$6"
757 [ -f $TIMESTAMP_FILE ] || touch $TIMESTAMP_FILE
759 FULL_IMGFMT_DETAILS=$(_full_imgfmt_details)
760 FULL_HOST_DETAILS=$(_full_platform_details)
762 if ! $makecheck; then
763 _full_env_details
766 seq="check"
768 [ -n "$TESTS_REMAINING_LOG" ] && echo $list > $TESTS_REMAINING_LOG
770 for seq in $list
772 err=false # error flag
773 printdiff=false # show diff to reference output?
774 status="" # test result summary
775 results="" # test result details
777 if [ -n "$TESTS_REMAINING_LOG" ] ; then
778 sed -e "s/$seq//" -e 's/ / /' -e 's/^ *//' $TESTS_REMAINING_LOG > $TESTS_REMAINING_LOG.tmp
779 mv $TESTS_REMAINING_LOG.tmp $TESTS_REMAINING_LOG
780 sync
783 lasttime=$(sed -n -e "/^$seq /s/.* //p" <$TIMESTAMP_FILE)
784 starttime=$(date "+%T")
785 _report_test_start $seq $starttime $lasttime
787 if $showme
788 then
789 status="not run"
790 elif [ -f expunged ] && $expunge && egrep "^$seq([ ]|\$)" expunged >/dev/null
791 then
792 status="not run"
793 results="expunged"
794 rm -f $seq.out.bad
795 echo "/^$seq\$/d" >>$tmp.expunged
796 elif [ ! -f "$source_iotests/$seq" ]
797 then
798 status="not run"
799 results="no such test?"
800 echo "/^$seq\$/d" >>$tmp.expunged
801 else
802 # really going to try and run this one
804 rm -f $seq.out.bad
805 rm -f core $seq.notrun
806 rm -f $seq.casenotrun
808 start=$(_wallclock)
810 if [ "$(head -n 1 "$source_iotests/$seq")" == "#!/usr/bin/env python" ]; then
811 run_command="$PYTHON $seq"
812 else
813 run_command="./$seq"
815 export OUTPUT_DIR=$PWD
816 if $debug; then
817 (cd "$source_iotests";
818 MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(($RANDOM % 255 + 1))} \
819 $run_command -d 2>&1 | tee $tmp.out)
820 else
821 (cd "$source_iotests";
822 MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(($RANDOM % 255 + 1))} \
823 $run_command >$tmp.out 2>&1)
825 sts=$?
826 stop=$(_wallclock)
828 if [ -f core ]
829 then
830 mv core $seq.core
831 status="fail"
832 results="[dumped core] $seq.core"
833 err=true
836 if [ -f $seq.notrun ]
837 then
838 # overwrites timestamp output
839 status="not run"
840 results="$(cat $seq.notrun)"
841 else
842 if [ $sts -ne 0 ]
843 then
844 status="fail"
845 results=$(printf %s "[failed, exit status $sts]")
846 err=true
849 reference="$source_iotests/$seq.out"
850 reference_machine="$source_iotests/$seq.$QEMU_DEFAULT_MACHINE.out"
851 if [ -f "$reference_machine" ]; then
852 reference="$reference_machine"
855 reference_format="$source_iotests/$seq.out.$IMGFMT"
856 if [ -f "$reference_format" ]; then
857 reference="$reference_format"
860 if [ "$CACHEMODE" = "none" ]; then
861 [ -f "$source_iotests/$seq.out.nocache" ] && reference="$source_iotests/$seq.out.nocache"
864 if [ ! -f "$reference" ]
865 then
866 status="fail"
867 reason="no qualified output"
868 err=true
869 else
870 if diff -w "$reference" $tmp.out >/dev/null 2>&1
871 then
872 if ! $err; then
873 status="pass"
874 thistime=$(expr $stop - $start)
875 echo "$seq $thistime" >>$tmp.time
877 else
878 mv $tmp.out $seq.out.bad
879 $diff -w "$reference" "$PWD"/$seq.out.bad
880 status="fail"
881 results="output mismatch (see $seq.out.bad)"
882 printdiff=true
883 err=true
887 if [ -f $seq.casenotrun ]
888 then
889 cat $seq.casenotrun
890 casenotrun="$casenotrun $seq"
894 # come here for each test, except when $showme is true
896 _report_test_result $seq "$status" "$starttime" "$lasttime" "$thistime" "$results"
897 case "$status" in
898 "pass")
899 try=$(expr $try + 1)
901 "fail")
902 try=$(expr $try + 1)
903 if $makecheck; then
904 _full_env_details
906 if $printdiff; then
907 $diff -w "$reference" "$PWD"/$seq.out.bad
909 bad="$bad $seq"
910 n_bad=$(expr $n_bad + 1)
911 quick=false
913 "not run")
914 notrun="$notrun $seq"
916 esac
918 seq="after_$seq"
919 done
921 interrupt=false
922 status=$(expr $n_bad)
923 exit