forked from NCAS-CMS/cf-python
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_tutorial_code
More file actions
executable file
·44 lines (35 loc) · 858 Bytes
/
test_tutorial_code
File metadata and controls
executable file
·44 lines (35 loc) · 858 Bytes
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
#!/bin/bash
# --------------------------------------------------------------------
# Test the code examples found in tutorial.rst and field_analysis.rst
#
# Call as:
#
# $ ./test_tutorial_code
#
# Returns non-zero return code if any tutorial code did not work
# --------------------------------------------------------------------
set -x
echo PYTHONPATH=$PYTHONPATH
d=$PWD
cd docs/source
pwd
python extract_tutorial_code.py tutorial.rst field_analysis.rst
ls -l tutorial.py field_analysis.py
./reset_test_tutorial
cd test_tutorial
pwd
python ../tutorial.py
rc=$?
if [[ $rc != 0 ]]; then
echo "Runtime failure in tutorial.py"
exit $rc
fi
python ../field_analysis.py
rc=$?
if [[ $rc != 0 ]]; then
echo "Runtime failure in field_analysis.py"
exit $rc
fi
cd $d
echo "tutorial.rst and field_analysis.rst code ran successfully"
set +x