blob: 1beca0b7492ae7c2cb512705f2996f215407c017 (
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
|
#!/bin/sh
# MiniMIME test cases
[ ! -x ./tests/parse -o ! -x ./tests/create ] && {
echo "You need to compile the test suite first to accomplish tests"
exit 1
}
LD_LIBRARY_PATH=${PWD}
export LD_LIBRARY_PATH
DIRECTORY=${1:-tests/messages}
FILES=${2:-"*"}
TESTS=0
F_ERRORS=0
F_INVALID=""
M_ERRORS=0
M_INVALID=""
for f in ${DIRECTORY}/${FILES}; do
if [ -f "${f}" ]; then
TESTS=$((TESTS + 2))
echo -n "Running PARSER test for $f (file)... "
output=`./tests/parse $f 2>&1`
[ $? != 0 ] && {
echo "FAILED ($output)"
F_ERRORS=$((F_ERRORS + 1))
F_INVALID="${F_INVALID} ${f} "
} || {
echo "PASSED"
}
echo -n "Running PARSER test for $f (memory)... "
output=`./tests/parse -m $f 2>&1`
[ $? != 0 ] && {
echo "FAILED ($output)"
M_ERRORS=$((M_ERRORS + 1))
M_INVALID="${M_INVALID} ${f} "
} || {
echo "PASSED"
}
fi
done
echo "Ran a total of ${TESTS} tests"
if [ ${F_ERRORS} -gt 0 ]; then
echo "!! ${F_ERRORS} messages had errors in file based parsing"
echo "-> ${F_INVALID}"
fi
if [ ${M_ERRORS} -gt 0 ]; then
echo "!! ${F_ERRORS} messages had errors in memory based parsing"
fi
unset LD_LIBRARY_PATH
|