#!/bin/bash

source scripts/config

progpath=$1
shift
coption=$*

cp $progpath $checkdir

pushd $checkdir > /dev/null

heptprog=`basename $progpath`

echo $HEPTC $coption $heptprog
$HEPTC $coption $heptprog
res=$?
if [ $res = 0 ] ; then
    echo "ERROR : compilation of $progpath should have failed"
fi

popd $checkdir > /dev/null

if [ $res = 0 ] ; then
    exit 1
else
    exit 0
fi
