blob: 0c256beea37c17e12fbde811b77c887062231b78 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
#!/bin/bash
# this is just small wrapper to automate the unit testcases
function emptylog() {
FILENAME=$1
TESTCASE=$2
REASON=$3
cat<<EOF > $FILENAME
<?xml version="1.0"?>
<testsuite name="${TESTCASE}" tests="3" failures="0" errors="1" time="0.0">
<properties>
<property name="QtVersion" value="4.4.0"/>
<property name="QTestVersion" value="4.4.0"/>
</properties>
<testcase classname="${TESTCASE}" name="initTestCase" time="0.0"/>
<testcase classname="${TESTCASE}" name="notAvailable" time="0.0">
<failure type="Standard" message="${REASON}"/>
</testcase>
<testcase classname="${TESTCASE}" name="cleanupTestCase" time="0.0"/>
<system-out>Current testsuite crashes or wasnt in shape to be executed in development environment and this error message is placeholder. Fix your tests!</system-out>
<system-err/>
</testsuite>
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
|