-
Notifications
You must be signed in to change notification settings - Fork 11
/
test_all.sh
84 lines (58 loc) · 2.09 KB
/
test_all.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
#!/bin/sh
################################################################################
# run a batch test over all the examples from the bash shell (linux)
# Copyright (c) 2019 Dept Computer Science,
# Durham University, UK
# License : LGPL - http://www.gnu.org/licenses/lgpl.html
################################################################################
PYTHON_INTERPRETATOR=python3
CAM_TO_TEST=0
VIDEO_TO_TEST=video.avi
echo
echo Using $PYTHON_INTERPRETATOR with camera $CAM_TO_TEST and video $VIDEO_TO_TEST
echo "Running test suite - press 'x' in OpenCV window to exit each example."
echo
# get testing resouces if they do not exist
[ -f example.jpg ] || { wget https://upload.wikimedia.org/wikipedia/commons/b/b4/JPEG_example_JPG_RIP_100.jpg; mv JPEG_example_JPG_RIP_100.jpg example.jpg; }
[ -f video.avi ] || { wget http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4; mv big_buck_bunny.mp4 video.avi; }
################################################################################
# run defaults
echo "Running default tests ..."
echo
for example in *.py
do
echo "Testing example: " $example
$PYTHON_INTERPRETATOR $example
echo
done
################################################################################
# run cam test
echo "Running camera based tests ..."
echo
for example in *.py
do
echo "Testing example: " $example -c $CAM_TO_TEST
$PYTHON_INTERPRETATOR $example -c $CAM_TO_TEST
echo
done
################################################################################
# run cam test and resize
echo "Running camera based tests with resizing ..."
echo
for example in *.py
do
echo "Testing example: " $example -c $CAM_TO_TEST -r 0.25
$PYTHON_INTERPRETATOR $example -c $CAM_TO_TEST -r 0.25
echo
done
################################################################################
# run video file test
echo "Running video file based tests ..."
echo
for example in *.py
do
echo "Testing example: " $example $VIDEO_TO_TEST
$PYTHON_INTERPRETATOR $example $VIDEO_TO_TEST
echo
done
################################################################################