File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ install:
75
75
script :
76
76
- ' if [ $SLYCOT != "" ]; then python -c "import slycot"; fi'
77
77
- coverage run setup.py test
78
+ - ' (cd examples && bash run_examples.sh)'
78
79
79
80
after_success :
80
81
- coveralls
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # Run the examples. Doesn't run Jupyter notebooks.
3
+
4
+ # The examples must cooperate: they must have no operations that wait
5
+ # on user action, like matplotlib.pyplot.show, or starting a GUI event
6
+ # loop. Environment variable PYCONTROL_TEST_EXAMPLES is set when the
7
+ # examples are being tested; existence of this variable should be used
8
+ # to prevent such user-action-waiting operations.
9
+
10
+ export PYCONTROL_TEST_EXAMPLES=1
11
+
12
+ example_errors=" "
13
+
14
+ for example in * .py; do
15
+ echo " Running ${example} "
16
+ if ! python ${example} ; then
17
+ example_errors=" ${example_errors} ${example} "
18
+ fi
19
+ done
20
+
21
+ if [ -n " ${example_errors} " ]; then
22
+ echo These examples had errors:
23
+ echo " ${example_errors} "
24
+ exit 1
25
+ else
26
+ echo All examples ran successfully
27
+ fi
You can’t perform that action at this time.
0 commit comments