# -*- shell-script -*-

# Ensure we are running from the right directory.
test -f ./defs || {
   echo "defs: not found in current directory" 1>&2
   exit 1
}

# If srcdir is not set, then we are not running from `make check', be verbose.
if test -z "$srcdir"; then
   test -z "$VERBOSE" && VERBOSE=x
   # compute $srcdir.
   srcdir=`echo "$0" | sed -e 's,/[^\\/]*$,,'`
   test $srcdir = $0 && srcdir=.
fi

# Always use an absolute srcdir.  Otherwise symlinks made in subdirs
# of the test dir just won't work.
case "$srcdir" in
 [\\/]* | ?:[\\/]*)
    ;;

 *)
    srcdir=`CDPATH=: && cd "$srcdir" && pwd`
    ;;
esac

# Ensure $srcdir is set correctly.
test -f $srcdir/defs.in || {
   echo "$srcdir/defs.in not found, check \$srcdir" 1>&2
   exit 1
}

# User can set VERBOSE to see all output.
test -z "$VERBOSE" && exec >/dev/null 2>&1

DOT=''


# Create a test subdirectory.

chmod -R a+rwx testSubDir > /dev/null 2>&1
rm -rf testSubDir > /dev/null 2>&1
mkdir testSubDir
cd testSubDir

echo "== Running test $0"

# Turn on shell traces when VERBOSE=x.
if test "x$VERBOSE" = xx; then
  set -x
else
  :
fi
