#!/bin/sh set -e # Name of this script script=`basename "$0"` # Handle case of manually running this script if [ "$AUTOPKGTEST_TMP" = "" ]; then AUTOPKGTEST_TMP=`mktemp -d --tmpdir "$script"-XXX`; echo "AUTOPKGTEST_TMP is $AUTOPKGTEST_TMP"; fi if [ "$ADT_ARTIFACTS" = "" ] ; then ADT_ARTIFACTS=${AUTOPKGTEST_TMP}/artifacts fi mkdir -p "${AUTOPKGTEST_TMP}" mkdir -p "${ADT_ARTIFACTS}" # Save current directory (must be top of source tree) SRC_ROOT=`pwd` # Setup Python example tree structure mkdir -p ${AUTOPKGTEST_TMP}/doc cp -a doc/examples ${AUTOPKGTEST_TMP}/doc/ mkdir -p ${AUTOPKGTEST_TMP}/python cd ${AUTOPKGTEST_TMP}/python echo "backend : PDF" > matplotlibrc cp ${SRC_ROOT}/plugins/python/doc/examples/* ./ cp ${SRC_ROOT}/python/example.py ./ # Get list of Python examples BASE_NAMES=`basename -s.xml *.xml` # Build Gyoto command line GYOTO="/usr/bin/gyoto --nprocesses=0 --nthreads=1 --resolution=32" # Run each example in this environment for python in python3 `py3versions -s` ; do echo "**** Testing Python version: $python ****" unset GYOTO_PLUGINS $python example.py ; $python test.py ; mkdir -p ${ADT_ARTIFACTS}/$python export GYOTO_PLUGINS=$python,stdplug for base in ${BASE_NAMES} ; do ${GYOTO} \ ${base}.xml \ \!${ADT_ARTIFACTS}/${python}/${base}.fits ; done ; done exit 0