#!/bin/bash

# get test list from interface/tests/python/Makefile.am
TESTS="check_export.py                                  \
        check_global_functions.py                       \
        check_asm.py                                    \
        check_mixed_mesh.py                             \
        demo_wave.py                                    \
        demo_laplacian.py"

cd interface/tests/python

retval=0
for test in $TESTS; do
  echo -n "=== TESTING ${test} ... "
  if python3 $test >${test}.out 2>&1; then
    echo "ok"
  else
    err=$?
    echo "failed with error code $err"
    cat ${test}.out
    retval=$err
  fi
done

(exit $retval)
