-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_tests.sh
executable file
·63 lines (56 loc) · 1.22 KB
/
run_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
#! /usr/bin/env bash
PYTHONPATH="$PYTHONPATH:src/edeposit/amqp"
TEST_PATH="src/edeposit/amqp/antivirus/tests"
function show_help {
echo -e "Usage: $0 [-h] [-a] [-i] [-u]"
echo
echo -e "\t-h"
echo -e "\t\tShow this help."
echo -e "\t-a"
echo -e "\t\tRun all tests."
echo -e "\t-i"
echo -e "\t\tRun integration test (requires sudo)."
echo -e "\t-u"
echo -e "\t\tRun unittest."
echo
exit;
}
function run_all_tests {
sudo env PYTHONPATH=$PYTHONPATH py.test $TEST_PATH;
exit
}
function run_int_tests {
sudo env PYTHONPATH=$PYTHONPATH py.test "$TEST_PATH/integration";
exit
}
function run_unit_tests {
supy.test "$TEST_PATH/unittests";
exit
}
while getopts "haiu" optname; do
case "$optname" in
"a")
run_all_tests;
;;
"i")
run_int_tests;
;;
"u")
run_unit_tests;
;;
"h")
show_help;
;;
"?")
echo "Unknown option $OPTARG"
;;
":")
echo "No argument value for option $OPTARG"
;;
*)
# Should not occur
echo "Unknown error while processing options"
;;
esac
done
show_help;