#!/bin/bash
#$Id: test-brkpt,v 1.3 2008/10/18 19:49:34 rockyb Exp $
# -*- shell-script -*-

[ -z "$srcdir" ] && srcdir=$PWD
[ -z "$builddir" ] && builddir=$PWD

if test -z $top_builddir ; then
  top_builddir=../..
fi

. ${top_builddir}/test/integration/check-common.sh

tests=${@:-"brkpt1 brkpt2 brkpt3"}
for SUBTEST in $tests ; do
  echo "checking $SUBTEST..."
  TEST_NAME=$SUBTEST

. ${top_builddir}/test/integration/check-common.sh
  TEST_FILE="${top_builddir}/test/${TEST_NAME}.check"
  RIGHT_FILE="${top_srcdir}/test/data/${TEST_NAME}.right"
  (cd $top_builddir/test/integration && $SH ${TEST_NAME}.tests > $TEST_FILE 2>&1 < /dev/null)
  check_output $TEST_FILE $RIGHT_FILE
  rc=$?
  if test $rc -eq 0  ; then 
    rm -f $TEST_FILE
  else
    exit $rc
  fi
done

# Return code tells testing mechanism whether passed or not.
exit 0
