#!/bin/sh

set -e

at_exit() {
    echo "info: test exiting"
}

trap at_exit INT TERM EXIT

cd $AUTOPKGTEST_TMP
retval=0

cat <<EOF > test.nxc
task main() {
}
EOF

if $VALGRIND nbc -L=test.out test.nxc; then
    echo "success: compiling with target $target worked"
else
    echo "failure: compiling with target $target returned error"
    retval=1
fi

exit $retval
