#! /bin/sh

set errors=0

dirs=`find * -maxdepth 0 -type d`

for d in $dirs ; do
  if [ $d != "CVS" ] ; then
    echo "Testing in $d"
    cd $d
    if [ -x ./testdir ] ; then
      ./testdir
    else
      ../testdir
    fi
    errors=$(( $errors + $? ))
    cd ..
  fi
done

echo $errors errors detected!
exit $errors

