]> diplodocus.org Git - nmh/blobdiff - test/install-mh/test-install-mh
Expanded allowed text in mhical parse error message.
[nmh] / test / install-mh / test-install-mh
index f8af2c9b9f4296c794bac3ff8a3dff92c6291e8b..7afe64b484de1a3706b596cfd81cc8f501560ba0 100755 (executable)
@@ -16,56 +16,64 @@ fi
 
 setup_test
 
 
 setup_test
 
+check_exit '-eq 1' install-mh -
+
 # check with no options, with nmh already installed
 # check with no options, with nmh already installed
+start_test "with no options, with nmh already installed"
 run_test "install-mh" \
     'install-mh: You already have an nmh profile, use an editor to modify it'
 
 # check -auto, with nmh already installed
 run_test "install-mh" \
     'install-mh: You already have an nmh profile, use an editor to modify it'
 
 # check -auto, with nmh already installed
+start_test "-auto, with nmh already installed"
 run_test "install-mh -auto" 'install-mh: invocation error'
 
 # check -check, with nmh already installed
 run_test "install-mh -auto" 'install-mh: invocation error'
 
 # check -check, with nmh already installed
+start_test "-check, with nmh already installed"
 run_test "install-mh -check" ''
 # make sure exit status is 0
 run_test "install-mh -check" ''
 # make sure exit status is 0
-install-mh -check
+run_prog install-mh -check
 run_test "echo $?" '0'
 
 # Remove the nmh installation so that install-mh can install.
 rm -rf $MH_TEST_DIR/Mail
 
 # check -check, with nmh not installed
 run_test "echo $?" '0'
 
 # Remove the nmh installation so that install-mh can install.
 rm -rf $MH_TEST_DIR/Mail
 
 # check -check, with nmh not installed
+start_test "-check, with nmh not installed"
 run_test "install-mh -check" ''
 # make sure exit status is 1
 set +e
 run_test "install-mh -check" ''
 # make sure exit status is 1
 set +e
-install-mh -check
+run_prog install-mh -check
 run_test "echo $?" '1'
 set -e
 
 # check with no options, with nmh not installed.  Use canned
 run_test "echo $?" '1'
 set -e
 
 # check with no options, with nmh not installed.  Use canned
+start_test "with no options, with nmh not installed.  Use canned"
 # responses to install.
 installpath=`echo $MH_TEST_DIR/Mail | sed 's%^/%%'`
 echo "n
 n
 n
 $installpath
 # responses to install.
 installpath=`echo $MH_TEST_DIR/Mail | sed 's%^/%%'`
 echo "n
 n
 n
 $installpath
-y" | install-mh >/dev/null
+y" | run_prog install-mh >/dev/null
 
 
-if [ -f $MH_TEST_DIR/Mail/context  -a  -f $MH_TEST_DIR/Mail/.mh_profile ]; then
-  install-mh -check
+if [ -f $MH_TEST_DIR/Mail/context  -a  -f "$MH" ]; then
+  run_prog install-mh -check
 else
   failed=`expr ${failed:-0} + 1`
 fi
 
 # Remove the nmh installation so that install-mh -auto can install.
 else
   failed=`expr ${failed:-0} + 1`
 fi
 
 # Remove the nmh installation so that install-mh -auto can install.
+# And set HOME to that it installs in the test directory:
+# install-mh -auto does a chdir($HOME).
 rm -rf $MH_TEST_DIR/Mail
 rm -rf $MH_TEST_DIR/Mail
-echo "n
-n
-$installpath" | install-mh -auto >/dev/null
+HOME=$MH_TEST_DIR install-mh -auto >/dev/null
 
 
-if [ -f $MH_TEST_DIR/Mail/context  -a  -f $MH_TEST_DIR/Mail/.mh_profile ]; then
-  install-mh -check
+if [ -f $MH_TEST_DIR/Mail/context  -a  -f "$MH" ]; then
+  run_prog install-mh -check
 else
   failed=`expr ${failed:-0} + 1`
 fi
 
 
 else
   failed=`expr ${failed:-0} + 1`
 fi
 
 
+finish_test
 exit $failed
 exit $failed