#! /bin/sh
# defs -- Defines for Natch testing environment.
#
# Copyright (c) 2000, 2001 by Pascal Wassong All Rights Reserved.
#
# Time-stamp: <2001-12-23 15:06:33 Pascal>
#
# This file is part of Natch.
#
# Natch is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Natch is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#


# Make sure srcdir is an absolute path.  Supply the variable
# if it does not exist.  We want to be able to run the tests
# stand-alone.
srcdir=${srcdir-.}
test -f $srcdir/defs || {
   echo "defs: installation error" 1>&2
   exit 1
}

# If srcdir or top_builddir are relative, we need to modify them.
case "$srcdir" in
    /* | [A-Za-z]:\\*) ;;
    *) srcdir=`\cd ${srcdir} && pwd` ;;
esac

case "$top_builddir" in
    /* | [A-Za-z]:\\*) ;;
    *) top_builddir=`\cd ${top_builddir-..} && pwd` ;;
esac

progname=`echo "$0" | sed 's,^.*/,,'`
testname=`echo "$progname" | sed 's,-.*$,,'`
testsubdir=${testsubdir-testSubDir}

# User can set VERBOSE to prevent output redirection
case x$VERBOSE in
    xNO | xno | x0 | x )
	exec > /dev/null 2>&1
	;;
esac

rm -rf ${testsubdir} > /dev/null 2>&1
mkdir ${testsubdir}
cd ${testsubdir} \
    || { echo "Cannot make or change into $testsubdir"; exit 1; }

PATH=${top_builddir}/src:$PATH
NATCH=

echo "=== Running test $progname"
