From 3affb51bbd06872fec36123a558b3d28d0938a61 Mon Sep 17 00:00:00 2001 From: Christian Thaeter Date: Wed, 17 Aug 2005 03:34:24 +0000 Subject: [PATCH] test suite improvements git-archimport-id: chth@gmx.net--2004/mala-glibc--devel--0.2--patch-92 --- ChangeLog | 20 ++ tests/{mala_strings.test => 10stringlib.tests} | 4 +- tests/20basic.tests | 9 + tests/30expansion.tests | 160 +++++++++++ tests/40stdmodule.tests | 362 +++++++++++++++++++++++++ tests/50arithmodule.tests | 10 + tests/test.sh | 92 ++++--- 7 files changed, 621 insertions(+), 36 deletions(-) rename tests/{mala_strings.test => 10stringlib.tests} (93%) create mode 100644 tests/20basic.tests create mode 100644 tests/30expansion.tests create mode 100644 tests/40stdmodule.tests create mode 100644 tests/50arithmodule.tests diff --git a/ChangeLog b/ChangeLog index 004e92d..66a4ed2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,26 @@ # arch-tag: automatic-ChangeLog--chth@gmx.net--2004/mala-glibc--devel--0.2 # +2005-08-17 03:34:24 GMT Christian Thaeter patch-92 + + Summary: + test suite improvements + Revision: + mala-glibc--devel--0.2--patch-92 + + + new files: + tests/20basic.tests tests/30expansion.tests + tests/40stdmodule.tests tests/50arithmodule.tests + + modified files: + ChangeLog tests/10stringlib.tests tests/test.sh + + renamed files: + tests/mala_strings.test + ==> tests/10stringlib.tests + + 2005-08-16 23:22:51 GMT Christian Thaeter patch-91 Summary: diff --git a/tests/mala_strings.test b/tests/10stringlib.tests similarity index 93% rename from tests/mala_strings.test rename to tests/10stringlib.tests index 9480177..4847d69 100644 --- a/tests/mala_strings.test +++ b/tests/10stringlib.tests @@ -14,7 +14,9 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, contact me. -TEST "strings" <,testlog function TEST() { + name="$1" + shift cat >,cmp echo -n "" >,out - echo -n "TEST $1: " - echo -en "\nTEST $* " >>,testlog - shift + echo -n "TEST $name: " + echo -en "\nTEST $name: $* " >>,testlog + + case $TESTMODE in + DEBUG) + if grep "^TEST $name: .* FAILED" ,testlog.pre >&/dev/null; then + MSGOK=" (fixed)" + MSGFAIL=" (still broken)" + elif grep "^TEST $name: .* \\(SKIPPED (ok)\\|OK\\)" ,testlog.pre >&/dev/null; then + echo ".. SKIPPED (ok)" + echo ".. SKIPPED (ok)" >>,testlog + SKIPCNT=$(($SKIPCNT + 1)) + TESTCNT=$(($TESTCNT + 1)) + return + else + MSGOK=" (new)" + MSGFAIL=" (new)" + fi + ;; + *) + MSGOK="" + MSGFAIL="" + ;; + esac + if $valgrind $TESTBIN "$@" 2>&1 | tee ,tmp | grep -v 'DEBUG:' | cmp ,cmp - &>/dev/null; then - echo ".. OK" - echo ".. OK" >>,testlog + echo ".. OK$MSGOK" + echo ".. OK$MSGOK" >>,testlog else - echo ".. FAILED"; - echo ".. FAILED" >>,testlog + echo ".. FAILED$MSGFAIL"; + echo ".. FAILED$MSGFAIL" >>,testlog grep -v 'DEBUG:' <,tmp >,out diff -ua ,cmp ,out >>,testlog # grep 'DEBUG:\|==.*==' <,tmp >>,testlog @@ -67,14 +103,18 @@ function PLANNED() { echo -n "PLANNED $1: " echo -en "\nPLANNED $* " >>,testlog - echo ".. SKIPPED" - echo ".. SKIPPED" >>,testlog + echo ".. SKIPPED (planned)" + echo ".. SKIPPED (planned)" >>,testlog SKIPCNT=$(($SKIPCNT + 1)) TESTCNT=$(($TESTCNT + 1)) } -function TESTSUMMARY() +function RUNTESTS() { + for i in $srcdir/*.tests; do + source $i + done + echo rm ,cmp ,out ,tmp if [ $FAILCNT = 0 ]; then echo " ... PASSED $(($TESTCNT - $SKIPCNT)) TESTS, $SKIPCNT SKIPPED" @@ -88,32 +128,14 @@ function TESTSUMMARY() fi } -echo -echo "string library tests:" -TESTBIN=./test-mala_strings -source $srcdir/mala_strings.test - -echo -echo "basic startup tests:" -TESTBIN=./test-mala_stdmodule -source ../../../tests/basic_tests - -echo -echo "plain engine/expansion tests:" -TESTBIN=./test-mala_expansions -source ../../../tests/expansion_tests - -echo -echo "stdmodule tests:" -TESTBIN=./test-mala_stdmodule -source ../../../tests/stdmodule_tests - -#echo -#echo "arithmodule tests:" -#TESTBIN=./test-mala_arithmodule -#source ../../../tests/arithmodule_tests +function TESTING() +{ + echo + echo "$1" + TESTBIN=$2 +} -TESTSUMMARY +RUNTESTS # arch-tag: f4d06a47-6e17-40de-bba8-17240ae3f435 -- 2.11.4.GIT