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 @@
PATH=@abs_builddir@:@abs_top_builddir@/mh:$top_srcdir:$srcdir:$PATH
remove_curdir() {
sed "s|$curdir/*||;s| *$||" $*
sed "s|$HOME/*||;s| *$||" $*
}
# mimeflt [FILE]
# 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
MUT_MBCHMOD(Mail/inbox, 700)
mkdir out
echo "mhn-storage: $curdir/out" >> $MH
echo "mhn-storage: $HOME/out" >> $MH
mhn +inbox -store 4 | remove_curdir || echo $?
],
......@@ -212,7 +212,7 @@ mkdir out
cp $abs_top_srcdir/testsuite/mh/mbox1/4 Mail/inbox
MUT_MBCHMOD(Mail/inbox, 700)
echo "mhn-store-application: $curdir/out/%m%P.%s" >> $MH
echo "mhn-store-application: $HOME/out/%m%P.%s" >> $MH
mhn +inbox -store 4 | remove_curdir || exit $?
],
[0],
......@@ -262,7 +262,7 @@ echo "Current-Folder: inbox" > Mail/context
echo "mhn-store-text: | $abs_top_srcdir/mh/tests/mhed -" >> $MH
dnl ! Note extra quoting in the sed argument below, necessary because of
dnl ! unbalanced parentheses.
mhn +inbox -store -part 1 4 | sed ["s|$abs_top_srcdir/mh/tests/||;s|(cd \(.*\)\;|(cd home\;|;s| *$||"] || exit $?
mhn +inbox -store -part 1 4 | sed ["s|$abs_top_srcdir/mh/tests/||g;s|(cd \(.*\)\;|(cd home\;|;s| *$||"] || exit $?
],
[0],
[-- Editor invocation: -
......
......@@ -18,15 +18,16 @@ m4_include([testsuite.inc])
m4_define([MH_SETUP],[
test -d Mail || mkdir Mail
curdir=`pwd`
MH=$curdir/mh_profile
HOME=`pwd`
export HOME
MH=$HOME/mh_profile
export MH
cat > $MH <<EOT
Path: $curdir/Mail
Path: $HOME/Mail
mhetcdir: $abs_top_srcdir/mh/etc
moreproc: /bin/cat
EOT
MTSTAILOR=$curdir/mtstailor
MTSTAILOR=$HOME/mtstailor
export MTSTAILOR
exec <&-
])
......@@ -39,7 +40,7 @@ username: mhtester
url: sendmail://$abs_top_builddir/examples/mta
EOT
MTA_DIAG=$curdir/mta.diag
MTA_DIAG=$HOME/mta.diag
export MTA_DIAG
MTA_DOMAIN=example.net
export MTA_DOMAIN
......