brandizzi icon

Failing when missing output files

brandizzi | PRO | 08/02/18 11:15:52 AM UTC | 0 ⭐ | 1272 👁️ | Never ⏰ | []
Bash |

500 B

|

None

|

0 👍

/

0 👎

for l in examples/*.lox
do
  if [ -e $l.skip ]
  then
    echo SKIP $l
    continue
  elif [ ! -e $l.out ] || [ ! -e $l.err ]
  then
    echo missing $l.out or $l.err
    exit 1
  fi
 
  out=$(mktemp)
  err=$(mktemp)
  java -classpath target/classes/ br.com.brandizzi.adam.myjlox.Lox $l > $out 2> $err
 
  if ! diff $l.out $out
  then
    FAIL=1
  fi
 
  if ! diff $l.err $err
  then
    FAIL=1
  fi
 
  if [ "$FAIL" = "1" ]
  then
    echo "FAIL" $l
  else
    echo "PASS" $l
  fi
done

Comments