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.
19 srcdir
=$
(dirname "$arg0")
23 if [ "$VALGRINDFLAGS" = 'DISABLE' ]; then
24 echo "valgrind explicit disabled"
26 if [ "$(which valgrind)" ]; then
27 valgrind
="$(which valgrind) --tool=addrcheck --leak-check=yes -q $VALGRINDFLAGS"
30 echo "no valgrind found, go without it"
35 echo ================ $0 ================
48 echo -en "\nTEST $* " >>,testlog
50 if $valgrind $TESTBIN "$@" 2>&1 |
tee ,tmp |
grep -v 'DEBUG:' |
cmp ,cmp - &>/dev
/null
; then
52 echo ".. OK" >>,testlog
55 echo ".. FAILED" >>,testlog
56 grep -v 'DEBUG:' <,tmp
>,out
57 diff -ua ,cmp ,out
>>,testlog
58 # grep 'DEBUG:\|==.*==' <,tmp >>,testlog
61 FAILCNT
=$
(($FAILCNT + 1))
63 TESTCNT
=$
(($TESTCNT + 1))
68 echo -n "PLANNED $1: "
69 echo -en "\nPLANNED $* " >>,testlog
71 echo ".. SKIPPED" >>,testlog
72 SKIPCNT
=$
(($SKIPCNT + 1))
73 TESTCNT
=$
(($TESTCNT + 1))
76 function TESTSUMMARY
()
79 if [ $FAILCNT = 0 ]; then
80 echo " ... PASSED $(($TESTCNT - $SKIPCNT)) TESTS, $SKIPCNT SKIPPED"
83 echo " ... SUCCEDED $(($TESTCNT - $FAILCNT - $SKIPCNT)) TESTS"
84 echo " ... FAILED $FAILCNT TESTS"
85 echo " ... SKIPPED $SKIPCNT TESTS"
86 echo " see ',testlog' for details"
92 echo "string library tests:"
93 TESTBIN
=.
/test-mala_strings
94 source $srcdir/mala_strings.
test
97 echo "basic startup tests:"
98 TESTBIN
=.
/test-mala_stdmodule
99 source ..
/..
/..
/tests
/basic_tests
102 echo "plain engine/expansion tests:"
103 TESTBIN
=.
/test-mala_stdmodule
104 source ..
/..
/..
/tests
/expansion_tests
107 echo "stdmodule tests:"
108 TESTBIN
=.
/test-mala_stdmodule
109 source ..
/..
/..
/tests
/stdmodule_tests
112 #echo "arithmodule tests:"
113 #TESTBIN=./test-mala_arithmodule
114 #source ../../../tests/arithmodule_tests
118 # arch-tag: f4d06a47-6e17-40de-bba8-17240ae3f435