-
Notifications
You must be signed in to change notification settings - Fork 5
/
run-auto-tests.sh
executable file
·96 lines (78 loc) · 2.44 KB
/
run-auto-tests.sh
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
#!/bin/bash
SHOW_STDERR=${SHOW_STDERR:-0}
USE_VALGRIND=${USE_VALGRIND:-0}
VALGRIND="valgrind --leak-check=full --num-callers=100 --error-exitcode=1"
VALGRIND="${VALGRIND} --exit-on-first-error=yes"
#VALGRIND="${VALGRIND} --suppressions=/usr/lib/x86_64-linux-gnu/valgrind/default.supp"
VALGRIND="${VALGRIND} --suppressions=/usr/share/glib-2.0/valgrind/glib.supp"
VALGRIND="${VALGRIND} --suppressions=Source/valgrind/valgrind.supp"
start_time=$(date +%s)
total_passed=0
total_failed=0
total_crashed=0
test_failed=""
test_crashed=""
export MG_GAL_ENGINE=dummy
export MG_IAL_ENGINE=dummy
(cd 4.0; ./fetch-ucd-test.sh)
(cd src; ./mginit &)
sleep 3
truncate -s 0 /var/tmp/minigui-tests.log
for subdir in api 4.0 5.0; do
cd $subdir
TEST_PROGS=`find . -perm -0111 -type f`
for x in $TEST_PROGS; do
echo ">> Start of $subdir/$x"
if test $USE_VALGRIND -eq 0; then
if test $SHOW_STDERR -eq 0; then
echo ">> STDERR OF $subdir/$x" >> /var/tmp/minigui-tests.log
timeout 10m $x auto 2>> /var/tmp/minigui-tests.log
RESULT=$?
echo "<< END OF STDERR OF $subdir/$x" >> /var/tmp/minigui-tests.log
echo "" >> /var/tmp/minigui-tests.log
else
timeout 10m $x auto
RESULT=$?
fi
else
${VALGRIND} ./$x auto || exit
RESULT=$?
fi
if test $RESULT -eq 0; then
total_passed=$((total_passed + 1))
elif test $RESULT -gt 128; then
total_crashed=$((total_crashed + 1))
test_crashed="$subdir/$x $test_crashed"
else
total_failed=$((total_failed + 1))
test_failed="$subdir/$x $test_failed"
fi
echo "<< End of $subdir/$x"
echo ""
done
cd ..
done
total=$((total_passed + total_failed + total_crashed))
end_time=$(date +%s)
time=$(($end_time - $start_time))
echo "#######"
echo "# Tests run: $total (total time $time second(s))"
echo "# Passed: $total_passed"
echo "# Failed: $total_failed"
echo "# Crashed: $total_crashed"
echo "#######"
if test $total_failed -ne 0; then
echo "Failed tests:"
for x in $test_failed; do
echo $x
done
fi
if test $total_crashed -ne 0; then
echo "Crashed tests:"
for x in $test_crashed; do
echo $x
done
fi
killall mginit
total_not_passed=$((total_failed + total_crashed))
exit $total_not_passed