-
Notifications
You must be signed in to change notification settings - Fork 13
/
run-tests.sh
executable file
·43 lines (40 loc) · 1.66 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
#!/usr/bin/env bash
#=======================================================================
# FILE: run-tests.sh
# DESCRIPTION: Runs test suite under all supported versions of Python
# and displays failures when encountered.
#=======================================================================
#-----------------------------------------------------------------------
# Define function (takes command to run as a single argument).
#-----------------------------------------------------------------------
run_command ()
{
echo "" >&2
echo "======================================================================" >&2
echo "$1" >&2
echo "======================================================================" >&2
$1 # <- Run command.
if [ $? -ne 0 ] # Check exit status of completed command.
then
echo "" >&2
echo "Failed Command: $1" >&2
echo "" >&2
exit $? # <- EXIT!
fi
}
#-----------------------------------------------------------------------
# Run test suite in all supported versions of Python.
#-----------------------------------------------------------------------
run_command "python3.9 -B -m unittest $*"
run_command "python3.8 -B -m unittest $*"
run_command "python3.7 -B -m unittest $*"
run_command "python3.6 -B -m unittest $*"
run_command "python3.5 -B -m unittest $*"
run_command "python3.4 -B -m unittest $*"
#run_command "python3.3 -B -m unittest $*"
#run_command "python3.2 -B -m unittest $*"
#run_command "python3.1 -B tests/discover.py $*"
run_command "python2.7 -B -m unittest discover $*"
run_command "python2.6 -B tests/discover.py $*"
echo "" >&2
echo "All commands successful." >&2