#!/bin/sh

exec 2>&1

set -e

eval $(dpkg-architecture)
case "${DEB_HOST_ARCH}" in
    amd64|i386|arm64)
        ;;
    *)
      echo "=="
      echo "=="
      echo "== Skip ${DEB_HOST_ARCH}"
      echo "=="
      echo "=="
      exit 0
    ;;
esac

test_executables_eus() {
    export EXIT_STATUS=0;

    eval "$(dpkg-architecture)"

    # run test in EusLisp/test
    for test_l in irteus/test/*.l; do

	echo "\e[33m;; irteusgl $test_l\e[0m"
        irteusgl "$test_l";
        export TMP_EXIT_STATUS=$?

        export EXIT_STATUS=$((TMP_EXIT_STATUS + EXIT_STATUS));
    done;
    echo "Exit status : $EXIT_STATUS";

    assertEquals "0" "$EXIT_STATUS"
}

. shunit2
