#bin/bash

SUMMARY=$"PASS: All errors generated" 

for i in $(\ls errors)
do
   ERROR=$(  ./yappl < errors/$i  2>&1 1>/dev/null) 
   RESULT=$(echo $ERROR $i | grep -v error)

   if [ $RESULT ] 
   then
     echo "Error not generated by : " $RESULT
     SUMMARY=$"FAIL: some errors not generated."
   fi
   unset RESULT    
done

echo $SUMMARY
