diff --git a/data/matplotlibrc b/data/matplotlibrc new file mode 100644 index 0000000000000000000000000000000000000000..737f9d466449c7a5d43d3fa9ad088445ac27f5b5 --- /dev/null +++ b/data/matplotlibrc @@ -0,0 +1,11 @@ +# This is configuration file for matplotlib used in examples. +# We use this configuration file to test the examples. Copy this configuration +# file in the current working directory and run the snippet. + +# This configuration file does the followings: +# - plt.show() function become non-blocking. + +backend = qt4agg + +# This makes all plots non-blocking. +interactive = True diff --git a/test_examples.sh b/test_examples.sh new file mode 100755 index 0000000000000000000000000000000000000000..bfa9d9a4fbb9aa427d49ed8e4e02f723f031bfab --- /dev/null +++ b/test_examples.sh @@ -0,0 +1,24 @@ +#!/bin/bash +set -e +declare -i a +PYC=`which python` +RUNDIR=./_test_dir_moose-examples_ +echo "Creating $RUNDIR" +mkdir -p $RUNDIR +MATPLOTRC=data/matplotlibrc +echo "copying examples out of source" +cp -r moose-examples/* $RUNDIR/ +PYFILES=`find $RUNDIR -name "*.py"` +for pyf in $PYFILES; do + let a=a+1 + dn=`dirname $pyf` + fn=`basename $pyf` + # copy matplotlibrc file to working directory + cp $MATPLOTRC $dn/ + ( + cd $dn + echo "Executing $fn in directory $dn" + $PYC $fn + ) +done +echo "Total $a scripts run"