#!/bin/sh

set -e

this=why+cvc3
indir=debian/tests/why
outdir=${ADT_ARTIFACTS}/${this}
mkdir -p ${outdir}

for infile in $indir/*.why
do
    base=$(basename $infile)
    whyoutfile=$outdir/${base%.why}_why.cvc
    cvcoutfile=$outdir/${base%.why}.cvcout
    why --cvcl --output $whyoutfile $infile
    cvc3 $whyoutfile | tee $cvcoutfile | grep -q "Valid" 
done
