[5d12a0]: / tests / run_tests.sh

Download this file

61 lines (44 with data), 1.2 kB

 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
#!/usr/bin/env bash
set -e
PYCMD=${PYCMD:="python"}
COVERAGE=0
while [[ "$#" -gt 0 ]]; do
case "$1" in
-p|--python) PYCMD=$2; shift 2 ;;
-c|--coverage) COVERAGE=1; shift 1;;
--) shift; break ;;
*) echo "Invalid argument: $1!" ; exit 1 ;;
esac
done
if [[ $COVERAGE -eq 1 ]]; then
coverage erase
PYCMD="coverage run --parallel-mode --source ants "
echo "coverage flag found. Setting command to: \"$PYCMD\""
fi
pushd "$(dirname "$0")"
echo "Running core tests"
$PYCMD test_core_ants_image.py $@
$PYCMD test_core_ants_image_indexing.py $@
$PYCMD test_core_ants_image_io.py $@
$PYCMD test_core_ants_transform.py $@
$PYCMD test_core_ants_transform_io.py $@
$PYCMD test_core_ants_metric.py $@
echo "Running learn tests"
$PYCMD test_learn.py $@
echo "Running registration tests"
$PYCMD test_registration.py $@
echo "Running segmentation tests"
$PYCMD test_segmentation.py $@
echo "Running utils tests"
$PYCMD test_utils.py $@
echo "Running ops tests"
$PYCMD test_ops.py $@
echo "Running plotting tests"
$PYCMD test_plotting.py $@
echo "Running bug tests"
$PYCMD test_bugs.py $@
if [[ $COVERAGE -eq 1 ]]; then
coverage combine
coverage xml
fi
popd