aboutsummaryrefslogtreecommitdiff
path: root/tests/runtests.sh
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2007-03-14 09:53:37 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2007-03-14 09:53:37 +0000
commitea84faed56e13492aecaec7c521beb4fc949f42d (patch)
treed3b23b7a29a59ab12172e8f0f2007d4e1daa3ecf /tests/runtests.sh
parentc37112a7f380d81e4ce6a1cb8446bea3994dfaf5 (diff)
updated test system and added a msgfile reentrancy test
svn path=/trunk/externals/zexy/; revision=7486
Diffstat (limited to 'tests/runtests.sh')
-rwxr-xr-xtests/runtests.sh42
1 files changed, 36 insertions, 6 deletions
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