#!/bin/bash # this is just small wrapper to automate the unit testcases function emptylog() { FILENAME=$1 TESTCASE=$2 REASON=$3 cat< $FILENAME Current testsuite crashes or wasnt in shape to be executed in development environment and this error message is placeholder. Fix your tests! EOF } TEST=$1 CURDIR=`pwd` DIRNAME=`dirname $TEST` BASENAME=`basename $TEST` QTESTLOG=./$BASENAME.log JUNITLOG=./$BASENAME.log.xml # cd $DIRNAME if [ ! -f ./$BASENAME ]; then EXIT_CODE=255 else LD_LIBRARY_PATH=../../lib ./$BASENAME -xml -o ./$BASENAME.log xsltproc --nonet ../qtestlib2junitxml.xsl $QTESTLOG > $JUNITLOG EXIT_CODE=$? fi if [ ! -f $JUNITLOG ]; then EXIT_CODE=254 fi case "$EXIT_CODE" in "0") echo success ;; "254") echo error: unittest $BASENAME failed with $EXIT_CODE errors emptylog $JUNITLOG $BASENAME "unittest crashed or exited with fatal error" ;; "255") echo error: unittest $BASENAME is not compiled emptylog $JUNITLOG $BASENAME "unittest doesnt exist" ;; *) echo error: unittest $BASENAME failed with $EXIT_CODE errors emptylog $JUNITLOG $BASENAME "unittest crashed or exited with fatal error" ;; esac cd $CURDIR exit 0