2 # Copyright (C) 2004, Christian Thaeter <chth@gmx.net>
4 # This file is part of the MaLa extension Language.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License version 2 as
8 # published by the Free Software Foundation.
10 # This program is distributed in the hope that it will 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, contact me.
18 # TESTMODE=FULL yet unimplemented
19 # run all tests, PLANNED which fail count as error
22 # run only tests which recently failed
25 srcdir
=$
(dirname "$arg0")
29 if [ "$VALGRINDFLAGS" = 'DISABLE' ]; then
30 echo "valgrind explicit disabled"
32 if [ "$(which valgrind)" ]; then
33 valgrind
="$(which valgrind) --tool=addrcheck --leak-check=yes -q $VALGRINDFLAGS"
36 echo "no valgrind found, go without it"
41 echo ================ $0 ================
47 if test -f ,testlog
; then
48 mv ,testlog
,testlog.pre
61 echo -n "TEST $name: "
62 echo -en "\nTEST $name: $* " >>,testlog
66 if grep "^TEST $name: .* FAILED" ,testlog.pre
>&/dev
/null
; then
68 MSGFAIL
=" (still broken)"
69 elif grep "^TEST $name: .* \\(SKIPPED (ok)\\|OK\\)" ,testlog.pre
>&/dev
/null
; then
70 echo ".. SKIPPED (ok)"
71 echo ".. SKIPPED (ok)" >>,testlog
72 SKIPCNT
=$
(($SKIPCNT + 1))
73 TESTCNT
=$
(($TESTCNT + 1))
86 if $valgrind $TESTBIN "$@" 2>&1 |
tee ,tmp |
grep -v 'DEBUG:' |
cmp ,cmp - &>/dev
/null
; then
88 echo ".. OK$MSGOK" >>,testlog
90 echo ".. FAILED$MSGFAIL";
91 echo ".. FAILED$MSGFAIL" >>,testlog
92 grep -v 'DEBUG:' <,tmp
>,out
93 diff -ua ,cmp ,out
>>,testlog
94 # grep 'DEBUG:\|==.*==' <,tmp >>,testlog
97 FAILCNT
=$
(($FAILCNT + 1))
99 TESTCNT
=$
(($TESTCNT + 1))
104 echo -n "PLANNED $1: "
105 echo -en "\nPLANNED $* " >>,testlog
106 echo ".. SKIPPED (planned)"
107 echo ".. SKIPPED (planned)" >>,testlog
108 SKIPCNT
=$
(($SKIPCNT + 1))
109 TESTCNT
=$
(($TESTCNT + 1))
114 for i
in $srcdir/*.tests
; do
119 if [ $FAILCNT = 0 ]; then
120 echo " ... PASSED $(($TESTCNT - $SKIPCNT)) TESTS, $SKIPCNT SKIPPED"
123 echo " ... SUCCEDED $(($TESTCNT - $FAILCNT - $SKIPCNT)) TESTS"
124 echo " ... FAILED $FAILCNT TESTS"
125 echo " ... SKIPPED $SKIPCNT TESTS"
126 echo " see ',testlog' for details"
140 # arch-tag: f4d06a47-6e17-40de-bba8-17240ae3f435