#!/bin/bash

ATS=../../ATS

svn up $ATS

for i in `find $ATS -name "*.ttcn"`; do
    FILE=$(basename $i);
    if [[ "$FILE" =~ Neg.* ]]; then
       VERDICTLINE=`cat $i | grep @verdict`;
       if [[ ! $VERDICTLINE =~ .*reject.*  ]]; then
          echo "File with possibly inconsistent verdict description (negative check, but no reject)!"
          echo "    "$i
       fi;

    fi;

    if [[ ! "$FILE" =~ Neg.* ]]; then
       VERDICTLINE=`cat $i | grep @verdict`;
       if [[ $VERDICTLINE =~ .*reject.*  ]]; then
          echo "File with possibly inconsistent verdict description (positive, but reject)!"
          echo "    "$i
       fi;
    fi;
    
done;
