From ea84faed56e13492aecaec7c521beb4fc949f42d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 14 Mar 2007 09:53:37 +0000 Subject: updated test system and added a msgfile reentrancy test svn path=/trunk/externals/zexy/; revision=7486 --- tests/runtests.sh | 42 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) (limited to 'tests/runtests.sh') diff --git a/tests/runtests.sh b/tests/runtests.sh index e8ce302..fa2128b 100755 --- a/tests/runtests.sh +++ b/tests/runtests.sh @@ -16,23 +16,53 @@ SUFFIX=$(date +%y%m%d-%H%M%S) RUNTESTS_TXT=runtests.txt RUNTESTS_LOG=log-runtests.${SUFFIX} -ls -1 */*.pd | sed 's/\.pd/;/' > ${RUNTESTS_TXT} +LIBFLAGS="-path ../src:../ -lib zexy -path ../abs/" +function list_tests() { +# find . -mindepth 2 -name "*.pd" | sed 's|\.pd$|;|' + ls -1 */*.pd | sed 's|\.pd$|;|' +} + +function debug() { + : +# echo $@ +} + + +function evaluate_tests() { + local logfile + local testfile + local numtests + + testfile=$1 + logfile=$2 + + debug "now evaluating results in ${logfile} (${testfile}" + + numtests=$(grep -c . ${testfile}) + debug "number of tests = ${numtests}" + echo "regression-test: ${numtests} tests total" >> ${logfile} + debug "show results" + cat ${logfile} | egrep "^regression-test: " | sed -e 's/^regression-test: //' +} -LIBFLAGS="-path ../src:../ -lib zexy -path ../abs/" function run_nogui() { + debug "running test without gui" ${PD} ${LIBFLAGS} -nogui runtests_nogui.pd > ${RUNTESTS_LOG} 2>&1 - NUMTESTS=`grep -c . ${RUNTESTS_TXT}` - echo "regression-test: ${NUMTESTS} tests total" >> ${RUNTESTS_LOG} - - cat ${RUNTESTS_LOG} | egrep "^regression-test: " | sed -e 's/^regression-test: //' + debug "testing done" + evaluate_tests ${RUNTESTS_TXT} ${RUNTESTS_LOG} + debug "testing finished" } function run_withgui() { + debug "running test with gui" ${PD} ${LIBFLAGS} -stderr runtests.pd > ${RUNTESTS_LOG} 2>&1 + debug "testing completed, no evaluation will be done; see ${RUNTESTS_LOG} for results" } +list_tests > ${RUNTESTS_TXT} + if test "x$1" = "x-gui"; then run_withgui else -- cgit v1.2.1