-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_all_tests_separated.sh
executable file
·125 lines (108 loc) · 2.59 KB
/
run_all_tests_separated.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/bin/bash
# Define a list of test_modules
declare -a test_modules_full=( \
"test_Dataheap_Job_001" \
"test_Dataheap_Job_002" \
"test_Dataheap_Recorded_001" \
"test_Dataheap_Recorded_002" \
"test_Dataheap_Recorded_003" \
"test_Dataheap_Video_001" \
"test_Dataheap_Video_002" \
"test_Dataheap_Video_003" \
"test_Dataheap_Video_004" \
"test_Dataheap_Video_005" \
"test_Dataheap_VideoGrabber_001" \
"test_datetime_000" \
"test_datetime_001" \
"test_datetime_002" \
"test_datetime_003" \
"test_DBCache_001" \
"test_DictData_001" \
"test_DictInv_001" \
"test_enum_001" \
"test_Logging_001" \
"test_Logging_002" \
"test_Logging_003" \
"test_Logging_004" \
"test_Logging_005" \
"test_Logging_006" \
"test_Methodheap_BEEventMonitor_001" \
"test_Methodheap_Frontend_001" \
"test_Methodheap_MythBE_001" \
"test_Methodheap_MythDB_001" \
"test_Methodheap_MythSystemEvent_001" \
"test_Methodheap_MythXML_001" \
"test_Methodheap_MythXML_002" \
"test_MSearch_001" \
"test_MSearch_002" \
"test_Mythproto_001" \
"test_OrdDict_001" \
"test_System_001" \
"test_repr_001" \
"test_singleton_001" \
)
# Define a list of test_modules for mysql access
declare -a test_modules_minimal=( \
"test_DBCache_001" \
"test_Dataheap_Job_002" \
"test_Dataheap_Recorded_001" \
"test_Dataheap_Recorded_002" \
"test_Dataheap_Recorded_003" \
"test_Dataheap_Video_003" \
"test_Dataheap_Video_004" \
"test_Dataheap_Video_005" \
"test_Methodheap_MythBE_001" \
"test_Methodheap_MythDB_001" \
)
usage()
{
echo "usage: run_all_tests_separated.sh [[--minimal]] | [-h]]"
}
is_python2() {
python << EOF
import sys
if sys.version_info[0] == 2:
sys.exit(0)
else:
sys.exit(1)
EOF
}
minimal=0
while [ "$1" != "" ]; do
case $1 in
-m | --minimal ) minimal=1
;;
-h | --help ) usage
exit
;;
* ) usage
exit 1
esac
shift
done
if [ "$minimal" = "1" ]; then
test_modules=${test_modules_minimal[@]}
else
test_modules=${test_modules_full[@]}
fi
#if is_python2; then
# TPYTHONCOVERAGE="python-coverage"
#else
# TPYTHONCOVERAGE="python3-coverage"
#fi
TPYTHONCOVERAGE="python3-coverage"
echo "Using ${TPYTHONCOVERAGE}."
echo
echo "Using the following tests:"
for m in ${test_modules[@]}; do
echo test.$m
done
# exit 1
# erase last coverage
${TPYTHONCOVERAGE} erase
# run coverage on all defined modules and add results
for m in ${test_modules[@]}; do
${TPYTHONCOVERAGE} run -a -m unittest -v test.$m
done
${TPYTHONCOVERAGE} report
${TPYTHONCOVERAGE} html