* docs/MAIL.FILTERING: added note on removing procmail -f or
[mmh] / test / setup-test
index d197295..a99c6c7 100755 (executable)
@@ -1,30 +1,24 @@
 #!/bin/sh
 
+set -e
+
+if TEMPDIR=`cat test-temp-dir 2> /dev/null` \
+   && [ -e $TEMPDIR/bld/Makefile ]; then
+    (cd $TEMPDIR/bld && make all install)
+    exit
+fi
+
 TEMPDIR=`mktemp -d /tmp/nmh-test-XXXXXXXX`
 echo $TEMPDIR > test-temp-dir
 
-pushd ..
-aclocal
-autoheader
-autoconf
-./configure --prefix=$TEMPDIR --with-locking=fcntl
+cd ..
+if ! [ -e configure ]; then
+    ./autogen.sh
+fi
+srcdir=$PWD
+mkdir $TEMPDIR/bld
+cd $TEMPDIR/bld
+$srcdir/configure --prefix=$TEMPDIR --with-locking=fcntl --enable-debug
 make install
 
 echo "Path: $TEMPDIR/Mail" > $TEMPDIR/mh_profile
-mkdir $TEMPDIR/Mail
-
-MH=$TEMPDIR/mh_profile $TEMPDIR/bin/folder -create +inbox
-
-for i in `seq 1 10`;
-do
-    cat > $TEMPDIR/Mail/inbox/$i <<EOF
-From: Test$i <test$i@example.com>
-To: Some User <user@example.com>
-Date: Fri, 29 Sep 2006 00:00:00
-Subject: Testing message $i
-
-This is message number $i
-EOF
-done
-
-popd