Skip to content

Commit e8dcf90

Browse files
authored
Merge branch 'master' into master
2 parents 43f423b + 553032d commit e8dcf90

1 file changed

Lines changed: 25 additions & 29 deletions

File tree

testall.sh

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,36 @@ python="python"
1212

1313
# Check if a command line argument was provided as an input argument.
1414
while 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
4343
done
4444

45-
4645
# Run the examples and tests
4746
python_version=$($python --version |& sed 's|Python \(.\).*|\1|g' | head -n 1)
4847

@@ -60,7 +59,6 @@ if [ "$python_version" = '3' ]; then
6059
fi
6160
fi
6261

63-
6462
if [ "$python_version" = '2' ]; then
6563
main_folder=python2_source
6664
cd $main_folder
@@ -78,25 +76,23 @@ if [ "$python_version" = '2' ]; then
7876
cd ..
7977
fi
8078

81-
8279
count=0
8380
for 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
9087
done
9188

9289
coverage combine
9390

9491
if [ "$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
9693
fi
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

Comments
 (0)