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 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
|
#!/bin/bash
function die() {
echo "$1" >&2;
exit 1;
}
function pad () {
local l=$( echo -n $2 | wc -c )
local o=""
while [ $l -lt $1 ]; do
o="${o} "
l=$(( $l + 1 ))
done
echo -n "${o}${2} : " >& 2
}
failed=0
drivers="
testAppTimer
testApplicationSip
testConnectionBase
testCorruption
testDigestAuthentication
testEmbedded
testEmptyHeader
testExternalLogger
testIM
testMessageWaiting
testMultipartMixedContents
testMultipartRelated
testParserCategories
testPidf
testPksc7
testPlainContents
testRlmi
testSdp
testSelectInterruptor
testSipFrag
testSipMessage
testSipMessageMemory
testStackStd.sh
testTcp
testTime
testTimer
testTuple
testUri"
echo top
x=0
length=0
for prg in ${drivers}; do
x=$(( $(echo $prg | wc -c ) + 0 ))
[ $x"x" == "x" ] && continue
if [ $x -gt $length ]; then
length=$x
fi
done
flist=""
mlist=""
failed=0
missed=0
for i in ${drivers}; do
t=./$i
pad $length $i
if test ! -x $t; then
echo "not found. (fail)" >&2
mlist="${mlist} ${i}"
missed=$(( $missed + 1 ))
else
if $t > $i.log 2>&1; then
echo "passed" >&2
else
echo "failed" >&2
failed=$(( $failed + 1 ))
flist="${flist} ${i}"
fi
fi;
done;
if [ ${missed} -ne 0 ]; then
echo "Missed: "${mlist}
echo "${missed} tests missing" >&2
fi
if [ ${failed} -ne 0 ]; then
[ ${missed} -ne 0 ] && echo ""
echo "Failed: "${flist}
echo "${failed} tests failed" >&2
fi
exit $(( ${missed} + ${failed} ))
|