--- /dev/null
+nmh unit test suite.
+
+The purpose of these tests is to verify the functionality of the nmh
+commands. The goal of the suite is to create an environment where testing
+nmh commands is easy and useful. Each test is a shell script, and is
+launched via the 'sh' command.
+
+The Suite is arranged as such:
+
+setup-test
+ Create the unit test framework. This will re-generate your configure
+ script and make files.
+
+teardown-test
+ Remove the temporary files created as part of the unit tests.
+
+runtest
+ Run a single test.
+
+runalltests
+ Run all tests in the suite
+
+tests
+ Directory containing the tests. All files found in this and all
+ subsequent directories which have the name test-* will be treated as a
+ single test.
+
+Complex tests may be given their own directory as long as there is a file
+named 'test-*' in the directory which will launch the test.
--- /dev/null
+#!/bin/sh
+
+for i in `find tests -name 'test-*' -type f`;
+do
+ ./runtest $i
+done
--- /dev/null
+#!/bin/sh
+
+export MH=`cat test-temp-dir`/mh_profile
+export MH_TEST_DIR=`cat test-temp-dir`
+export PATH=$MH_TEST_DIR/bin:$PATH
+
+/bin/sh $1
+
+return_value=$?
+
+if [ $return_value -eq 0 ] ; then
+ echo Test $1 PASS
+else
+ echo Test $1 FAIL
+fi
--- /dev/null
+#!/bin/sh
+
+TEMPDIR=`mktemp -d /tmp/nmh-test-XXXXXXXX`
+echo $TEMPDIR > test-temp-dir
+
+pushd ..
+aclocal
+autoheader
+autoconf
+./configure --prefix=$TEMPDIR --with-locking=fcntl
+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
--- /dev/null
+#!/bin/sh
+
+rm -rf `cat test-temp-dir`
+rm -f test-temp-dir
--- /dev/null
+/tmp/nmh-test-rWzU1325
--- /dev/null
+#!/bin/sh
+######################################################
+#
+# Test the creation and removal of a folder.
+#
+######################################################
+
+BINDIR=$MH_TEST_DIR/bin
+
+
+folder -create +testfolder > /dev/null
+if [ ! -d "$MH_TEST_DIR/Mail/testfolder" ]; then
+ exit 1
+fi
+
+rmf +testfolder > /dev/null
+if [ -d "$MH_TEST_DIR/Mail/testfolder" ]; then
+ # Test failed
+ exit 1
+fi
--- /dev/null
+#!/bin/sh
+######################################################
+#
+# Test the -total switch
+#
+######################################################
+
+BINDIR=$MH_TEST_DIR/bin
+
+
+output=`folder -total +inbox`
+if test x"$output" != x'TOTAL = 10 messages in 1 folder.' ; then
+ exit 1
+fi
--- /dev/null
+#!/bin/sh
+
+exit 1
--- /dev/null
+#!/bin/sh
+
+expected_text=" 1 09/29*Test1 Testing message 1<<This is message number 1 >>
+ 2 09/29*Test2 Testing message 2<<This is message number 2 >>
+ 3 09/29*Test3 Testing message 3<<This is message number 3 >>
+ 4 09/29*Test4 Testing message 4<<This is message number 4 >>
+ 5 09/29*Test5 Testing message 5<<This is message number 5 >>
+ 6 09/29*Test6 Testing message 6<<This is message number 6 >>
+ 7 09/29*Test7 Testing message 7<<This is message number 7 >>
+ 8 09/29*Test8 Testing message 8<<This is message number 8 >>
+ 9 09/29*Test9 Testing message 9<<This is message number 9 >>
+ 10 09/29*Test10 Testing message 10<<This is message number 10 >>"
+
+output=`scan -width 80 +inbox`
+
+if test x"$output" != x"$expected_text" ; then
+ exit 1
+fi