WS='generate hanoi pi xref'

case $1 in
local)	abc=../abc;;
*)	abc=abc;;
esac

for ws in $WS
do
	echo " "
	echo "Testing $ws example ..."
	echo " "
	$abc -W `pwd` -w $ws <$ws.in | tee out
	echo " "
	if cmp -s out $ws.out
	then
		echo "... $ws example OK ..."
	else
		echo "... $ws example NOT OK ..."
		echo "Differences: <is >should-be"
		diff out $ws.out
	fi
	echo " "
	echo "... $ws example done"
done

echo " "
case $1 in
local)	echo "If all examples were OK, try the ABC editor with 'make try_editor'.";;
*)	echo "If all examples were OK, try the ABC editor with TryEditor.";;
esac
