Commit 844f7fed 844f7fed0547be2bf3643a7294160ea7ffd6cb69 by Sergey Poznyakoff

Fix bug in mh testsuite.

We cannot assume that $HOME points to existing directory.

* mh/tests/testsuite.at (MH_SETUP): Override HOME environment
variable. Use it instead of curdir.
* mh/tests/atlocal.in (remove_curdir): Likewise.
* mh/tests/mhn.at: Likewise.
1 parent d2455d52
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
4 4
5 PATH=@abs_builddir@:@abs_top_builddir@/mh:$top_srcdir:$srcdir:$PATH 5 PATH=@abs_builddir@:@abs_top_builddir@/mh:$top_srcdir:$srcdir:$PATH
6 remove_curdir() { 6 remove_curdir() {
7 sed "s|$curdir/*||;s| *$||" $* 7 sed "s|$HOME/*||;s| *$||" $*
8 } 8 }
9 # mimeflt [FILE] 9 # mimeflt [FILE]
10 # Filter out all variable information from a MIME message in FILE. 10 # Filter out all variable information from a MIME message in FILE.
......
...@@ -176,7 +176,7 @@ cp $abs_top_srcdir/testsuite/mh/mbox1/4 Mail/inbox ...@@ -176,7 +176,7 @@ cp $abs_top_srcdir/testsuite/mh/mbox1/4 Mail/inbox
176 MUT_MBCHMOD(Mail/inbox, 700) 176 MUT_MBCHMOD(Mail/inbox, 700)
177 177
178 mkdir out 178 mkdir out
179 echo "mhn-storage: $curdir/out" >> $MH 179 echo "mhn-storage: $HOME/out" >> $MH
180 180
181 mhn +inbox -store 4 | remove_curdir || echo $? 181 mhn +inbox -store 4 | remove_curdir || echo $?
182 ], 182 ],
...@@ -212,7 +212,7 @@ mkdir out ...@@ -212,7 +212,7 @@ mkdir out
212 cp $abs_top_srcdir/testsuite/mh/mbox1/4 Mail/inbox 212 cp $abs_top_srcdir/testsuite/mh/mbox1/4 Mail/inbox
213 MUT_MBCHMOD(Mail/inbox, 700) 213 MUT_MBCHMOD(Mail/inbox, 700)
214 214
215 echo "mhn-store-application: $curdir/out/%m%P.%s" >> $MH 215 echo "mhn-store-application: $HOME/out/%m%P.%s" >> $MH
216 mhn +inbox -store 4 | remove_curdir || exit $? 216 mhn +inbox -store 4 | remove_curdir || exit $?
217 ], 217 ],
218 [0], 218 [0],
...@@ -262,7 +262,7 @@ echo "Current-Folder: inbox" > Mail/context ...@@ -262,7 +262,7 @@ echo "Current-Folder: inbox" > Mail/context
262 echo "mhn-store-text: | $abs_top_srcdir/mh/tests/mhed -" >> $MH 262 echo "mhn-store-text: | $abs_top_srcdir/mh/tests/mhed -" >> $MH
263 dnl ! Note extra quoting in the sed argument below, necessary because of 263 dnl ! Note extra quoting in the sed argument below, necessary because of
264 dnl ! unbalanced parentheses. 264 dnl ! unbalanced parentheses.
265 mhn +inbox -store -part 1 4 | sed ["s|$abs_top_srcdir/mh/tests/||;s|(cd \(.*\)\;|(cd home\;|;s| *$||"] || exit $? 265 mhn +inbox -store -part 1 4 | sed ["s|$abs_top_srcdir/mh/tests/||g;s|(cd \(.*\)\;|(cd home\;|;s| *$||"] || exit $?
266 ], 266 ],
267 [0], 267 [0],
268 [-- Editor invocation: - 268 [-- Editor invocation: -
......
...@@ -18,15 +18,16 @@ m4_include([testsuite.inc]) ...@@ -18,15 +18,16 @@ m4_include([testsuite.inc])
18 18
19 m4_define([MH_SETUP],[ 19 m4_define([MH_SETUP],[
20 test -d Mail || mkdir Mail 20 test -d Mail || mkdir Mail
21 curdir=`pwd` 21 HOME=`pwd`
22 MH=$curdir/mh_profile 22 export HOME
23 MH=$HOME/mh_profile
23 export MH 24 export MH
24 cat > $MH <<EOT 25 cat > $MH <<EOT
25 Path: $curdir/Mail 26 Path: $HOME/Mail
26 mhetcdir: $abs_top_srcdir/mh/etc 27 mhetcdir: $abs_top_srcdir/mh/etc
27 moreproc: /bin/cat 28 moreproc: /bin/cat
28 EOT 29 EOT
29 MTSTAILOR=$curdir/mtstailor 30 MTSTAILOR=$HOME/mtstailor
30 export MTSTAILOR 31 export MTSTAILOR
31 exec <&- 32 exec <&-
32 ]) 33 ])
...@@ -39,7 +40,7 @@ username: mhtester ...@@ -39,7 +40,7 @@ username: mhtester
39 url: sendmail://$abs_top_builddir/examples/mta 40 url: sendmail://$abs_top_builddir/examples/mta
40 EOT 41 EOT
41 42
42 MTA_DIAG=$curdir/mta.diag 43 MTA_DIAG=$HOME/mta.diag
43 export MTA_DIAG 44 export MTA_DIAG
44 MTA_DOMAIN=example.net 45 MTA_DOMAIN=example.net
45 export MTA_DOMAIN 46 export MTA_DOMAIN
......