#! /bin/csh
cd P2
set testpath = "$PWD/test/"
set tests = "5M4P3S2 associative massociative number parens pms_ops prescedence prescedence2 rightassociative simple stt_ops test1_normal test1_parens tsmm_ops adjops badop badparens nonassoc nooperator notoken"
make
cd src
set grade = 0
foreach t ($tests)
  java -classpath . edu.du.cs.comp3351.p2.Parser < $testpath/$t.in >& ../$t.out
  set test_passed = `diff $testpath/$t.want ../$t.out | wc -l`
  if ($test_passed == 0) then
     @ grade = $grade + 5
     echo "Test $t passed\!" 
  else
     echo "Test $t failed\!"
  endif
end
cd ../..
echo "GRADE: $grade"
