#!/bin/sh 

rm -rf allout.cn allout.sha

./.runall clean
./.runall setup

UID=`id | sed -e 's/ .*//' | sed -e 's/.*(//' | sed -e 's/)//'`
if [ $UID = "mei" ]; then
    ABAC_PROVER_PATH="../../../libabac"
    else
    ABAC_PROVER_PATH=`which abac_prover_yap | sed 's/\/abac_prover_yap//'`
fi
export ABAC_PROVER_PATH

echo '\n'
echo 'running libabac CREDDY/ABAC_PROVER_YAP testing...'
echo '  ---with sha'
env ./.runall run 1> allout.sha 2>/dev/null
echo '  ---with cn'
env ABAC_CN=1 ./.runall run 1> allout.cn 2>/dev/null
result=`diff allout.cn allout.save`

if [ "$result" = "" ]; then
   echo "   PASSED"
else
   echo "   ERROR:got changes!!!"
fi
