#!/bin/csh

# This script will run all tests in The Menus Directory.

set TESTS = "Menu1 Menu2 Menu3 Menu4 Menu5 Menu6 Menu7 MenuBar1 MenuBar2 MenuBar3 MenuGad1 OptionMenu1 OptionMenu2 OptionMenu3 OptionMenu4 PopupMenu1 PopupMenu2 PopupMenu3 PopupMenu4 PopupMenu5 PopupMenu6 RowCol1 RowCol2"

if (-e ./failures) then
	echo "backing up failures file"
	mv failures failures.bak
endif

rm -f core
touch ./failures

RowCol3 -u xmBulletinBoardWidgetClass -I RowCol3a.Dat
  	if ($status != 0) then
		if (-e core) then
			echo "backing up core to "$test".core"
			mv core $test.core
		endif
		echo "failure in test: RowCol3 case a"
	 	echo "RowCol3 case a" >> failures
	endif

RowCol3 -u xmDrawingAreaWidgetClass -I RowCol3b.Dat
  	if ($status != 0) then
		if (-e core) then
			echo "backing up core to "$test".core"
			mv core $test.core
		endif
		echo "failure in test: RowCol3 case b"
	 	echo "RowCol3 case b" >> failures
	endif

RowCol3 -u xmFrameWidgetClass -I RowCol3c.Dat
  	if ($status != 0) then
		if (-e core) then
			echo "backing up core to "$test".core"
			mv core $test.core
		endif
		echo "failure in test: RowCol3 case c"
	 	echo "RowCol3 case c" >> failures
	endif

RowCol3 -u xmFormWidgetClass -I RowCol3d.Dat
  	if ($status != 0) then
		if (-e core) then
			echo "backing up core to "$test".core"
			mv core $test.core
		endif
		echo "failure in test: RowCol3 case d"
	 	echo "RowCol3 case d" >> failures
	endif

RowCol3 -u xmMainWindowWidgetClass -I RowCol3e.Dat
  	if ($status != 0) then
		if (-e core) then
			echo "backing up core to "$test".core"
			mv core $test.core
		endif
		echo "failure in test: RowCol3 case e"
	 	echo "RowCol3 case e" >> failures
	endif

foreach test ($TESTS)
	./$test
	if ($status != 0) then
		if (-e core) then
			echo "backing up core to "$test".core"
			mv core $test.core
		endif
		echo "failure in test: "$test
		echo $test >> failures
	endif
	
end
