printf"$TESTNAME: Failure!\n(Check diff output for differences.)\n('<' indicates lines from $OUTFILE that do not appear in program output.)\n('>' indicates lines from program output that do not appear in $OUTFILE.)\n\n"
exit1
fi
elif[$RESULT -eq $MEMERR]
then
printf"$TESTNAME: Failure!\n(Memory leak detected, check program output for more information.)\n\n"
exit1
else
printf"$TESTNAME: Failure!\n(You did *not* specify an error file, $ERRFILE, signifying you wanted the program to succeed; however, the program failed with exit value $RESULT.)\n\n"
rm -f $TMPFILE
exit1
fi
else
test ! $QUIET&&printf"Found error file ($ERRFILE)!\n"
# Check for output file
if[ -f $OUTFILE]
then
printf"Warning: When checking for errors, output file ($OUTFILE) will be ignored!\n"
fi
# Run the test
if[$QUIET]
then
eval"$MEMCHK$PROGRAM$TESTFILE" 2> /dev/null
RESULT=$?
else
eval"$MEMCHK$PROGRAM$TESTFILE"
RESULT=$?
fi
# Check the result
if[$RESULT -eq 0]
then
printf"$TESTNAME: Failure!\n(You specified an error file, $ERRFILE, signifying you wanted the program to fail; however, the program did not fail.)\n\n"
exit1
elif[$RESULT -eq $MEMERR]
then
printf"$TESTNAME: Failure!\n(Memory leak detected, check program output for more information.)\n\n"
exit1
elif[$RESULT -eq $ERR]
then
test ! $QUIET&&printf"$TESTNAME: Success!\n\n"
exit0
else
printf"$TESTNAME: Failure!\n(Unknown exit code, check program output for more information.)\n\n"