forked from NVIDIA/hpc-container-maker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathruntests.sh
executable file
·41 lines (38 loc) · 862 Bytes
/
runtests.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
#!/bin/bash
COVERAGE=false
COVERAGE_TOOL=coverage
PYTHON=python
TEST=""
while [ "$1" != "" ]; do
case $1 in
--coverage )
COVERAGE=true
;;
--python2 )
COVERAGE_TOOL=coverage2
PYTHON=python2
;;
--python3 )
COVERAGE_TOOL=coverage3
PYTHON=python3
;;
--verbose )
VERBOSE="-v"
;;
--test=?*)
TEST=${1#*=}
;;
* )
;;
esac
shift
done
if ${COVERAGE}; then
${COVERAGE_TOOL} run --source=hpccm -m unittest discover -s test ${VERBOSE}
${COVERAGE_TOOL} report -m
elif [ -n "${TEST}" ]; then
echo "Test: ${TEST}"
${PYTHON} -m unittest discover ${VERBOSE} -s test -p "*${TEST}*.py"
else
${PYTHON} -m unittest discover -s test ${VERBOSE}
fi