]> diplodocus.org Git - nmh/blobdiff - test/mhparam/test-mhparam
Suppress getcanon exit status check.
[nmh] / test / mhparam / test-mhparam
index 8a48b8de264227c587a10258866a9b8cadbbc95a..a2130ba7f08655223e14589728165837d72ca06a 100755 (executable)
@@ -16,6 +16,9 @@ fi
 
 setup_test
 
+check_exit '-eq 1' mhparam -
+check_exit '-eq 0' mhparam localmbox
+
 expected=$MH_TEST_DIR/$$.expected
 expected_err=$MH_TEST_DIR/$$.expected_err
 actual=$MH_TEST_DIR/$$.actual
@@ -33,8 +36,9 @@ Usage: mhparam [profile-components] [switches]
   -(debug)
 EOF
 
-mhparam -help >$actual 2>&1
-check $expected $actual
+#### Skip nmh intro text.
+mhparam -help | sed '/^$/,$d' >"$actual" 2>&1
+check "$expected" "$actual"
 
 # check -version
 case `mhparam -v` in
@@ -48,8 +52,9 @@ run_test 'mhparam -nonexistent' 'mhparam: -nonexistent unknown'
 
 # check -all
 cp "$MH" $expected
-# -all adds current folder
+# -all adds current folder and Version
 echo 'Current-Folder: '`folder -f` >>$expected
+echo "Version: nmh-$MH_VERSION" >>$expected
 run_prog mhparam -all >$actual
 check $expected $actual 'keep first'
 
@@ -84,18 +89,18 @@ $MH_INST_DIR$bindir/refile
 700
 $bindir/inc
 more
-$bindir/mhmail
+$MH_INST_DIR$bindir/mhmail
 $MH_INST_DIR$nmhlibexecdir/mhl
 cat
 600
 $bindir/packf
 $MH_INST_DIR$nmhlibexecdir/post
-$bindir/send
-$bindir/mhshow
+$MH_INST_DIR$bindir/send
+$MH_INST_DIR$bindir/mhshow
 $MH_INST_DIR$nmhlibexecdir/mhl
-nmh-`cat ${srcdir}/VERSION`
-$bindir/whatnow
-$bindir/whom
+nmh-$MH_VERSION
+$MH_INST_DIR$bindir/whatnow
+$MH_INST_DIR$bindir/whom
 $nmhetcdirinst
 $MH_LIBEXEC_DIR
 fcntl
@@ -160,6 +165,17 @@ mhparam path context nonexistent1 nonexistent2 nonexistent3 >/dev/null
 run_test "echo $?" 3
 set -e
 
+# And clips their numbers to avoid a misleading exit value.
+while read use want; do
+    r=0
+    mhparam `yes nonexistent | sed ${use}q` || r=$?
+    run_test "echo $r" $want
+done <<\E
+119 119
+120 120
+121 120
+E
+
 # mhparam -debug
 # Some of its output depends on configure options, so don't bother to
 # check for correctness here.