#! /bin/sh

# This script runs each of the tools test scripts and reports the results

# Copyright © 2005-2008 Brendt Wohlberg <photoml@wohlberg.net>
# Please see the PhotoML distribution LICENCE file for licence information

# Most recent modification: 4 June 2008

tn=0
fn=0
echo Tool tests
for t in *.sh; do
  tb=`basename $t .sh`
  printf "Test $tb \t"
  if ! sh $t s; then
    printf "\t failed\n"
    fn=`expr $fn + 1`
  else
    printf "\t passed\n"
  fi
  tn=`expr $tn + 1`
done
echo "Failed $fn out of $tn tests"

if [ "$fn" -gt 0 ]; then
  exit 1
else
  exit 0
fi
