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 invert it to prevent
35 # triggering immediate exit due to set -e.
36 ! mhparam -help >$actual 2>&1
37 check $expected $actual
40 if ! mhparam -v | grep '^mhparam --' >/dev/null; then
41 echo "$0: mhparam -v generated unexpected output" 1>&2
42 failed=`expr ${failed:-0} + 1`
45 # check unknown option
46 run_test 'mhparam -nonexistent' 'mhparam: -nonexistent unknown'
49 cp $MH_TEST_DIR/Mail/.mh_profile $expected
50 # -all adds current folder
51 echo 'Current-Folder: '`folder -f` >>$expected
53 check $expected $actual 'keep first'
55 # check -all with a component
56 echo 'mhparam: profile-components ignored with -all' >$expected_err
57 mhparam -all path >$actual 2>$actual_err
58 check $expected $actual 'keep first'
59 check $expected_err $actual_err
61 # check -all with -components
62 echo 'mhparam: -components ignored with -all' >$expected_err
63 mhparam -all -components >$actual 2>$actual_err
64 check $expected $actual
65 check $expected_err $actual_err
68 run_test 'mhparam path' "$MH_TEST_DIR/Mail"
70 # check more than one component, which enables -component
71 echo 'AliasFile: aliases' >>"$MH_TEST_DIR/Mail/.mh_profile"
72 run_test 'mhparam path AliasFile' "path: $MH_TEST_DIR/Mail
75 # check each component in procs array in uip/mhparam.c
76 run_test 'mhparam -nocomponent context' 'context'
77 run_test 'mhparam -nocomponent mh-sequences' '.mh_sequences'
78 run_test 'mhparam -nocomponent buildmimeproc' "$prefix/bin/mhbuild"
79 run_test 'mhparam -nocomponent faceproc' ''
80 run_test 'mhparam -nocomponent fileproc' "$MH_INST_DIR$prefix/bin/refile"
81 run_test 'mhparam -nocomponent foldprot' '700'
82 run_test 'mhparam -nocomponent formatproc' ''
83 run_test 'mhparam -nocomponent incproc' "$prefix/bin/inc"
84 run_test 'mhparam -nocomponent installproc' "$prefix/lib/install-mh"
85 run_test 'mhparam -nocomponent lproc' 'less'
86 run_test 'mhparam -nocomponent mailproc' "$prefix/bin/mhmail"
87 run_test 'mhparam -nocomponent mhlproc' "$MH_INST_DIR$prefix/lib/mhl"
88 run_test 'mhparam -nocomponent moreproc' 'less'
89 run_test 'mhparam -nocomponent msgprot' '600'
90 run_test 'mhparam -nocomponent mshproc' "$prefix/bin/msh"
91 run_test 'mhparam -nocomponent packproc' "$prefix/bin/packf"
92 run_test 'mhparam -nocomponent postproc' "$MH_INST_DIR$prefix/lib/post"
93 run_test 'mhparam -nocomponent rmmproc' ''
94 run_test 'mhparam -nocomponent sendproc' "$prefix/bin/send"
95 run_test 'mhparam -nocomponent showmimeproc' "$prefix/bin/mhshow"
96 run_test 'mhparam -nocomponent showproc' "$MH_INST_DIR$prefix/lib/mhl"
97 run_test 'mhparam -nocomponent version' 'nmh-'`cat $MH_OBJ_DIR/VERSION`
98 run_test 'mhparam -nocomponent vmhproc' "$prefix/bin/msh"
99 run_test 'mhparam -nocomponent whatnowproc' "$prefix/bin/whatnow"
100 run_test 'mhparam -nocomponent whomproc' "$prefix/bin/whom"
101 run_test 'mhparam -nocomponent etcdir' "$prefix/etc"
102 run_test 'mhparam -nocomponent libdir' "$prefix/lib"
103 run_test 'mhparam -nocomponent sbackup' ','
106 run_test 'mhparam -component Path' "Path: $MH_TEST_DIR/Mail"
108 # check -component, note that component name of argument is echoed exactly
109 run_test 'mhparam -component path' "path: $MH_TEST_DIR/Mail"
110 run_test 'mhparam -component PATH' "PATH: $MH_TEST_DIR/Mail"
113 run_test 'mhparam -component -nocomponent path' "$MH_TEST_DIR/Mail"
114 run_test 'mhparam -nocomponent path AliasFile' "$MH_TEST_DIR/Mail
117 # check nonexistent component
118 run_test 'mhparam nonexistent' ''
120 # check that return status counts nonexistent components
122 mhparam path context nonexistent1 nonexistent2 nonexistent3 >/dev/null
126 # mhparam -debug (undocumented)
127 # Some of its output depends on configure options, so don't bother to
128 # check for correctness here.
129 mhparam -debug >/dev/null