-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrun-all-tests.sh
More file actions
executable file
·46 lines (42 loc) · 845 Bytes
/
run-all-tests.sh
File metadata and controls
executable file
·46 lines (42 loc) · 845 Bytes
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
#!/usr/bin/env bash
cd test
set -e
fail=0
tests=0
echo -e "\e[1mQompoter Test Suite\e[0m"
echo "###################"
suffix=""
while [ "$1" != "" ]; do
case $1 in
--offline )
suffix="-offline"
shift
;;
esac
done
for test in *.sh ;
do
tests=$((tests+1))
echo -e "\e[1mTEST\e[0m: $(echo $test | tr '-' ' ' | sed 's/.sh//')"
./$test ${suffix} && ret=0 || ret=$?
if [ $ret -eq 0 ] ; then
echo -e "\e[1;32mOK\e[0m: $test"
passed=$((passed+1))
elif [ $ret -eq 255 ] ; then
echo -e "\e[1;33mSKIP\e[0m: $test"
tests=$((tests-1))
else
echo -e "\e[1;31mFAIL\e[0m: $test $fail"
fail=$((fail+ret))
fi
echo
done
if [ $fail -eq 0 ]; then
echo -e -n '\e[1;32mSUCCESS\e[0m '
exitcode=0
else
echo -e -n '\e[1;31mFAILURE\e[0m '
exitcode=1
fi
echo "$passed / $tests"
exit $exitcode