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]
34 # The exit status is 1 with -help, so temporarily disable -e.
36 mhparam -help >$actual 2>&1
38 check $expected $actual
41 if mhparam -v | grep '^mhparam --' >/dev/null; then
44 echo "$0: mhparam -v generated unexpected output" 1>&2
45 failed=`expr ${failed:-0} + 1`
48 # check unknown option
49 run_test 'mhparam -nonexistent' 'mhparam: -nonexistent unknown'
52 cp $MH_TEST_DIR/Mail/.mh_profile $expected
53 # -all adds current folder
54 echo 'Current-Folder: '`folder -f` >>$expected
56 check $expected $actual 'keep first'
58 # check -all with a component
59 echo 'mhparam: profile-components ignored with -all' >$expected_err
60 mhparam -all path >$actual 2>$actual_err
61 check $expected $actual 'keep first'
62 check $expected_err $actual_err
64 # check -all with -components
65 echo 'mhparam: -components ignored with -all' >$expected_err
66 mhparam -all -components >$actual 2>$actual_err
67 check $expected $actual
68 check $expected_err $actual_err
71 run_test 'mhparam path' "$MH_TEST_DIR/Mail"
73 # check more than one component, which enables -component
74 echo 'AliasFile: aliases' >>"$MH_TEST_DIR/Mail/.mh_profile"
75 run_test 'mhparam path AliasFile' "path: $MH_TEST_DIR/Mail
78 # check each component in procs array in uip/mhparam.c
79 # The tests don't override these, so they're default or configured values.
84 $MH_INST_DIR$bindir/refile
87 $auxexecdir/install-mh
90 $MH_INST_DIR$auxexecdir/mhl
95 $MH_INST_DIR$auxexecdir/post
98 $MH_INST_DIR$auxexecdir/mhl
99 nmh-`cat ${srcdir}/VERSION`
107 mhparam -nocomponent \
133 check $expected $actual
135 #### This exits with non-zero status, so let run_test squash that:
136 run_test 'mhparam faceproc formatproc rmmproc' ''
138 #### test sbackup separately because it's only passed as a -D compile option
139 if mhparam sbackup | grep -F ',
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
168 # mhparam -debug (undocumented)
169 # Some of its output depends on configure options, so don't bother to
170 # check for correctness here.
171 mhparam -debug >/dev/null