#!/bin/sh
# Run the tests in each of the subdirectories.

. ./handle_options

failures=""
for dir in *
do
	if test -d $dir -a -x $dir/runtests
	then
		cd $dir
		# we need to use `eval' here to get the quoting right in
		# the case when $fflag or $cflag contains embedded spaces
		if eval ./runtests $jfactor $gflag $fflag $cflag
		then
			true
		else
			failures="$failures $dir"
		fi
		cd ..
	fi
done

if test "$failures" = ""
then
	echo "all tests have succeeded"
	exit 0
else
	echo "some tests have failed in: $failures"
	exit 1
fi
