Fix out-of-bounds error when incorporating email from stdin
[mmh] / test / setup-test
index fab26a0..ffd9e64 100755 (executable)
@@ -2,21 +2,25 @@
 
 set -e
 
-if TEMPDIR=`cat test-temp-dir 2> /dev/null` \
-   && [ -e $TEMPDIR/bld/Makefile ]; then
-    (cd $TEMPDIR/bld && make all install)
-    exit
+if TEMPDIR="`cat test-temp-dir 2>/dev/null`" \
+               && [ -f "$TEMPDIR/build/Makefile" ]; then
+       (cd "$TEMPDIR/build" && make all install)
+       exit
 fi
 
-TEMPDIR=`mktemp -d /tmp/nmh-test-XXXXXXXX`
-echo $TEMPDIR > test-temp-dir
+TEMPDIR="`mktemp -d /tmp/mmh-test-XXXXXXXX`"
+echo "$TEMPDIR" >test-temp-dir
 
 cd ..
-if ! [ -e configure ]; then
-    ./autogen.sh
+srcdir="$PWD"
+if [ ! -f configure ]; then
+       ./autogen.sh
 fi
-srcdir=$PWD
-mkdir $TEMPDIR/bld
-cd $TEMPDIR/bld
-$srcdir/configure --prefix=$TEMPDIR --with-locking=fcntl --enable-debug
-make install
+if [ -f Makefile ]; then
+       make -s clean
+fi
+
+mkdir "$TEMPDIR/build"
+cd "$TEMPDIR/build"
+"$srcdir/configure" -q --prefix="$TEMPDIR" --enable-debug
+make -s all install