#!/bin/sh for i in 1 2 3 4 do if [ ! -r tests/$i.input ] then echo Missing test $i continue fi for op in add trans mul do if [ ! -r tests/$i.$op.expected ] then echo No expected output for test $i.$op continue fi ./mm $op < tests/$i.input > tests/$i.$op.observed res=`diff -bq tests/$i.$op.expected tests/$i.$op.observed` if [ -z "$res" ] then echo Test $i.$op passed else echo Test $i.$op FAILED fi done done