Allow tests to indicate that they have been skipped by printing their
[mmh] / test / runtest
1 #!/bin/sh
2
3 export MH_TEST_DIR=`cat test-temp-dir`
4 export MH=$MH_TEST_DIR/mh_profile
5 export PATH=$MH_TEST_DIR/bin:$PATH
6
7 # clean old test data
8 rm -rf $MH_TEST_DIR/Mail
9 # setup test data
10 mkdir $MH_TEST_DIR/Mail
11 folder -create +inbox > /dev/null
12 # create 10 basic messages
13 for i in `seq 1 10`;
14 do
15     cat > $MH_TEST_DIR/Mail/inbox/$i <<EOF
16 From: Test$i <test$i@example.com>
17 To: Some User <user@example.com>
18 Date: Fri, 29 Sep 2006 00:00:00
19 Subject: Testing message $i
20
21 This is message number $i
22 EOF
23 done
24
25 # now run the test
26 /bin/sh $1
27
28 return_value=$?
29
30 if [ $return_value -eq 0 ] ; then
31     echo Test $1 PASS
32 elif [ $return_value -eq 120 ]; then
33     # indicates test was skipped (eg needed program not found)
34     # test itself should have printed a message about this,
35     # so print nothing here.
36     :
37 else
38     echo Test $1 FAIL
39 fi