2 ######################################################
6 ######################################################
10 if test -z "${MH_OBJ_DIR}"; then
11 srcdir
=`dirname $0`/..
/..
12 MH_OBJ_DIR
=`cd $srcdir && pwd`; export MH_OBJ_DIR
15 .
"$MH_OBJ_DIR/test/common.sh"
19 expected
=$MH_TEST_DIR/$$.expected
20 expected_err
=$MH_TEST_DIR/$$.expected_err
21 actual
=$MH_TEST_DIR/$$.actual
22 actual_err
=$MH_TEST_DIR/$$.actual_err
27 Usage: mhparam [profile-components] [switches]
36 #### Skip nmh intro text.
41 mhparam
-help | sed '/^$/Q'
43 mhparam
-help | sed '/^$/Q' >"$actual" 2>&1
44 check
"$expected" "$actual"
49 * ) echo "$0: mhparam -v generated unexpected output" 1>&2
50 failed
=`expr ${failed:-0} + 1`;;
53 # check unknown option
54 run_test
'mhparam -nonexistent' 'mhparam: -nonexistent unknown'
58 # -all adds current folder
59 echo 'Current-Folder: '`folder -f` >>$expected
60 run_prog mhparam
-all >$actual
61 check
$expected $actual 'keep first'
63 # check -all with a component
64 echo 'mhparam: profile-components ignored with -all' >$expected_err
65 run_prog mhparam
-all path
>$actual 2>$actual_err
66 check
$expected $actual 'keep first'
67 check
$expected_err $actual_err
69 # check -all with -components
70 echo 'mhparam: -components ignored with -all' >$expected_err
71 run_prog mhparam
-all -components >$actual 2>$actual_err
72 check
$expected $actual
73 check
$expected_err $actual_err
76 run_test
'mhparam path' "$MH_TEST_DIR/Mail"
78 # check more than one component, which enables -component
79 echo 'AliasFile: aliases' >>"$MH"
80 run_test
'mhparam path AliasFile' "path: $MH_TEST_DIR/Mail
83 # check each component in procs array in uip/mhparam.c
84 # The tests don't override these, so they're default or configured values.
85 # Note that cat is hardcoded here because the testsuite uses it for moreproc.
89 $MH_INST_DIR$bindir/mhbuild
90 $MH_INST_DIR$bindir/refile
94 $MH_INST_DIR$bindir/mhmail
95 $MH_INST_DIR$nmhlibexecdir/mhl
99 $MH_INST_DIR$nmhlibexecdir/post
100 $MH_INST_DIR$bindir/send
101 $MH_INST_DIR$bindir/mhshow
102 $MH_INST_DIR$nmhlibexecdir/mhl
103 nmh-`cat ${srcdir}/VERSION`
104 $MH_INST_DIR$bindir/whatnow
105 $MH_INST_DIR$bindir/whom
112 run_prog mhparam
-nocomponent \
135 spoollocking
>$actual 2>&1
137 check
$expected $actual
139 #### This exits with non-zero status, so let run_test squash that:
140 run_test
'mhparam formatproc rmmproc' ''
142 #### Test sbackup separately because it's only passed as a -D compile option.
143 case `mhparam sbackup` in
145 * ) echo mhparam sbackup failed
146 failed
=`expr ${failed:-0} + 1` ;;
150 run_test
'mhparam -component Path' "Path: $MH_TEST_DIR/Mail"
152 # check -component, note that component name of argument is echoed exactly
153 run_test
'mhparam -component path' "path: $MH_TEST_DIR/Mail"
154 run_test
'mhparam -component PATH' "PATH: $MH_TEST_DIR/Mail"
157 run_test
'mhparam -component -nocomponent path' "$MH_TEST_DIR/Mail"
158 run_test
'mhparam -nocomponent path AliasFile' "$MH_TEST_DIR/Mail
161 # check nonexistent component
162 run_test
'mhparam nonexistent' ''
164 # check that return status counts nonexistent components
166 mhparam path context nonexistent1 nonexistent2 nonexistent3
>/dev
/null
171 # Some of its output depends on configure options, so don't bother to
172 # check for correctness here.
173 mhparam
-debug >/dev
/null
175 # check with text file that does not end with newline
176 printf 'Editor: emacs' >>"$MH"
177 run_test
'mhparam -nocomponent editor' 'emacs'