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 ! mhparam
- >/dev
/null
2>&1 # gcov
20 ! mhparam localmbox
>/dev
/null
2>&1 # gcov
22 expected
=$MH_TEST_DIR/$$.expected
23 expected_err
=$MH_TEST_DIR/$$.expected_err
24 actual
=$MH_TEST_DIR/$$.actual
25 actual_err
=$MH_TEST_DIR/$$.actual_err
30 Usage: mhparam [profile-components] [switches]
39 #### Skip nmh intro text.
40 mhparam
-help | sed '/^$/,$d' >"$actual" 2>&1
41 check
"$expected" "$actual"
46 * ) echo "$0: mhparam -v generated unexpected output" 1>&2
47 failed
=`expr ${failed:-0} + 1`;;
50 # check unknown option
51 run_test
'mhparam -nonexistent' 'mhparam: -nonexistent unknown'
55 # -all adds current folder and Version
56 echo 'Current-Folder: '`folder -f` >>$expected
57 echo "Version: nmh-$MH_VERSION" >>$expected
58 run_prog mhparam
-all >$actual
59 check
$expected $actual 'keep first'
61 # check -all with a component
62 echo 'mhparam: profile-components ignored with -all' >$expected_err
63 run_prog mhparam
-all path
>$actual 2>$actual_err
64 check
$expected $actual 'keep first'
65 check
$expected_err $actual_err
67 # check -all with -components
68 echo 'mhparam: -components ignored with -all' >$expected_err
69 run_prog mhparam
-all -components >$actual 2>$actual_err
70 check
$expected $actual
71 check
$expected_err $actual_err
74 run_test
'mhparam path' "$MH_TEST_DIR/Mail"
76 # check more than one component, which enables -component
77 echo 'AliasFile: aliases' >>"$MH"
78 run_test
'mhparam path AliasFile' "path: $MH_TEST_DIR/Mail
81 # check each component in procs array in uip/mhparam.c
82 # The tests don't override these, so they're default or configured values.
83 # Note that cat is hardcoded here because the testsuite uses it for moreproc.
87 $MH_INST_DIR$bindir/mhbuild
88 $MH_INST_DIR$bindir/refile
92 $MH_INST_DIR$bindir/mhmail
93 $MH_INST_DIR$nmhlibexecdir/mhl
97 $MH_INST_DIR$nmhlibexecdir/post
98 $MH_INST_DIR$bindir/send
99 $MH_INST_DIR$bindir/mhshow
100 $MH_INST_DIR$nmhlibexecdir/mhl
102 $MH_INST_DIR$bindir/whatnow
103 $MH_INST_DIR$bindir/whom
110 run_prog mhparam
-nocomponent \
133 spoollocking
>$actual 2>&1
135 check
$expected $actual
137 #### This exits with non-zero status, so let run_test squash that:
138 run_test
'mhparam formatproc rmmproc' ''
140 #### Test sbackup separately because it's only passed as a -D compile option.
141 case `mhparam sbackup` in
143 * ) echo mhparam sbackup failed
144 failed
=`expr ${failed:-0} + 1` ;;
148 run_test
'mhparam -component Path' "Path: $MH_TEST_DIR/Mail"
150 # check -component, note that component name of argument is echoed exactly
151 run_test
'mhparam -component path' "path: $MH_TEST_DIR/Mail"
152 run_test
'mhparam -component PATH' "PATH: $MH_TEST_DIR/Mail"
155 run_test
'mhparam -component -nocomponent path' "$MH_TEST_DIR/Mail"
156 run_test
'mhparam -nocomponent path AliasFile' "$MH_TEST_DIR/Mail
159 # check nonexistent component
160 run_test
'mhparam nonexistent' ''
162 # check that return status counts nonexistent components
164 mhparam path context nonexistent1 nonexistent2 nonexistent3
>/dev
/null
169 # Some of its output depends on configure options, so don't bother to
170 # check for correctness here.
171 mhparam
-debug >/dev
/null
173 # check with text file that does not end with newline
174 printf 'Editor: emacs' >>"$MH"
175 run_test
'mhparam -nocomponent editor' 'emacs'