Advertisement
brandizzi

Failing when missing output files

Aug 2nd, 2018
731
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. for l in examples/*.lox
  2. do
  3.   if [ -e $l.skip ]
  4.   then
  5.     echo SKIP $l
  6.     continue
  7.   elif [ ! -e $l.out ] || [ ! -e $l.err ]
  8.   then
  9.     echo missing $l.out or $l.err
  10.     exit 1
  11.   fi
  12.  
  13.   out=$(mktemp)
  14.   err=$(mktemp)
  15.   java -classpath target/classes/ br.com.brandizzi.adam.myjlox.Lox $l > $out 2> $err
  16.  
  17.   if ! diff $l.out $out
  18.   then
  19.     FAIL=1
  20.   fi
  21.  
  22.   if ! diff $l.err $err
  23.   then
  24.     FAIL=1
  25.   fi
  26.  
  27.   if [ "$FAIL" = "1" ]
  28.   then
  29.     echo "FAIL" $l
  30.   else
  31.     echo "PASS" $l
  32.   fi
  33. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement