@@ -12,37 +12,36 @@ python="python"
1212
1313# Check if a command line argument was provided as an input argument.
1414while getopts " :p:cdh" opt; do
15- case $opt in
15+ case $opt in
1616 p)
17- python=$OPTARG
18- ;;
17+ python=$OPTARG
18+ ;;
1919 c)
20- clean=TRUE
21- ;;
20+ clean=TRUE
21+ ;;
2222 d)
23- nodoc=TRUE
24- ;;
23+ nodoc=TRUE
24+ ;;
2525 h)
26- echo This runs all the tests and examples and checks for pep8 compliance
27- echo
28- echo Options:
29- echo ' -c cleans up the latex and pdf files generated'
30- echo ' -p COMMAND the python command that should be used to run the tests'
31- echo " -d don't execute the doc tests, they can take long"
32- exit 0
33- ;;
26+ echo This runs all the tests and examples and checks for pep8 compliance
27+ echo
28+ echo Options:
29+ echo ' -c cleans up the latex and pdf files generated'
30+ echo ' -p COMMAND the python command that should be used to run the tests'
31+ echo " -d don't execute the doc tests, they can take long"
32+ exit 0
33+ ;;
3434 \? )
35- echo " Invalid option: -$OPTARG " >&2
36- exit 1
37- ;;
35+ echo " Invalid option: -$OPTARG " >&2
36+ exit 1
37+ ;;
3838 :)
39- echo " Option -$OPTARG requires an argument." >&2
40- exit 1
41- ;;
42- esac
39+ echo " Option -$OPTARG requires an argument." >&2
40+ exit 1
41+ ;;
42+ esac
4343done
4444
45-
4645# Run the examples and tests
4746python_version=$( $python --version | & sed ' s|Python \(.\).*|\1|g' | head -n 1)
4847
@@ -60,7 +59,6 @@ if [ "$python_version" = '3' ]; then
6059 fi
6160fi
6261
63-
6462if [ " $python_version " = ' 2' ]; then
6563 main_folder=python2_source
6664 cd $main_folder
@@ -78,25 +76,23 @@ if [ "$python_version" = '2' ]; then
7876 cd ..
7977fi
8078
81-
8279count=0
8380for f in " $main_folder " /examples/* .py; do
8481 echo -e ' \e[32mTesting ' " $f " ' \e[0m'
8582 if ! $python " $( command -v coverage) " run " $f " ; then
8683 exit 1
8784 fi
88- (( count ++ ))
85+ (( count++ ))
8986 mv .coverage .coverage.example$count
9087done
9188
9289coverage combine
9390
9491if [ " $clean " = ' TRUE' ]; then
95- rm -- * .pdf * .log * .aux * .tex * .fls * .fdb_latexmk > /dev/null
92+ rm -- * .pdf * .log * .aux * .tex * .fls * .fdb_latexmk > /dev/null
9693fi
9794
98-
99- if [[ " $nodoc " != ' TRUE' && " $python_version " == " 3" && " $python_version_long " != 3.3.* && " $python_version_long " != 3.4.* && " $python_version_long " != 3.12.* ]]; then
95+ if [[ " $nodoc " != ' TRUE' && " $python_version " == " 3" && " $python_version_long " != 3.7.* && " $python_version_long " != 3.8.* && " $python_version_long " != 3.12.* ]]; then
10096 echo -e ' \e[32mChecking for errors in docs and docstrings\e[0m'
10197 cd docs
10298 set -e
0 commit comments