Fix spelling and encoding errors in manpages and an error message
[mmh] / test / setup-test
index d197295..ffd9e64 100755 (executable)
@@ -1,30 +1,26 @@
 #!/bin/sh
 
-TEMPDIR=`mktemp -d /tmp/nmh-test-XXXXXXXX`
-echo $TEMPDIR > test-temp-dir
+set -e
 
-pushd ..
-aclocal
-autoheader
-autoconf
-./configure --prefix=$TEMPDIR --with-locking=fcntl
-make install
+if TEMPDIR="`cat test-temp-dir 2>/dev/null`" \
+               && [ -f "$TEMPDIR/build/Makefile" ]; then
+       (cd "$TEMPDIR/build" && make all install)
+       exit
+fi
 
-echo "Path: $TEMPDIR/Mail" > $TEMPDIR/mh_profile
-mkdir $TEMPDIR/Mail
+TEMPDIR="`mktemp -d /tmp/mmh-test-XXXXXXXX`"
+echo "$TEMPDIR" >test-temp-dir
 
-MH=$TEMPDIR/mh_profile $TEMPDIR/bin/folder -create +inbox
+cd ..
+srcdir="$PWD"
+if [ ! -f configure ]; then
+       ./autogen.sh
+fi
+if [ -f Makefile ]; then
+       make -s clean
+fi
 
-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
+mkdir "$TEMPDIR/build"
+cd "$TEMPDIR/build"
+"$srcdir/configure" -q --prefix="$TEMPDIR" --enable-debug
+make -s all install