#!/bin/sh

exec 2>&1

set -e

test_executables_eus() {
    export EXIT_STATUS=0;

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

        eusgl $test_l;
        export TMP_EXIT_STATUS=$?

        export EXIT_STATUS=`expr $TMP_EXIT_STATUS + $EXIT_STATUS`;
    done;
    echo "Exit status : $EXIT_STATUS";

    assertEquals "0" "$EXIT_STATUS"
}

test_eusjpeg() {
    # if eusrt.l is not exists, it fails before print *user*
    name=$( eusgl '(progn (load (format nil "~A/lisp/image/jpeg/eusjpeg.l" *eusdir*))(image::write-jpeg-file "test.jpg" (instance color-image24 :init 100 100)) (print *user*) (unix::exit))' )
    assertNotEquals "" "$name"
}

. shunit2
