Set up scratch directory for tests.
authorMartin Pool <mbp@samba.org>
Fri, 17 Aug 2001 01:44:13 +0000 (01:44 +0000)
committerMartin Pool <mbp@samba.org>
Fri, 17 Aug 2001 01:44:13 +0000 (01:44 +0000)
.cvsignore
Makefile.in
testsuite/master.test

index 86b08b5..7e45f31 100644 (file)
@@ -5,4 +5,5 @@ config.h
 config.log
 config.status
 rsync
 config.log
 config.status
 rsync
+testdir
 zlib/dummy
 zlib/dummy
index ee6b5c4..7e3df79 100644 (file)
@@ -92,4 +92,4 @@ finddead:
 test: check
 
 check:
 test: check
 
 check:
-       rsync_bin=`pwd`/rsync srcdir="$(srcdir)" $(srcdir)/testsuite/master.test
+       rsync_bin=`pwd`/rsync srcdir="$(srcdir)" testdir=`pwd`/testdir $(srcdir)/testsuite/master.test
index 4f9f286..2260386 100755 (executable)
 # build scripts.  It might be relative, so we need to make it
 # absolute.
 
 # build scripts.  It might be relative, so we need to make it
 # absolute.
 
+# testdir is a scratch directory for holding temporary test files.
+
 # The pwd is undefined when this script starts.
 
 # The pwd is undefined when this script starts.
 
+set -e
+
+if ! [ -d "$testdir" ] && ! mkdir "$testdir"
+then
+    echo "warning: testdir $testdir is not a directory!" >&2
+    exit 1
+fi
+
+testdir=`cd $testdir && pwd`
+
 srcdir=`cd $srcdir && pwd`
 
 echo "============================================================"
 echo "$0 running in `pwd`"
 echo "    rsync_bin=$rsync_bin"
 echo "    srcdir=$srcdir"
 srcdir=`cd $srcdir && pwd`
 
 echo "============================================================"
 echo "$0 running in `pwd`"
 echo "    rsync_bin=$rsync_bin"
 echo "    srcdir=$srcdir"
-
-set -e
+echo "    testdir=$testdir"
 
 test_names="rsync-hello hands"
 
 
 test_names="rsync-hello hands"