#!/bin/sh
# Run the upstream Octave test suite.
set -e

cd mha/mhatest

# The rohBeam plugin is not built on PowerPC so drop the test.
# (see debian/patches/0006-build-don-t-build-rohBeam-plugin-on-powerpc.patch)
case "$(dpkg --print-architecture)" in
  ppc*|powerpc*)
    rm -f test_rohbeam.m
    ;;
esac

octave --no-gui --no-window-system --eval "\
  pkg load signal; \
  addpath(pwd); \
  addpath(fullfile(pwd, '..', 'tools', 'mfiles')); \
  exit(~run_mha_tests(pwd));"
