#!/bin/sh
# Test whether the compiler is producing the right errors.
# Return a status of 0 (true) if everything is all right, and 1 otherwise.

. ../handle_options

mmake $jfactor realclean > /dev/null 2>&1
eval mmake -k $jfactor $gradeopt $flagsopt $cflagsopt check
checkstatus=$?

cat *.err_res > .allres
if test ! -s .allres -a "$checkstatus" = 0
then
	echo "the tests in the invalid directory succeeded"
	rm -f .allres
	exit 0
else
	echo "the tests in the invalid directory failed"
	echo "the differences are:"
	cat .allres
	exit 1
fi
