#! /bin/sh

nsgmls=${NSGMLS:-`pwd`/build.gcc/nsgmls/nsgmls}
cd test

for d in badrast difrast
do
	rm -fr $d/*
	test -d $d || mkdir $d
done

SGML_CATALOG_FILES=CATALOG
export SGML_CATALOG_FILES

for file in *.sgm
do
	echo $file
	$nsgmls -t badrast/$file $file 2>/dev/null
	if diff -c rast/$file badrast/$file >difrast/$file
	then
		rm badrast/$file difrast/$file
	else
		echo RAST for $file differs
	fi
done
