#!/bin/csh

# look for test case files in current directory or in any sub-directories
# this facilitates linking to additional test cases

@ Right = 0
@ Wrong = 0
foreach file ($dir_data/NO/N*)
    echo ""
    echo $file
    perf < $file $1 $2
    @ ret = $status
    if ($ret) then
	echo "N Pass $ret"
	@ Right ++
    else
	echo "N Fail $ret"
	@ Wrong ++
	exit 1
    endif
end

foreach file ($dir_data/YES/Y*)
    echo ""
    echo $file
    perf < $file $1 $2
    @ ret = $status
    if ($ret) then
	echo "Y Fail $ret"
	@ Wrong ++
	exit 1
    else
	echo "Y Pass $ret"
	@ Right ++
    endif
end

echo $Right right
echo $Wrong wrong
if ( $Wrong == 0 ) then
    echo "=== All tests passed ==="
