Debian Codegraph @

debian/tests/python-gyoto

raw
1 #!/bin/sh
2 set -e
3
4 # Name of this script
5 script=`basename "$0"`
6
7 # Handle case of manually running this script
8 if [ "$AUTOPKGTEST_TMP" = "" ]; then
9 AUTOPKGTEST_TMP=`mktemp -d --tmpdir "$script"-XXX`;
10 echo "AUTOPKGTEST_TMP is $AUTOPKGTEST_TMP";
11 fi
12 if [ "$ADT_ARTIFACTS" = "" ] ; then
13 ADT_ARTIFACTS=${AUTOPKGTEST_TMP}/artifacts
14 fi
15 mkdir -p "${AUTOPKGTEST_TMP}"
16 mkdir -p "${ADT_ARTIFACTS}"
17
18 # Save current directory (must be top of source tree)
19 SRC_ROOT=`pwd`
20
21 # Setup Python example tree structure
22 mkdir -p ${AUTOPKGTEST_TMP}/doc
23 cp -a doc/examples ${AUTOPKGTEST_TMP}/doc/
24 mkdir -p ${AUTOPKGTEST_TMP}/python
25 cd ${AUTOPKGTEST_TMP}/python
26 echo "backend : PDF" > matplotlibrc
27 cp ${SRC_ROOT}/plugins/python/doc/examples/* ./
28 cp ${SRC_ROOT}/python/example.py ./
29
30 # Get list of Python examples
31 BASE_NAMES=`basename -s.xml *.xml`
32
33 # Build Gyoto command line
34 GYOTO="/usr/bin/gyoto --nprocesses=0 --nthreads=1 --resolution=32"
35
36 # Run each example in this environment
37 for python in python3 `py3versions -s` ; do
38 echo "**** Testing Python version: $python ****"
39 unset GYOTO_PLUGINS
40 $python example.py ;
41 $python test.py ;
42 mkdir -p ${ADT_ARTIFACTS}/$python
43 export GYOTO_PLUGINS=$python,stdplug
44 for base in ${BASE_NAMES} ; do
45 ${GYOTO} \
46 ${base}.xml \
47 \!${ADT_ARTIFACTS}/${python}/${base}.fits ;
48 done ;
49 done
50
51 exit 0