]> diplodocus.org Git - nmh/commitdiff
Added support for running the test suite with valgrind by setting
authorDavid Levine <levinedl@acm.org>
Sat, 28 Dec 2013 17:51:01 +0000 (11:51 -0600)
committerDavid Levine <levinedl@acm.org>
Sat, 28 Dec 2013 17:51:01 +0000 (11:51 -0600)
the NMH_VALGRIND environment variable.  To support that, nmh
programs that are invoked in the test suite should be run via
(the new function) run_prog or run_test.

64 files changed:
docs/README.developers
test/anno/test-anno
test/bad-input/test-header
test/burst/test-burst
test/burst/test-burst-mime
test/common.sh.in
test/comp/test-comp-format
test/dist/test-dist
test/folder/test-create
test/folder/test-packf
test/folder/test-recurse
test/folder/test-sortm
test/folder/test-total
test/format/test-dp
test/format/test-fmtdump
test/format/test-localmbox
test/format/test-mymbox
test/format/test-rightjustify
test/forw/test-forw-digest
test/forw/test-forw-format
test/inc/test-inc-scanout
test/inc/test-msgchk
test/install-mh/test-install-mh
test/locking/test-datalocking
test/mhbuild/test-forw
test/mhbuild/test-header-encode
test/mhbuild/test-utf8-body
test/mhfixmsg/test-mhfixmsg
test/mhlist/test-mhlist
test/mhparam/test-mhparam
test/mhpath/test-mhpath
test/mhshow/test-charset
test/mhshow/test-cte-binary
test/mhshow/test-msg-buffer-boundaries
test/mhshow/test-qp
test/mhshow/test-subpart
test/mhstore/test-mhstore
test/new/test-basic
test/pick/test-pick
test/pick/test-stderr
test/post/test-messageid
test/post/test-mts
test/post/test-post-aliases
test/post/test-post-common.sh
test/post/test-sendfiles
test/prompter/test-prompter
test/rcv/test-rcvdist
test/rcv/test-rcvpack
test/rcv/test-rcvstore
test/rcv/test-rcvtty
test/refile/test-refile
test/repl/test-if-str
test/repl/test-multicomp
test/repl/test-repl
test/repl/test-trailing-newline
test/scan/test-scan
test/scan/test-scan-multibyte
test/sequences/test-mark
test/slocal/test-slocal
test/valgrind.supp [new file with mode: 0644]
test/whatnow/test-attach-detach
test/whatnow/test-cd
test/whatnow/test-ls
test/whom/test-whom

index 86b2f897d66d923925f05cbdd7ea0bdf1ee88e8f..76f650dcbad534659bd47dce5998d3afea8b5db0 100644 (file)
@@ -162,6 +162,23 @@ OS function  nmh-local version to use instead
 getpass()    nmh_getpass()
 
 
 getpass()    nmh_getpass()
 
 
+--------------
+nmh test suite
+--------------
+
+The nmh test suite is run through the Makefile, with "make check"
+or "make distcheck".
+
+To enable the use of valgrind, where available, set the environment
+variable NMH_VALGRIND to a non-null value.  However, a separate
+environment variable, VALGRIND_ME, triggers the use of valgrind in
+test/inc/test-eom-align because it greatly extends the duration of
+that test.
+
+In the nmh test suite, nmh programs to be tested should be invoked
+through the run_test or run_prog shell functions defined in
+test/common.sh.
+
 -------------
 releasing nmh
 -------------
 -------------
 releasing nmh
 -------------
index e4dd39e472d12dd38db317e3caba015ecab16bf5..34048d90d547bfced5d9aa6f2c71216d1716220e 100755 (executable)
@@ -39,7 +39,7 @@ Usage: anno [+folder] [msgs] [switches]
   -([no]p)reserve
 EOF
 
   -([no]p)reserve
 EOF
 
-anno -help >"$actual" 2>&1
+run_prog anno -help >"$actual" 2>&1
 check "$expected" "$actual"
 
 # check -version
 check "$expected" "$actual"
 
 # check -version
@@ -59,26 +59,26 @@ printf 'Nmh-test:\n' >"$expected"
 cat "${MH_TEST_DIR}/Mail/inbox/1" >>"$expected"
 folder -fast 1 >/dev/null
 
 cat "${MH_TEST_DIR}/Mail/inbox/1" >>"$expected"
 folder -fast 1 >/dev/null
 
-printf 'Nmh-test' | anno >/dev/null
+printf 'Nmh-test' | run_prog anno >/dev/null
 sed -e 's/^Nmh-test:.*/Nmh-test:/' "${MH_TEST_DIR}/Mail/inbox/1" >"$actual"
 check "$expected" "$actual" 'keep first'
 cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
 
 # check -component
 sed -e 's/^Nmh-test:.*/Nmh-test:/' "${MH_TEST_DIR}/Mail/inbox/1" >"$actual"
 check "$expected" "$actual" 'keep first'
 cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
 
 # check -component
-anno -component Nmh-test
+run_prog anno -component Nmh-test
 sed -e 's/^Nmh-test:.*/Nmh-test:/' "${MH_TEST_DIR}/Mail/inbox/1" >"$actual"
 check "$expected" "$actual" 'keep first'
 cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
 
 # check +folder
 sed -e 's/^Nmh-test:.*/Nmh-test:/' "${MH_TEST_DIR}/Mail/inbox/1" >"$actual"
 check "$expected" "$actual" 'keep first'
 cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
 
 # check +folder
-anno -component Nmh-test +inbox
+run_prog anno -component Nmh-test +inbox
 sed -e 's/^Nmh-test:.*/Nmh-test:/' "${MH_TEST_DIR}/Mail/inbox/1" >"$actual"
 check "$expected" "$actual" 'keep first'
 cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
 
 # check msg
 folder -fast 2 >/dev/null
 sed -e 's/^Nmh-test:.*/Nmh-test:/' "${MH_TEST_DIR}/Mail/inbox/1" >"$actual"
 check "$expected" "$actual" 'keep first'
 cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
 
 # check msg
 folder -fast 2 >/dev/null
-anno 1 -component Nmh-test
+run_prog anno 1 -component Nmh-test
 sed -e 's/^Nmh-test:.*/Nmh-test:/' "${MH_TEST_DIR}/Mail/inbox/1" >"$actual"
 check "$expected" "$actual" 'keep first'
 cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
 sed -e 's/^Nmh-test:.*/Nmh-test:/' "${MH_TEST_DIR}/Mail/inbox/1" >"$actual"
 check "$expected" "$actual" 'keep first'
 cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
@@ -89,7 +89,7 @@ if [ $hard_links_supported -eq 1 ]; then
   # Hard link the message and verify that the new one doesn't get annotated.
   cp "${MH_TEST_DIR}/Mail/inbox/8" "${MH_TEST_DIR}/Mail/inbox/8.copy"
   ln "${MH_TEST_DIR}/Mail/inbox/8" "${MH_TEST_DIR}/Mail/inbox/8.link"
   # Hard link the message and verify that the new one doesn't get annotated.
   cp "${MH_TEST_DIR}/Mail/inbox/8" "${MH_TEST_DIR}/Mail/inbox/8.copy"
   ln "${MH_TEST_DIR}/Mail/inbox/8" "${MH_TEST_DIR}/Mail/inbox/8.link"
-  anno 8 -component Nmh-test -noinplace
+  run_prog anno 8 -component Nmh-test -noinplace
   mv -f "${MH_TEST_DIR}/Mail/inbox/8.copy" "${MH_TEST_DIR}/Mail/inbox/8"
   check "${MH_TEST_DIR}/Mail/inbox/8" "${MH_TEST_DIR}/Mail/inbox/8.link" \
     'keep first'
   mv -f "${MH_TEST_DIR}/Mail/inbox/8.copy" "${MH_TEST_DIR}/Mail/inbox/8"
   check "${MH_TEST_DIR}/Mail/inbox/8" "${MH_TEST_DIR}/Mail/inbox/8.link" \
     'keep first'
@@ -97,33 +97,33 @@ if [ $hard_links_supported -eq 1 ]; then
   # check -inplace
   # Hard link the message and verify that the new one does get annotated.
   ln "${MH_TEST_DIR}/Mail/inbox/8" "${MH_TEST_DIR}/Mail/inbox/8.link"
   # check -inplace
   # Hard link the message and verify that the new one does get annotated.
   ln "${MH_TEST_DIR}/Mail/inbox/8" "${MH_TEST_DIR}/Mail/inbox/8.link"
-  anno 8 -component Nmh-test -noinplace -inplace
+  run_prog anno 8 -component Nmh-test -noinplace -inplace
   check "${MH_TEST_DIR}/Mail/inbox/8" "${MH_TEST_DIR}/Mail/inbox/8.link"
 fi
 
 # check -nodate.  Without -text, it doesn't change the message.
 cp -f "${MH_TEST_DIR}/Mail/inbox/11" "$expected-nodate"
   check "${MH_TEST_DIR}/Mail/inbox/8" "${MH_TEST_DIR}/Mail/inbox/8.link"
 fi
 
 # check -nodate.  Without -text, it doesn't change the message.
 cp -f "${MH_TEST_DIR}/Mail/inbox/11" "$expected-nodate"
-anno 1 -component Nmh-test -nodate
+run_prog anno 1 -component Nmh-test -nodate
 cp -f "${MH_TEST_DIR}/Mail/inbox/1" "$actual"
 check "$expected-nodate" "$actual"
 cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
 
 # check -date
 cp -f "${MH_TEST_DIR}/Mail/inbox/1" "$actual"
 check "$expected-nodate" "$actual"
 cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
 
 # check -date
-anno 1 -component Nmh-test -nodate -date
+run_prog anno 1 -component Nmh-test -nodate -date
 sed -e 's/^Nmh-test:.*/Nmh-test:/' "${MH_TEST_DIR}/Mail/inbox/1" >"$actual"
 check "$expected" "$actual" 'keep first'
 cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
 
 # check -draft.
 cp -f "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/draft"
 sed -e 's/^Nmh-test:.*/Nmh-test:/' "${MH_TEST_DIR}/Mail/inbox/1" >"$actual"
 check "$expected" "$actual" 'keep first'
 cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
 
 # check -draft.
 cp -f "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/draft"
-anno -draft -component Nmh-test
+run_prog anno -draft -component Nmh-test
 sed -e 's/^Nmh-test:.*/Nmh-test:/' "${MH_TEST_DIR}/Mail/draft" >"$actual"
 check "$expected" "$actual"
 rm "${MH_TEST_DIR}/Mail/draft"
 
 # check -append
 awk 'NR==6{print "Nmh-test:"}1' <"${MH_TEST_DIR}/Mail/inbox/1" >"$expected"
 sed -e 's/^Nmh-test:.*/Nmh-test:/' "${MH_TEST_DIR}/Mail/draft" >"$actual"
 check "$expected" "$actual"
 rm "${MH_TEST_DIR}/Mail/draft"
 
 # check -append
 awk 'NR==6{print "Nmh-test:"}1' <"${MH_TEST_DIR}/Mail/inbox/1" >"$expected"
-anno 1 -component Nmh-test -append
+run_prog anno 1 -component Nmh-test -append
 sed -e 's/^Nmh-test:.*/Nmh-test:/' "${MH_TEST_DIR}/Mail/inbox/1" >"$actual"
 check "$expected" "$actual"
 cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
 sed -e 's/^Nmh-test:.*/Nmh-test:/' "${MH_TEST_DIR}/Mail/inbox/1" >"$actual"
 check "$expected" "$actual"
 cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
@@ -131,7 +131,7 @@ cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
 # check -list
 printf 'Nmh-test: test of anno -list\n' >"$expected"
 cat "${MH_TEST_DIR}/Mail/inbox/1" >>"$expected"
 # check -list
 printf 'Nmh-test: test of anno -list\n' >"$expected"
 cat "${MH_TEST_DIR}/Mail/inbox/1" >>"$expected"
-anno 1 -component Nmh-test -nodate -text 'test of anno -list'
+run_prog anno 1 -component Nmh-test -nodate -text 'test of anno -list'
 run_test 'anno 1 -component Nmh-test -list' 'test of anno -list'
 # check -text
 check "$expected" "${MH_TEST_DIR}/Mail/inbox/1"
 run_test 'anno 1 -component Nmh-test -list' 'test of anno -list'
 # check -text
 check "$expected" "${MH_TEST_DIR}/Mail/inbox/1"
@@ -140,7 +140,7 @@ cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
 # check -list -number
 printf 'Nmh-test: test of anno -list -number\n' >"$expected"
 cat "${MH_TEST_DIR}/Mail/inbox/1" >>"$expected"
 # check -list -number
 printf 'Nmh-test: test of anno -list -number\n' >"$expected"
 cat "${MH_TEST_DIR}/Mail/inbox/1" >>"$expected"
-anno 1 -component Nmh-test -nodate -text 'test of anno -list -number'
+run_prog anno 1 -component Nmh-test -nodate -text 'test of anno -list -number'
 run_test 'anno 1 -component Nmh-test -list -number' \
          '1    test of anno -list -number'
 check "$expected" "${MH_TEST_DIR}/Mail/inbox/1"
 run_test 'anno 1 -component Nmh-test -list -number' \
          '1    test of anno -list -number'
 check "$expected" "${MH_TEST_DIR}/Mail/inbox/1"
@@ -148,8 +148,8 @@ cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
 
 # check -delete
 cp "${MH_TEST_DIR}/Mail/inbox/1" "$expected"
 
 # check -delete
 cp "${MH_TEST_DIR}/Mail/inbox/1" "$expected"
-anno 1 -component Nmh-test
-anno 1 -component Nmh-test -delete
+run_prog anno 1 -component Nmh-test
+run_prog anno 1 -component Nmh-test -delete
 sed -e 's/^Nmh-test:.*/Nmh-test:/' "${MH_TEST_DIR}/Mail/inbox/1" >"$actual"
 check "$expected" "$actual"
 cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
 sed -e 's/^Nmh-test:.*/Nmh-test:/' "${MH_TEST_DIR}/Mail/inbox/1" >"$actual"
 check "$expected" "$actual"
 cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
@@ -157,20 +157,20 @@ cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
 # check -delete -number
 printf 'Nmh-test: 1\nNmh-test: 3\n' >"$expected"
 cat "${MH_TEST_DIR}/Mail/inbox/1" >>"$expected"
 # check -delete -number
 printf 'Nmh-test: 1\nNmh-test: 3\n' >"$expected"
 cat "${MH_TEST_DIR}/Mail/inbox/1" >>"$expected"
-anno 1 -component Nmh-test -nodate -text 3
-anno 1 -component Nmh-test -nodate -text 2
-anno 1 -component Nmh-test -nodate -text 1
-anno 1 -component Nmh-test -delete -number 2
+run_prog anno 1 -component Nmh-test -nodate -text 3
+run_prog anno 1 -component Nmh-test -nodate -text 2
+run_prog anno 1 -component Nmh-test -nodate -text 1
+run_prog anno 1 -component Nmh-test -delete -number 2
 cp -f "${MH_TEST_DIR}/Mail/inbox/1" "$actual"
 check "$expected" "$actual"
 cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
 
 # check -delete -all
 cp "${MH_TEST_DIR}/Mail/inbox/1" "$expected"
 cp -f "${MH_TEST_DIR}/Mail/inbox/1" "$actual"
 check "$expected" "$actual"
 cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
 
 # check -delete -all
 cp "${MH_TEST_DIR}/Mail/inbox/1" "$expected"
-anno 1 -component Nmh-test -nodate -text 3
-anno 1 -component Nmh-test -nodate -text 2
-anno 1 -component Nmh-test -nodate -text 1
-anno 1 -component Nmh-test -delete -number all
+run_prog anno 1 -component Nmh-test -nodate -text 3
+run_prog anno 1 -component Nmh-test -nodate -text 2
+run_prog anno 1 -component Nmh-test -nodate -text 1
+run_prog anno 1 -component Nmh-test -delete -number all
 cp -f "${MH_TEST_DIR}/Mail/inbox/1" "$actual"
 check "$expected" "$actual"
 cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
 cp -f "${MH_TEST_DIR}/Mail/inbox/1" "$actual"
 check "$expected" "$actual"
 cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
@@ -178,8 +178,8 @@ cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
 # check -preserve
 touch -t '201210010000.00' "${MH_TEST_DIR}/Mail/inbox/1"
 ls -l "${MH_TEST_DIR}/Mail/inbox/1" >"$actual-ls1"
 # check -preserve
 touch -t '201210010000.00' "${MH_TEST_DIR}/Mail/inbox/1"
 ls -l "${MH_TEST_DIR}/Mail/inbox/1" >"$actual-ls1"
-anno 1 -component Nmh-test -preserve
-anno 1 -component Nmh-test -preserve -delete
+run_prog anno 1 -component Nmh-test -preserve
+run_prog anno 1 -component Nmh-test -preserve -delete
 ls -l "${MH_TEST_DIR}/Mail/inbox/1" >"$actual-ls2"
 check "$actual-ls1" "$actual-ls2"
 cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
 ls -l "${MH_TEST_DIR}/Mail/inbox/1" >"$actual-ls2"
 check "$actual-ls1" "$actual-ls2"
 cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
@@ -187,8 +187,8 @@ cp -f "${MH_TEST_DIR}/Mail/inbox/11" "${MH_TEST_DIR}/Mail/inbox/1"
 # check -nopreserve
 touch -t '2012100100.00' "${MH_TEST_DIR}/Mail/inbox/1"
 ls -l "${MH_TEST_DIR}/Mail/inbox/1" >"$actual-ls1"
 # check -nopreserve
 touch -t '2012100100.00' "${MH_TEST_DIR}/Mail/inbox/1"
 ls -l "${MH_TEST_DIR}/Mail/inbox/1" >"$actual-ls1"
-anno 1 -component Nmh-test -preserve -nopreserve
-anno 1 -component Nmh-test -preserve -nopreserve -delete
+run_prog anno 1 -component Nmh-test -preserve -nopreserve
+run_prog anno 1 -component Nmh-test -preserve -nopreserve -delete
 ls -l "${MH_TEST_DIR}/Mail/inbox/1" >"$actual-ls2"
 set +e
 diff "$actual-ls1" "$actual-ls2" >/dev/null
 ls -l "${MH_TEST_DIR}/Mail/inbox/1" >"$actual-ls2"
 set +e
 diff "$actual-ls1" "$actual-ls2" >/dev/null
index e993cce812f6e7bcd5d5f7216c1f48a232d378f6..1bc05f47a6ba395211826db6b3779ee320f9dd6a 100755 (executable)
@@ -37,7 +37,7 @@ EOF
 cat >"$expected" <<EOF
   11  12/18 foo@example.edu    test<<This is a multi-part message in MIME forma
 EOF
 cat >"$expected" <<EOF
   11  12/18 foo@example.edu    test<<This is a multi-part message in MIME forma
 EOF
-scan -width 80 last > "$actual" 2>&1
+run_prog scan -width 80 last > "$actual" 2>&1
 check "$expected" "$actual"
 
 # check show (mhl)
 check "$expected" "$actual"
 
 # check show (mhl)
@@ -54,7 +54,7 @@ This is a multi-part message in MIME format.
 
 I am a stupid spammer.
 EOF
 
 I am a stupid spammer.
 EOF
-show last > "$actual" 2>&1
+run_prog show last > "$actual" 2>&1
 check "$expected" "$actual"
 
 # check mhshow
 check "$expected" "$actual"
 
 # check mhshow
@@ -71,7 +71,7 @@ This is a multi-part message in MIME format.
 
 I am a stupid spammer.
 EOF
 
 I am a stupid spammer.
 EOF
-mhshow -nopause last > "$actual" 2>&1
+run_prog mhshow -nopause last > "$actual" 2>&1
 check "$expected" "$actual"
 
 # check m_getfld() handling of empty header field
 check "$expected" "$actual"
 
 # check m_getfld() handling of empty header field
@@ -85,7 +85,7 @@ scan: eof encountered in field "Received"
 ??Format error (message 12) in component 2
 EOF
 
 ??Format error (message 12) in component 2
 EOF
 
-scan -width 13 last >"$actual" 2>"$actual_err"
+run_prog scan -width 13 last >"$actual" 2>"$actual_err"
 check "$expected" "$actual"
 check "$expected_err" "$actual_err"
 
 check "$expected" "$actual"
 check "$expected_err" "$actual_err"
 
@@ -99,7 +99,7 @@ cat >"$expected" <<EOF
   13  01/15 
 EOF
 
   13  01/15 
 EOF
 
-scan -width 13 last >"$actual" 2>"$actual_err"
+run_prog scan -width 13 last >"$actual" 2>"$actual_err"
 check "$expected" "$actual"
 # Cygwin has a BUFSIZ of 1024 so the error message gets truncated.
 # Deal with that by grepping to verify that scan showed the proper error.
 check "$expected" "$actual"
 # Cygwin has a BUFSIZ of 1024 so the error message gets truncated.
 # Deal with that by grepping to verify that scan showed the proper error.
@@ -134,7 +134,7 @@ scan: eol encountered in field "If a header field name has at least 512 characte
 ??Format error (message 14) in component 2
 EOF
 
 ??Format error (message 14) in component 2
 EOF
 
-scan -width 13 last >"$actual" 2>"$actual_err"
+run_prog scan -width 13 last >"$actual" 2>"$actual_err"
 check "$expected" "$actual"
 check "$expected_err" "$actual_err"
 
 check "$expected" "$actual"
 check "$expected_err" "$actual_err"
 
index e6545350700682dd6e15c6c9fec8cfd65f45693b..938c0b56216ec7a85ec66b84fee80fd28a13efe7 100755 (executable)
@@ -46,7 +46,7 @@ For real.
 End of all messages
 EOF
 
 End of all messages
 EOF
 
-burst 11 || exit
+run_prog burst 11 || exit
 
 run_test 'scan -width 80 11-last' \
 "  11  09/29 Test Burst Messag  Test digest<<------- Message one From: Mister Bu
 
 run_test 'scan -width 80 11-last' \
 "  11  09/29 Test Burst Messag  Test digest<<------- Message one From: Mister Bu
@@ -97,7 +97,7 @@ Will this one work?
 End of all messages
 EOF
 
 End of all messages
 EOF
 
-burst 14 || exit
+run_prog burst 14 || exit
 
 run_test 'scan -width 80 14-last' \
 "  14  09/29 Test Burst Messag  Test digest<<This is a preamble ------- Message 
 
 run_test 'scan -width 80 14-last' \
 "  14  09/29 Test Burst Messag  Test digest<<This is a preamble ------- Message 
index 93f6b6d620a257ef3807043017a6c3a9b4c14a76..46de62aa74e0a01adfb28f320cadb6249a695f13 100755 (executable)
@@ -35,7 +35,7 @@ Subject: Message one
 
 EOF
 
 
 EOF
 
-burst 11
+run_prog burst 11
 
 run_test 'scan -width 80 11-last' \
 "  11  09/29 Test Burst Messag  Test MIME digest<<From: Mister Burster <burst2@e
 
 run_test 'scan -width 80 11-last' \
 "  11  09/29 Test Burst Messag  Test MIME digest<<From: Mister Burster <burst2@e
@@ -86,7 +86,7 @@ Will this one work?
 ------- =_aaaaaaaaaa0--
 EOF
 
 ------- =_aaaaaaaaaa0--
 EOF
 
-burst 14 || exit
+run_prog burst 14 || exit
 
 run_test 'scan -width 80 14-last' \
 "  14  09/29 Test Burst Messag  Test digest<<This is a preamble ------- =_aaaaaa
 
 run_test 'scan -width 80 14-last' \
 "  14  09/29 Test Burst Messag  Test digest<<This is a preamble ------- =_aaaaaa
index 6c9652ced8c6370fa4a238f3ae1009a3f739e99e..d425dbb72afa5dfc0583467c9aa8c3ee1765fcc0 100644 (file)
@@ -140,9 +140,9 @@ prepare_space() {
 
 #### check() requires two arguments, each the name of a file to be
 #### diff'ed.
 
 #### check() requires two arguments, each the name of a file to be
 #### diff'ed.
-#### If the same, the second file is removed.  And the first file is
-####   removed unless there's an optional argument with a value of
-####   'keep first'.
+#### If the contents are same, the second file is removed.  And the
+####   first file is removed unless there's an optional argument with
+####   a value of 'keep first'.
 #### If different, global variable "failed" is incremented.
 #### If there's an optional 'ignore space' argument, spacing differences
 ####   will not be considered signficant, emulating GNU diff -w.  It
 #### If different, global variable "failed" is incremented.
 #### If there's an optional 'ignore space' argument, spacing differences
 ####   will not be considered signficant, emulating GNU diff -w.  It
@@ -185,6 +185,25 @@ check() {
     fi
 }
 
     fi
 }
 
+
+#### Shortcut to enable use of valgrind:  set NMH_VALGRIND environment
+#### variable (to anything) so run_* will use valgrind.
+if [ "${NMH_VALGRIND}"  -a  -z "${NMH_TEST_PREFIX}" ]; then
+  NMH_TEST_PREFIX="valgrind --quiet --error-exitcode=1 \
+                            --suppressions=$MH_OBJ_DIR/test/valgrind.supp"
+fi
+
+#### Run test under another program by setting NMH_TEST_PREFIX
+#### environment variable to, e.g., 'valgrind --quiet'.
+run_prog() {
+  case $1 in
+    #### Don't run valgrind on shell built-in.
+    eval\ *) "$@" ;;
+    *) ${NMH_TEST_PREFIX} "$@" ;;
+  esac
+}
+
+
 #### run_test() requires two arguments, the first is a program and
 #### arguments, the second is its expected one-line output string.
 #### If the actual output does not match that string:
 #### run_test() requires two arguments, the first is a program and
 #### arguments, the second is its expected one-line output string.
 #### If the actual output does not match that string:
@@ -192,7 +211,11 @@ check() {
 #### if there is an optional third argument, it is used in the error message.
 run_test() {
   set +e
 #### if there is an optional third argument, it is used in the error message.
 run_test() {
   set +e
-  actual_output=`$1 2>&1`
+  case $1 in
+    #### Don't run valgrind on shell built-in.
+    eval\ *) actual_output=`$1 2>&1` ;;
+    *) actual_output=`${NMH_TEST_PREFIX} $1 2>&1` ;;
+  esac
   set -e
   if test x"$actual_output" != x"$2"; then
     echo "$0: ${3:-\"$1\"} expected:" 1>&2
   set -e
   if test x"$actual_output" != x"$2"; then
     echo "$0: ${3:-\"$1\"} expected:" 1>&2
index f1c25635f1c992d20711b7a638714ed35ef45c09..f71866172618f21288629b400d505668c34255d4 100755 (executable)
@@ -54,6 +54,7 @@ Subject: ${subject}
 --------
 EOF
 
 --------
 EOF
 
+run_prog \
 comp -editor true -form "${form}" -from "${from}" -to "${to1}" -to "${to2}" \
     -cc "${cc1}" -cc "${cc2}" -cc "${cc3}" -cc "${cc4}" -fcc "${fcc1}" \
     -fcc "${fcc2}" -subject "${subject}" -width 60 -nowhatnowproc || exit 1
 comp -editor true -form "${form}" -from "${from}" -to "${to1}" -to "${to2}" \
     -cc "${cc1}" -cc "${cc2}" -cc "${cc3}" -cc "${cc4}" -fcc "${fcc1}" \
     -fcc "${fcc2}" -subject "${subject}" -width 60 -nowhatnowproc || exit 1
index c5182afaf8b55c72b19aa095cdbe17bbd53265e4..2bb1d30f7882a85d1ead30580869f96c1be75c86 100755 (executable)
@@ -31,7 +31,7 @@ MHMTSCONF="$mts_fakesendmail"
 # arguments: dist switches
 test_dist ()
 {
 # arguments: dist switches
 test_dist ()
 {
-  printf 'send\n' | dist "$@" >/dev/null
+  printf 'send\n' | run_prog dist "$@" >/dev/null
 
   # fakesendmail drops the message and any cc's into this mbox.
   mbox="${MH_TEST_DIR}"/Mail/fakesendmail.mbox
 
   # fakesendmail drops the message and any cc's into this mbox.
   mbox="${MH_TEST_DIR}"/Mail/fakesendmail.mbox
index 59e7c3f995b1ad211d7ba5ae03551a5bd47c4992..a0fb5716b09d8c6b90b00a2518a078b6b252068f 100755 (executable)
@@ -14,14 +14,14 @@ fi
 
 setup_test
 
 
 setup_test
 
-folder -create +testfolder > /dev/null
+run_prog folder -create +testfolder > /dev/null
 if [ -d "$MH_TEST_DIR/Mail/testfolder" ]; then
     :
 else
     exit 1
 fi
 
 if [ -d "$MH_TEST_DIR/Mail/testfolder" ]; then
     :
 else
     exit 1
 fi
 
-rmf +testfolder > /dev/null
+run_prog rmf +testfolder > /dev/null
 if [ -d "$MH_TEST_DIR/Mail/testfolder" ]; then
     # Test failed
     exit 1
 if [ -d "$MH_TEST_DIR/Mail/testfolder" ]; then
     # Test failed
     exit 1
index 3e0281f9d79976162f0537878ac226bfcb7d6076..ff98cef52bbd01a3b470ee93810e7734fb07fd95 100755 (executable)
@@ -48,7 +48,7 @@ cd "${MH_TEST_DIR}"  ||  exit 1
 printf 'y\n' >Mail/yes
 
 # check with no switches
 printf 'y\n' >Mail/yes
 
 # check with no switches
-packf <Mail/yes
+run_prog packf <Mail/yes
 inc +inbox2 -file msgbox <Mail/yes >/dev/null
 rm -f msgbox .msgbox.map
 for i in `pick +inbox`; do
 inc +inbox2 -file msgbox <Mail/yes >/dev/null
 rm -f msgbox .msgbox.map
 for i in `pick +inbox`; do
@@ -58,7 +58,7 @@ run_test "printf $i" '10'
 rmm +inbox2 -unlink `pick +inbox2`
 
 # check +folder
 rmm +inbox2 -unlink `pick +inbox2`
 
 # check +folder
-packf +inbox <Mail/yes
+run_prog packf +inbox <Mail/yes
 inc +inbox2 -file msgbox >/dev/null
 rm -f msgbox .msgbox.map
 for i in `pick +inbox`; do
 inc +inbox2 -file msgbox >/dev/null
 rm -f msgbox .msgbox.map
 for i in `pick +inbox`; do
@@ -68,7 +68,7 @@ run_test "printf $i" '10'
 rmm +inbox2 -unlink `pick +inbox2`
 
 # check msgs
 rmm +inbox2 -unlink `pick +inbox2`
 
 # check msgs
-packf +inbox 1 2 3 <Mail/yes
+run_prog packf +inbox 1 2 3 <Mail/yes
 inc +inbox2 -file msgbox >/dev/null
 rm -f msgbox .msgbox.map
 for i in `pick +inbox2`; do
 inc +inbox2 -file msgbox >/dev/null
 rm -f msgbox .msgbox.map
 for i in `pick +inbox2`; do
@@ -78,7 +78,7 @@ run_test "printf $i" '3'
 rmm +inbox2 -unlink `pick +inbox2`
 
 # check -file
 rmm +inbox2 -unlink `pick +inbox2`
 
 # check -file
-packf +inbox -file msgbox2 <Mail/yes
+run_prog packf +inbox -file msgbox2 <Mail/yes
 inc +inbox2 -file msgbox2 >/dev/null
 for i in `pick +inbox2`; do
   diff "`mhpath +inbox $i`" "`mhpath +inbox2 $i`"
 inc +inbox2 -file msgbox2 >/dev/null
 for i in `pick +inbox2`; do
   diff "`mhpath +inbox $i`" "`mhpath +inbox2 $i`"
@@ -87,7 +87,7 @@ run_test "printf $i" '10'
 rmm +inbox2 -unlink `pick +inbox2`
 
 # check append to existing mbox file
 rmm +inbox2 -unlink `pick +inbox2`
 
 # check append to existing mbox file
-packf +inbox -file msgbox2 <Mail/yes
+run_prog packf +inbox -file msgbox2 <Mail/yes
 inc +inbox2 -file msgbox2 >/dev/null
 rm -f msgbox2 .msgbox2.map
 for i in `pick +inbox2`; do
 inc +inbox2 -file msgbox2 >/dev/null
 rm -f msgbox2 .msgbox2.map
 for i in `pick +inbox2`; do
@@ -102,7 +102,7 @@ run_test "printf $i" '20'
 rmm +inbox2 -unlink `pick +inbox2`
 
 # check -mbox
 rmm +inbox2 -unlink `pick +inbox2`
 
 # check -mbox
-packf +inbox -mbox <Mail/yes
+run_prog packf +inbox -mbox <Mail/yes
 inc +inbox2 -file msgbox >/dev/null
 rm -f msgbox .msgbox.map
 for i in `pick +inbox2`; do
 inc +inbox2 -file msgbox >/dev/null
 rm -f msgbox .msgbox.map
 for i in `pick +inbox2`; do
@@ -112,7 +112,7 @@ run_test "printf $i" '10'
 rmm +inbox2 -unlink `pick +inbox2`
 
 # check -mmdf
 rmm +inbox2 -unlink `pick +inbox2`
 
 # check -mmdf
-packf +inbox -mmdf <Mail/yes
+run_prog packf +inbox -mmdf <Mail/yes
 inc +inbox2 -file msgbox >/dev/null
 rm -f msgbox .msgbox.map
 for i in `pick +inbox2`; do
 inc +inbox2 -file msgbox >/dev/null
 rm -f msgbox .msgbox.map
 for i in `pick +inbox2`; do
@@ -122,7 +122,7 @@ run_test "printf $i" '10'
 rmm +inbox2 -unlink `pick +inbox2`
 
 # check append to existing mmdf file
 rmm +inbox2 -unlink `pick +inbox2`
 
 # check append to existing mmdf file
-packf +inbox -mmdf <Mail/yes
+run_prog packf +inbox -mmdf <Mail/yes
 inc +inbox2 -file msgbox >/dev/null
 rm -f msgbox .msgbox.map
 for i in `pick +inbox2`; do
 inc +inbox2 -file msgbox >/dev/null
 rm -f msgbox .msgbox.map
 for i in `pick +inbox2`; do
index 0b974a33ea799372a51c355867f737d890116655..f30b954753523e08c66579a5e5b87dd591eacca2 100755 (executable)
@@ -14,9 +14,9 @@ fi
 
 setup_test
 
 
 setup_test
 
-folder -create +testfolder > /dev/null
-folder -create +testfolder/folder1 > /dev/null
-folder -create +testfolder/folder2 > /dev/null
+run_prog folder -create +testfolder > /dev/null
+run_prog folder -create +testfolder/folder1 > /dev/null
+run_prog folder -create +testfolder/folder2 > /dev/null
 
 run_test 'folder -recurse +testfolder' 'testfolder+         has no messages       ;        (others).
 testfolder/folder1  has no messages.
 
 run_test 'folder -recurse +testfolder' 'testfolder+         has no messages       ;        (others).
 testfolder/folder1  has no messages.
index 0753ecb0f4d90f404c29c20b1bc5a93881758149..ac0f8421fe9e1bb27b5705809362c231597318de 100755 (executable)
@@ -37,7 +37,7 @@ Usage: sortm [+folder] [msgs] [switches]
   -help
 EOF
 
   -help
 EOF
 
-sortm -help >"$actual" 2>&1
+run_prog sortm -help >"$actual" 2>&1
 check "$expected" "$actual"
 
 # check -version
 check "$expected" "$actual"
 
 # check -version
@@ -83,7 +83,7 @@ cat >"$expected" <<EOF
   12  09/29 Test11             Re: common subject<<This is message number 11 >>
 EOF
 
   12  09/29 Test11             Re: common subject<<This is message number 11 >>
 EOF
 
-sortm
+run_prog sortm
 scan >"$actual"
 check "$expected" "$actual"
 
 scan >"$actual"
 check "$expected" "$actual"
 
@@ -104,7 +104,7 @@ cat >"$expected" <<EOF
 EOF
 
 refile first +inbox; folder -pack >/dev/null
 EOF
 
 refile first +inbox; folder -pack >/dev/null
-sortm +inbox
+run_prog sortm +inbox
 scan >"$actual"
 check "$expected" "$actual"
 
 scan >"$actual"
 check "$expected" "$actual"
 
@@ -138,7 +138,7 @@ message 1 becomes message 2
 EOF
 
 refile first +inbox; folder -pack >/dev/null
 EOF
 
 refile first +inbox; folder -pack >/dev/null
-sortm -verbose >"$actual"
+run_prog sortm -verbose >"$actual"
 scan >>"$actual"
 check "$expected" "$actual"
 
 scan >>"$actual"
 check "$expected" "$actual"
 
@@ -159,7 +159,7 @@ cat >"$expected" <<EOF
 EOF
 
 refile first +inbox; folder -pack >/dev/null
 EOF
 
 refile first +inbox; folder -pack >/dev/null
-sortm -verbose -noverbose >"$actual"
+run_prog sortm -verbose -noverbose >"$actual"
 scan >>"$actual"
 check "$expected" "$actual"
 
 scan >>"$actual"
 check "$expected" "$actual"
 
@@ -180,7 +180,7 @@ cat >"$expected" <<EOF
 EOF
 
 refile first +inbox; folder -pack >/dev/null
 EOF
 
 refile first +inbox; folder -pack >/dev/null
-sortm first last
+run_prog sortm first last
 scan >"$actual"
 check "$expected" "$actual"
 
 scan >"$actual"
 check "$expected" "$actual"
 
@@ -200,7 +200,7 @@ cat >"$expected" <<EOF
   12+ 09/29 Test1              Testing message 1<<This is message number 1 >>
 EOF
 
   12+ 09/29 Test1              Testing message 1<<This is message number 1 >>
 EOF
 
-sortm -datefield Alt-Date 1 11
+run_prog sortm -datefield Alt-Date 1 11
 scan >"$actual"
 check "$expected" "$actual"
 
 scan >"$actual"
 check "$expected" "$actual"
 
@@ -220,7 +220,7 @@ cat >"$expected" <<EOF
   12+ 09/29 Test1              Testing message 1<<This is message number 1 >>
 EOF
 
   12+ 09/29 Test1              Testing message 1<<This is message number 1 >>
 EOF
 
-sortm -textfield subject
+run_prog sortm -textfield subject
 scan >"$actual"
 check "$expected" "$actual"
 
 scan >"$actual"
 check "$expected" "$actual"
 
@@ -240,7 +240,7 @@ cat >"$expected" <<EOF
   12+ 09/29 Test1              Testing message 1<<This is message number 1 >>
 EOF
 
   12+ 09/29 Test1              Testing message 1<<This is message number 1 >>
 EOF
 
-sortm -textfield subject -limit 0 -nolimit
+run_prog sortm -textfield subject -limit 0 -nolimit
 scan >"$actual"
 check "$expected" "$actual"
 
 scan >"$actual"
 check "$expected" "$actual"
 
@@ -261,7 +261,7 @@ cat >"$expected" <<EOF
 EOF
 
 refile 2-7 +inbox; refile 1 +inbox; folder -pack last >/dev/null
 EOF
 
 refile 2-7 +inbox; refile 1 +inbox; folder -pack last >/dev/null
-sortm -textfield subject -limit 0
+run_prog sortm -textfield subject -limit 0
 scan >"$actual"
 check "$expected" "$actual"
 
 scan >"$actual"
 check "$expected" "$actual"
 
@@ -282,7 +282,7 @@ cat >"$expected" <<EOF
 EOF
 
 refile 2-7 +inbox; refile 1 +inbox; folder -pack last >/dev/null
 EOF
 
 refile 2-7 +inbox; refile 1 +inbox; folder -pack last >/dev/null
-sortm -textfield from -limit 0
+run_prog sortm -textfield from -limit 0
 scan >"$actual"
 check "$expected" "$actual"
 
 scan >"$actual"
 check "$expected" "$actual"
 
@@ -313,7 +313,7 @@ cat >"$expected" <<EOF
 EOF
 
 refile 2-7 +inbox; refile 1 +inbox; folder -pack last >/dev/null
 EOF
 
 refile 2-7 +inbox; refile 1 +inbox; folder -pack last >/dev/null
-sortm -textfield subject -limit 10
+run_prog sortm -textfield subject -limit 10
 scan >"$actual"
 check "$expected" "$actual"
 
 scan >"$actual"
 check "$expected" "$actual"
 
@@ -335,7 +335,7 @@ cat >"$expected" <<EOF
 EOF
 
 refile 2-7 +inbox; refile 1 +inbox; folder -pack last >/dev/null
 EOF
 
 refile 2-7 +inbox; refile 1 +inbox; folder -pack last >/dev/null
-sortm -textfield subject -limit 60
+run_prog sortm -textfield subject -limit 60
 scan >"$actual"
 check "$expected" "$actual"
 
 scan >"$actual"
 check "$expected" "$actual"
 
@@ -357,7 +357,7 @@ cat >"$expected" <<EOF
 EOF
 
 refile 2-7 +inbox; refile 1 +inbox; folder -pack last >/dev/null
 EOF
 
 refile 2-7 +inbox; refile 1 +inbox; folder -pack last >/dev/null
-sortm -textfield subject -limit 60 -notextfield
+run_prog sortm -textfield subject -limit 60 -notextfield
 scan >"$actual"
 check "$expected" "$actual"
 
 scan >"$actual"
 check "$expected" "$actual"
 
@@ -382,7 +382,7 @@ cat >"$expected" <<EOF
 EOF
 
 refile first +inbox; folder -pack >/dev/null
 EOF
 
 refile first +inbox; folder -pack >/dev/null
-sortm -noall -all
+run_prog sortm -noall -all
 scan >"$actual"
 check "$expected" "$actual"
 
 scan >"$actual"
 check "$expected" "$actual"
 
@@ -394,7 +394,7 @@ EOF
 
 sed -e 's/Sep//' $MH_TEST_DIR/Mail/inbox/7 > $MH_TEST_DIR/Mail/inbox/14
 set +e
 
 sed -e 's/Sep//' $MH_TEST_DIR/Mail/inbox/7 > $MH_TEST_DIR/Mail/inbox/14
 set +e
-sortm -check >"$actual" 2>&1
+run_prog sortm -check >"$actual" 2>&1
 set -e
 check "$expected" "$actual"
 
 set -e
 check "$expected" "$actual"
 
index df9c342502322981a1fac0df551994e0eda115af..59742484b10621bb3be235731c2494a9fb987a72 100755 (executable)
@@ -14,7 +14,7 @@ fi
 
 setup_test
 
 
 setup_test
 
-output=`folder -total +inbox`
+output=`run_prog folder -total +inbox`
 if test x"$output" != x'TOTAL = 10 messages in 1 folder.' ; then
     exit 1
 fi
 if test x"$output" != x'TOTAL = 10 messages in 1 folder.' ; then
     exit 1
 fi
index b1a199561a94f3afb1c27064f75f0766e376529c..fb3cc917825f7c449dac739749995cb1941c51dc 100755 (executable)
@@ -36,7 +36,7 @@ Usage: dp [switches] dates ...
   -help
 EOF
 
   -help
 EOF
 
-$dp -help >"$actual" 2>&1
+run_prog $dp -help >"$actual" 2>&1
 check "$expected" "$actual"
 
 # check -version
 check "$expected" "$actual"
 
 # check -version
@@ -57,7 +57,7 @@ cat >"$expected" <<EOF
 Sun, 01 Jul 2012 00:00:00
 EOF
 
 Sun, 01 Jul 2012 00:00:00
 EOF
 
-$dp 'Sun Jul  1 2012' > "$actual" 2>&1
+run_prog $dp 'Sun Jul  1 2012' > "$actual" 2>&1
 check "$expected" "$actual"
 
 # check with two valid dates
 check "$expected" "$actual"
 
 # check with two valid dates
@@ -66,7 +66,7 @@ Sun, 01 Jul 2012 00:00:00
 Mon, 02 Jul 2012 00:00:00
 EOF
 
 Mon, 02 Jul 2012 00:00:00
 EOF
 
-$dp 'Sun Jul  1 2012' 'Mon Jul  2 2012' > "$actual" 2>&1
+run_prog $dp 'Sun Jul  1 2012' 'Mon Jul  2 2012' > "$actual" 2>&1
 check "$expected" "$actual"
 
 # check with invalid date
 check "$expected" "$actual"
 
 # check with invalid date
@@ -77,7 +77,7 @@ EOF
 cat >"$expected_err" <<EOF
 EOF
 
 cat >"$expected_err" <<EOF
 EOF
 
-$dp 'not a date' > "$actual" 2> "$actual_err"
+run_prog $dp 'not a date' > "$actual" 2> "$actual_err"
 check "$expected" "$actual"
 check "$expected_err" "$actual_err"
 
 check "$expected" "$actual"
 check "$expected_err" "$actual_err"
 
@@ -91,7 +91,7 @@ cat >"$expected" <<EOF
 Sun
 EOF
 
 Sun
 EOF
 
-$dp -form "$form" 'Jul 1 2012' >$actual 2>&1
+run_prog $dp -form "$form" 'Jul 1 2012' >$actual 2>&1
 check $expected $actual
 rm -f "$form"
 
 check $expected $actual
 rm -f "$form"
 
@@ -100,7 +100,7 @@ cat >"$expected" <<EOF
 Sun
 EOF
 
 Sun
 EOF
 
-$dp -format '%(day{text})' 'Jul 1 2012' >$actual 2>&1
+run_prog $dp -format '%(day{text})' 'Jul 1 2012' >$actual 2>&1
 check $expected $actual
 
 # check -width
 check $expected $actual
 
 # check -width
@@ -108,7 +108,7 @@ cat >"$expected" <<EOF
 Sun, 01 Jul 2012
 EOF
 
 Sun, 01 Jul 2012
 EOF
 
-$dp -width 17 'Sun Jul  1 2012' > "$actual" 2>&1
+run_prog $dp -width 17 'Sun Jul  1 2012' > "$actual" 2>&1
 check "$expected" "$actual"
 
 
 check "$expected" "$actual"
 
 
index 9ea7178f509ccc9725dbc373037223227bd444f3..c7d89833e8ac7ea95e1ecfb9c342fe515653a40d 100755 (executable)
@@ -106,11 +106,11 @@ L10:      CHAR '\n'
        DONE
 EOF
 
        DONE
 EOF
 
-$fmtdump >$actual 2>&1
+run_prog $fmtdump >$actual 2>&1
 check $expected $actual 'keep first'
 
 # check -form
 check $expected $actual 'keep first'
 
 # check -form
-$fmtdump -form "$MH_TEST_DIR/Mail/scan.default" >$actual 2>&1
+run_prog $fmtdump -form "$MH_TEST_DIR/Mail/scan.default" >$actual 2>&1
 check $expected $actual
 
 # check -format
 check $expected $actual
 
 # check -format
@@ -122,7 +122,7 @@ cat >$expected <<EOF
 L0:    DONE
 EOF
 
 L0:    DONE
 EOF
 
-$fmtdump -format '%<(lit 1234567890)%(strlen)%>' >$actual 2>&1
+run_prog $fmtdump -format '%<(lit 1234567890)%(strlen)%>' >$actual 2>&1
 check $expected $actual
 
 
 check $expected $actual
 
 
index 9fc662f87fb65f35991df624d8e17425bce28865..e4956410c3c1242adc3606534420593d6b67b0ab 100755 (executable)
@@ -23,7 +23,7 @@ echo "Local-Mailbox: ${testname}" >> ${MH}
 
 # We can use "ap" to get the output of format commands
 
 
 # We can use "ap" to get the output of format commands
 
-testoutput=`${MH_LIB_DIR}/ap -format "%(localmbox)" ignore`
+testoutput=`run_prog ${MH_LIB_DIR}/ap -format "%(localmbox)" ignore`
 
 if [ x"${testname}" != x"${testoutput}" ]; then
        echo "Expected ${testname}, got ${testoutput}"
 
 if [ x"${testname}" != x"${testoutput}" ]; then
        echo "Expected ${testname}, got ${testoutput}"
index 0221fad2a88277a21e5235d85f85b2258828caff..f71a3c921a41f5a7615b2302cc5ef2aa80a15b36 100755 (executable)
@@ -17,12 +17,12 @@ setup_test
 #### Local-Mailbox profile component, which we don't use in the test
 #### suite, or the user's login name.  ap will escape (quote) it if
 #### needed.
 #### Local-Mailbox profile component, which we don't use in the test
 #### suite, or the user's login name.  ap will escape (quote) it if
 #### needed.
-user=`${MH_LIB_DIR}/ap -format '%(me)' 0`
+user=`run_prog ${MH_LIB_DIR}/ap -format '%(me)' 0`
 host=`${MH_OBJ_DIR}/test/getcanon`
 
 host=`${MH_OBJ_DIR}/test/getcanon`
 
-output=`${MH_LIB_DIR}/ap -format '%(mymbox{text})' "${user}"`
+output=`run_prog ${MH_LIB_DIR}/ap -format '%(mymbox{text})' "${user}"`
 run_test "echo $output" 1 "Basic user test"
 run_test "echo $output" 1 "Basic user test"
-output=`${MH_LIB_DIR}/ap -format '%(mymbox{text})' "${user}@${host}"`
+output=`run_prog ${MH_LIB_DIR}/ap -format '%(mymbox{text})' "${user}@${host}"`
 run_test "echo $output" 1 "Basic user@host test"
 run_test "${MH_LIB_DIR}/ap -format %(mymbox{text}) nosuchuser@nosuchhost.blah" \
          0 "Basic non-matching test"
 run_test "echo $output" 1 "Basic user@host test"
 run_test "${MH_LIB_DIR}/ap -format %(mymbox{text}) nosuchuser@nosuchhost.blah" \
          0 "Basic non-matching test"
@@ -35,17 +35,19 @@ grep -v 'Local-Mailbox: ' ${MH} > ${MH}.new
 mv -f ${MH}.new ${MH}
 echo "Local-Mailbox: ${myname}" >> ${MH}
 
 mv -f ${MH}.new ${MH}
 echo "Local-Mailbox: ${myname}" >> ${MH}
 
-run_test "echo `${MH_LIB_DIR}/ap -format '%(mymbox{text})' "${myname}"`" \
+run_test "echo \
+         `run_prog ${MH_LIB_DIR}/ap -format '%(mymbox{text})' "${myname}"`" \
          1 "Local-Mailbox test"
 
          1 "Local-Mailbox test"
 
-output=`${MH_LIB_DIR}/ap -format '%(mymbox{text})' "${user}@${host}"`
+output=`run_prog ${MH_LIB_DIR}/ap -format '%(mymbox{text})' "${user}@${host}"`
 run_test "echo $output" 0 "Local-mailbox overriding user@host test"
 
 # Add an Alternate-Mailbox.  This caused ismymbox() to lose the
 # Local-Mailbox, Bug #36635: -nocc me doesn't account for
 # Alternate-Mailboxes.
 printf 'Alternate-Mailboxes: user@example.com\n' >> $MH
 run_test "echo $output" 0 "Local-mailbox overriding user@host test"
 
 # Add an Alternate-Mailbox.  This caused ismymbox() to lose the
 # Local-Mailbox, Bug #36635: -nocc me doesn't account for
 # Alternate-Mailboxes.
 printf 'Alternate-Mailboxes: user@example.com\n' >> $MH
-run_test "echo `${MH_LIB_DIR}/ap -format '%(mymbox{text})' "${myname}"`" \
+run_test "echo \
+         `run_prog ${MH_LIB_DIR}/ap -format '%(mymbox{text})' "${myname}"`" \
          1 "Local-Mailbox with Alternate-Mailbox test"
 
 exit $failed
          1 "Local-Mailbox with Alternate-Mailbox test"
 
 exit $failed
index 2685efd0e728a3cafaec695aef435bc7487a85d4..f482db4f43e2efc685ff11a6c3c814c5b80fdd9d 100755 (executable)
@@ -12,7 +12,7 @@ fi
 
 setup_test
 
 
 setup_test
 
-actual=`${MH_LIB_DIR}/ap -format "%-30(friendly{text})<<End of test" "No Such User <nosuch@user.com>"`
+actual=`run_prog ${MH_LIB_DIR}/ap -format "%-30(friendly{text})<<End of test" "No Such User <nosuch@user.com>"`
 expected="                  No Such User<<End of test"
 ##########123456789012345678901234567890
 
 expected="                  No Such User<<End of test"
 ##########123456789012345678901234567890
 
index ff39dddcf280525bf3869be159972fba93502686..6037a203c98101af820eab3b02ff621395cfa690 100755 (executable)
@@ -65,7 +65,7 @@ End of digest-test Digest [Volume 2 Issue 3]
 ********************************************
 EOF
 
 ********************************************
 EOF
 
-forw -editor true -from "${from}" -to "${to1}" -to "${to2}" \
+run_prog forw -editor true -from "${from}" -to "${to1}" -to "${to2}" \
     -cc "${cc1}" -cc "${cc2}" -cc "${cc3}" -cc "${cc4}" -fcc "${fcc1}" \
     -fcc "${fcc2}" -width 60 -issue 3 -volume 2 -nowhatnowproc \
     -digest digest-test +inbox 1-6 || exit 1
     -cc "${cc1}" -cc "${cc2}" -cc "${cc3}" -cc "${cc4}" -fcc "${fcc1}" \
     -fcc "${fcc2}" -width 60 -issue 3 -volume 2 -nowhatnowproc \
     -digest digest-test +inbox 1-6 || exit 1
@@ -111,7 +111,7 @@ End of digest-test Digest [Volume 2 Issue 4]
 ********************************************
 EOF
 
 ********************************************
 EOF
 
-forw -editor true -from "${from}" -nowhatnowproc -digest digest-test \
+run_prog forw -editor true -from "${from}" -nowhatnowproc -digest digest-test \
     -subject "This is a test" +inbox 7-8 || exit 1
 
 check "${expected}" "${actual}"
     -subject "This is a test" +inbox 7-8 || exit 1
 
 check "${expected}" "${actual}"
index e87ce2f2b896b8675c655a0167e34687e5787a27..c96d9f50ab302056e95d04e8b50d49481c75f01f 100755 (executable)
@@ -64,6 +64,7 @@ cat >> "$expected" <<EOF
 ------- End of Forwarded Message
 EOF
 
 ------- End of Forwarded Message
 EOF
 
+run_prog \
 forw -editor true -form "${form}" -from "${from}" -to "${to1}" -to "${to2}" \
     -cc "${cc1}" -cc "${cc2}" -cc "${cc3}" -cc "${cc4}" -fcc "${fcc1}" \
     -fcc "${fcc2}" -subject "${subject}" -width 60 -nowhatnowproc 1 || exit 1
 forw -editor true -form "${form}" -from "${from}" -to "${to1}" -to "${to2}" \
     -cc "${cc1}" -cc "${cc2}" -cc "${cc3}" -cc "${cc4}" -fcc "${fcc1}" \
     -fcc "${fcc2}" -subject "${subject}" -width 60 -nowhatnowproc 1 || exit 1
index 491a520f42e3adea0c808c2e2be8a23023cbf8de..140b54c0f5b757d3123e386987c6992c1ffc4643 100755 (executable)
@@ -329,7 +329,7 @@ Subject: FLDPLUS test
 Date: Wed, 16 Jan 2013 20:33:58 -0600
 
 EOF
 Date: Wed, 16 Jan 2013 20:33:58 -0600
 
 EOF
-inc -file "$MH_TEST_DIR/mess" >/dev/null
+run_prog inc -file "$MH_TEST_DIR/mess" >/dev/null
 check "$expected" `mhpath last`  ||  rmm last
 rm -f "$MH_TEST_DIR/mess"
 
 check "$expected" `mhpath last`  ||  rmm last
 rm -f "$MH_TEST_DIR/mess"
 
index c6850d99026612472b748b79498bca0974083755..066058b836e00c073df1fd81336b24ae01b061ea 100755 (executable)
@@ -39,7 +39,7 @@ Usage: msgchk [switches] [users ...]
   -help
 EOF
 
   -help
 EOF
 
-msgchk -help | head -9 >"$actual" 2>&1
+run_prog msgchk -help | head -9 >"$actual" 2>&1
 check "$expected" "$actual"
 
 # check -version
 check "$expected" "$actual"
 
 # check -version
@@ -65,7 +65,7 @@ cat >"$expected" <<EOF
 You have new mail waiting; last read on
 EOF
 
 You have new mail waiting; last read on
 EOF
 
-msgchk | sed -e 's/last read on.*/last read on/' >"$actual"
+run_prog msgchk | sed -e 's/last read on.*/last read on/' >"$actual"
 check "$expected" "$actual"
 
 # check -date
 check "$expected" "$actual"
 
 # check -date
@@ -73,7 +73,8 @@ cat >"$expected" <<EOF
 You have new mail waiting; last read on
 EOF
 
 You have new mail waiting; last read on
 EOF
 
-msgchk -nodate -date | sed -e 's/last read on.*/last read on/' >"$actual"
+run_prog msgchk -nodate -date | sed -e 's/last read on.*/last read on/' \
+  >"$actual"
 check "$expected" "$actual"
 
 # check -nodate
 check "$expected" "$actual"
 
 # check -nodate
@@ -97,7 +98,7 @@ run_test 'msgchk -nonotify nomail -nodate' 'You have new mail waiting'
 # check -nonotify all, when there is mail
 run_test 'msgchk -nonotify nomail -nonotify all -nodate' ''
 
 # check -nonotify all, when there is mail
 run_test 'msgchk -nonotify nomail -nonotify all -nodate' ''
 
-inc -silent
+run_prog inc -silent
 
 # check -notify mail, when there is no mail
 run_test 'msgchk -notify mail -nodate' "You don't have any mail waiting"
 
 # check -notify mail, when there is no mail
 run_test 'msgchk -notify mail -nodate' "You don't have any mail waiting"
index 5a9396179f217d6ca15c040d56e50e60b2d44add..9798e5ede843be2a906bb2016af355b25afd3c91 100755 (executable)
@@ -26,7 +26,7 @@ run_test "install-mh -auto" 'install-mh: invocation error'
 # check -check, with nmh already installed
 run_test "install-mh -check" ''
 # make sure exit status is 0
 # check -check, with nmh already installed
 run_test "install-mh -check" ''
 # make sure exit status is 0
-install-mh -check
+run_prog install-mh -check
 run_test "echo $?" '0'
 
 # Remove the nmh installation so that install-mh can install.
 run_test "echo $?" '0'
 
 # Remove the nmh installation so that install-mh can install.
@@ -36,7 +36,7 @@ rm -rf $MH_TEST_DIR/Mail
 run_test "install-mh -check" ''
 # make sure exit status is 1
 set +e
 run_test "install-mh -check" ''
 # make sure exit status is 1
 set +e
-install-mh -check
+run_prog install-mh -check
 run_test "echo $?" '1'
 set -e
 
 run_test "echo $?" '1'
 set -e
 
@@ -47,10 +47,10 @@ echo "n
 n
 n
 $installpath
 n
 n
 $installpath
-y" | install-mh >/dev/null
+y" | run_prog install-mh >/dev/null
 
 if [ -f $MH_TEST_DIR/Mail/context  -a  -f $MH_TEST_DIR/Mail/.mh_profile ]; then
 
 if [ -f $MH_TEST_DIR/Mail/context  -a  -f $MH_TEST_DIR/Mail/.mh_profile ]; then
-  install-mh -check
+  run_prog install-mh -check
 else
   failed=`expr ${failed:-0} + 1`
 fi
 else
   failed=`expr ${failed:-0} + 1`
 fi
@@ -62,7 +62,7 @@ rm -rf $MH_TEST_DIR/Mail
 HOME=$MH_TEST_DIR install-mh -auto >/dev/null
 
 if [ -f $MH_TEST_DIR/Mail/context  -a  -f $MH_TEST_DIR/Mail/.mh_profile ]; then
 HOME=$MH_TEST_DIR install-mh -auto >/dev/null
 
 if [ -f $MH_TEST_DIR/Mail/context  -a  -f $MH_TEST_DIR/Mail/.mh_profile ]; then
-  install-mh -check
+  run_prog install-mh -check
 else
   failed=`expr ${failed:-0} + 1`
 fi
 else
   failed=`expr ${failed:-0} + 1`
 fi
index 4c2d1935bb57911d2f1173a22ce396772d586a13..e2d7eac4f37fb21bb969c5e3ce41f794f8fe8af1 100755 (executable)
@@ -35,12 +35,12 @@ do
 
     echo "datalocking: $locktype" >> ${MH}
 
 
     echo "datalocking: $locktype" >> ${MH}
 
-    mark 2 4 6 -sequence test -add
+    run_prog mark 2 4 6 -sequence test -add
 
     run_test 'mark -list' 'cur: 1
 test: 2 4 6'
 
 
     run_test 'mark -list' 'cur: 1
 test: 2 4 6'
 
-    mark all -sequence test -delete
+    run_prog mark all -sequence test -delete
 
 done
 
 
 done
 
index 7326b51f7c0166ebb8898a7fe0ae5f4185e45675..771bec0e5e744d0713ba43a3a1d0026959df0599 100755 (executable)
@@ -66,7 +66,7 @@ This is message number 2
 ------- =_aaaaaaaaaa0--
 EOF
 mkdraft
 ------- =_aaaaaaaaaa0--
 EOF
 mkdraft
-mhbuild $draft
+run_prog mhbuild $draft
 check $expected $draft
 test ${failed:-0} -eq 0  &&  rm "$draftorig"
 
 check $expected $draft
 test ${failed:-0} -eq 0  &&  rm "$draftorig"
 
@@ -104,7 +104,7 @@ This is message number 2
 ------- =_aaaaaaaaaa0--
 EOF
 mkdraft
 ------- =_aaaaaaaaaa0--
 EOF
 mkdraft
-mhbuild -rfc934 $draft
+run_prog mhbuild -rfc934 $draft
 check $expected $draft
 test ${failed:-0} -eq 0  &&  rm "$draftorig"
 
 check $expected $draft
 test ${failed:-0} -eq 0  &&  rm "$draftorig"
 
index fa0031f5416834c84e2f01019988747f5597829e..e4883b5ab929ffcb368ea3090e52301ffa13faaa 100755 (executable)
@@ -45,7 +45,7 @@ Content-Type: text/plain; charset="us-ascii"
 This is a test
 EOF
 
 This is a test
 EOF
 
-mhbuild "${testname}.basic.actual"
+run_prog mhbuild "${testname}.basic.actual"
 
 check "${testname}.basic.actual" "${testname}.basic.expected" 'keep first'
 
 
 check "${testname}.basic.actual" "${testname}.basic.expected" 'keep first'
 
@@ -78,7 +78,7 @@ Content-Type: text/plain; charset="us-ascii"
 This is a test
 EOF
 
 This is a test
 EOF
 
-mhbuild -headerencoding base64 "${testname}.basic.actual"
+run_prog mhbuild -headerencoding base64 "${testname}.basic.actual"
 
 check "${testname}.basic.actual" "${testname}.basic.expected" 'keep first'
 
 
 check "${testname}.basic.actual" "${testname}.basic.expected" 'keep first'
 
@@ -108,7 +108,7 @@ Content-Type: text/plain; charset="us-ascii"
 This is a test
 EOF
 
 This is a test
 EOF
 
-mhbuild "${testname}.autopick.actual"
+run_prog mhbuild "${testname}.autopick.actual"
 
 check "${testname}.autopick.actual" "${testname}.autopick.expected" 'keep first'
 
 
 check "${testname}.autopick.actual" "${testname}.autopick.expected" 'keep first'
 
@@ -143,7 +143,7 @@ Content-Type: text/plain; charset="us-ascii"
 This is a test of a very long subject line.
 EOF
 
 This is a test of a very long subject line.
 EOF
 
-mhbuild "${testname}.longsubject1.actual"
+run_prog mhbuild "${testname}.longsubject1.actual"
 
 check "${testname}.longsubject1.actual" "${testname}.longsubject1.expected" 'keep first'
 
 
 check "${testname}.longsubject1.actual" "${testname}.longsubject1.expected" 'keep first'
 
@@ -179,7 +179,7 @@ Content-Type: text/plain; charset="us-ascii"
 This is a test of a very long subject line using base64.
 EOF
 
 This is a test of a very long subject line using base64.
 EOF
 
-mhbuild "${testname}.longsubject2.actual"
+run_prog mhbuild "${testname}.longsubject2.actual"
 
 check "${testname}.longsubject2.actual" "${testname}.longsubject2.expected" 'keep first'
 
 
 check "${testname}.longsubject2.actual" "${testname}.longsubject2.expected" 'keep first'
 
@@ -214,7 +214,7 @@ Content-Type: text/plain; charset="us-ascii"
 This is another long test.
 EOF
 
 This is another long test.
 EOF
 
-mhbuild "${testname}.longsubject3.actual"
+run_prog mhbuild "${testname}.longsubject3.actual"
 
 check "${testname}.longsubject3.actual" "${testname}.longsubject3.expected" 'keep first'
 
 
 check "${testname}.longsubject3.actual" "${testname}.longsubject3.expected" 'keep first'
 
@@ -244,7 +244,7 @@ Content-Type: text/plain; charset="us-ascii"
 This is another long test.
 EOF
 
 This is another long test.
 EOF
 
-mhbuild "${testname}.longsubject4.actual"
+run_prog mhbuild "${testname}.longsubject4.actual"
 
 check "${testname}.longsubject4.actual" "${testname}.longsubject4.expected" 'keep first'
 
 
 check "${testname}.longsubject4.actual" "${testname}.longsubject4.expected" 'keep first'
 
@@ -274,7 +274,7 @@ Content-Type: text/plain; charset="us-ascii"
 This is important information
 EOF
 
 This is important information
 EOF
 
-mhbuild "${testname}.basicemail1.actual"
+run_prog mhbuild "${testname}.basicemail1.actual"
 
 check "${testname}.basicemail1.actual" "${testname}.basicemail1.expected" 'keep first'
 
 
 check "${testname}.basicemail1.actual" "${testname}.basicemail1.expected" 'keep first'
 
@@ -301,7 +301,7 @@ Content-Type: text/plain; charset="us-ascii"
 This is important information
 EOF
 
 This is important information
 EOF
 
-mhbuild "${testname}.basicemail2.actual"
+run_prog mhbuild "${testname}.basicemail2.actual"
 
 check "${testname}.basicemail2.actual" "${testname}.basicemail2.expected" 'keep first'
 
 
 check "${testname}.basicemail2.actual" "${testname}.basicemail2.expected" 'keep first'
 
@@ -332,7 +332,7 @@ Content-Type: text/plain; charset="us-ascii"
 This is important information
 EOF
 
 This is important information
 EOF
 
-mhbuild "${testname}.basicemail3.actual"
+run_prog mhbuild "${testname}.basicemail3.actual"
 
 check "${testname}.basicemail3.actual" "${testname}.basicemail3.expected" 'keep first'
 
 
 check "${testname}.basicemail3.actual" "${testname}.basicemail3.expected" 'keep first'
 
@@ -359,7 +359,7 @@ Content-Type: text/plain; charset="us-ascii"
 This is important information
 EOF
 
 This is important information
 EOF
 
-mhbuild "${testname}.basicemail4.actual"
+run_prog mhbuild "${testname}.basicemail4.actual"
 
 check "${testname}.basicemail4.actual" "${testname}.basicemail4.expected" 'keep first'
 
 
 check "${testname}.basicemail4.actual" "${testname}.basicemail4.expected" 'keep first'
 
@@ -402,7 +402,7 @@ Content-Type: text/plain; charset="us-ascii"
 This is a lot of people on this email!
 EOF
 
 This is a lot of people on this email!
 EOF
 
-mhbuild "${testname}.complexemail1.actual"
+run_prog mhbuild "${testname}.complexemail1.actual"
 
 check "${testname}.complexemail1.actual" "${testname}.complexemail1.expected" 'keep first'
 
 
 check "${testname}.complexemail1.actual" "${testname}.complexemail1.expected" 'keep first'
 
index 5539489c78feb75bcbcc9ce3e3beae10d6b6d31b..e4a7c4e4a1c4a104dff45daceb6363540301e4ae 100755 (executable)
@@ -27,7 +27,7 @@ MHMTSCONF="$mts_fakesendmail"
 # argument: expected output
 test_attachment ()
 {
 # argument: expected output
 test_attachment ()
 {
-  send -draft -mts sendmail/pipe
+  run_prog send -draft -mts sendmail/pipe
 
   # fakesendmail drops the message and any cc's into this mbox.
   mbox="${MH_TEST_DIR}"/Mail/fakesendmail.mbox
 
   # fakesendmail drops the message and any cc's into this mbox.
   mbox="${MH_TEST_DIR}"/Mail/fakesendmail.mbox
index bbc60f6543b304ea2a02c1c1557e60c1c62a9516..317d02b28000c36210f1961684e4b7fac2830d44 100755 (executable)
@@ -65,7 +65,7 @@ Usage: mhfixmsg [+folder] [msgs] [switches]
   -help
 EOF
 
   -help
 EOF
 
-mhfixmsg -help >"$actual" 2>&1
+run_prog mhfixmsg -help >"$actual" 2>&1
 check "$expected" "$actual"
 
 
 check "$expected" "$actual"
 
 
@@ -253,7 +253,8 @@ mhfixmsg: 12 part 1, decode text/html; charset=\"Windows-1252\"" \
        >"$expected.err"
 
   #### lynx inserts multiple blank lines, so squeeze them.
        >"$expected.err"
 
   #### lynx inserts multiple blank lines, so squeeze them.
-  mhfixmsg last -outfile - -verbose 2>"$actual.err" | squeeze_lines >"$actual"
+  run_prog mhfixmsg last -outfile - -verbose 2>"$actual.err" | \
+    squeeze_lines >"$actual"
   check "$expected" "$actual" 'ignore space'
   check "$expected.err" "$actual.err"
 else
   check "$expected" "$actual" 'ignore space'
   check "$expected.err" "$actual.err"
 else
@@ -334,7 +335,8 @@ mhfixmsg: 12 part 1, decode text/html; charset=\"Windows-1252\"" \
        >"$expected.err"
 
   #### lynx inserts multiple blank lines, so squeeze them.
        >"$expected.err"
 
   #### lynx inserts multiple blank lines, so squeeze them.
-  mhfixmsg last -outfile - -verbose 2>"$actual.err" | squeeze_lines >"$actual"
+  run_prog mhfixmsg last -outfile - -verbose 2>"$actual.err" | \
+    squeeze_lines >"$actual"
   check "$expected" "$actual" 'ignore space'
   check "$expected.err" "$actual.err"
 else
   check "$expected" "$actual" 'ignore space'
   check "$expected.err" "$actual.err"
 else
@@ -406,7 +408,7 @@ if [ $can_reformat_texthtml -eq 1 ]; then
   printf '%s\n' 'mhfixmsg: 12, insert text/plain part' >"$expected.err"
 
   #### lynx inserts multiple blank lines, so squeeze them.
   printf '%s\n' 'mhfixmsg: 12, insert text/plain part' >"$expected.err"
 
   #### lynx inserts multiple blank lines, so squeeze them.
-  mhfixmsg last -nodecode -outfile - -verbose 2>"$actual.err" | \
+  run_prog mhfixmsg last -nodecode -outfile - -verbose 2>"$actual.err" | \
     squeeze_lines >"$actual"
   check "$expected" "$actual" 'ignore space'
   check "$expected.err" "$actual.err"
     squeeze_lines >"$actual"
   check "$expected" "$actual" 'ignore space'
   check "$expected.err" "$actual.err"
@@ -450,7 +452,7 @@ VGhpcyBpcyBhIHRleHQvcGxhaW4gcGFydC4K
 ------- =_aaaaaaaaaa0--
 EOF
 
 ------- =_aaaaaaaaaa0--
 EOF
 
-mhfixmsg last -outfile "$actual"
+run_prog mhfixmsg last -outfile "$actual"
 check "$expected" "$actual"
 
 
 check "$expected" "$actual"
 
 
@@ -554,7 +556,7 @@ VGhpcyBpcyB0aGUgZm91cnRoIHRleHQvcGxhaW4gcGFydC4K
 
 This is additional content after the last subpart of the multipart.
 EOF
 
 This is additional content after the last subpart of the multipart.
 EOF
-mhfixmsg last -outfile "$actual"
+run_prog mhfixmsg last -outfile "$actual"
 check "$expected" "$actual"
 
 
 check "$expected" "$actual"
 
 
@@ -579,7 +581,7 @@ EOF
 
 cp -p `mhpath last` "$expected"
 set +e
 
 cp -p `mhpath last` "$expected"
 set +e
-mhfixmsg last
+run_prog mhfixmsg last
 set -e
 check `mhpath last` "$expected" 'keep first'
 
 set -e
 check `mhpath last` "$expected" 'keep first'
 
@@ -670,7 +672,7 @@ if [ $can_reformat_texthtml -eq 1 ]; then
   #### lynx inserts multiple blank lines, so squeeze them.
   #### Truncate to avoid comparing the html portion because it can
   #### get reformatted.
   #### lynx inserts multiple blank lines, so squeeze them.
   #### Truncate to avoid comparing the html portion because it can
   #### get reformatted.
-  mhfixmsg last -outfile - | squeeze_lines | head -22 >"$actual"
+  run_prog mhfixmsg last -outfile - | squeeze_lines | head -22 >"$actual"
   check "$expected" "$actual" 'ignore space'
 else
   cp -p "$MH_TEST_DIR/Mail/inbox/15" "$MH_TEST_DIR/Mail/inbox/15.backup"
   check "$expected" "$actual" 'ignore space'
 else
   cp -p "$MH_TEST_DIR/Mail/inbox/15" "$MH_TEST_DIR/Mail/inbox/15.backup"
@@ -718,7 +720,7 @@ vbI9vAo=
 EOF
 
 set +e
 EOF
 
 set +e
-mhfixmsg last -textcodeset utf-8 -outfile "$actual" 2>"$actual.err"
+run_prog mhfixmsg last -textcodeset utf-8 -outfile "$actual" 2>"$actual.err"
 if grep "mhfixmsg: Can't convert .* to .* without iconv" "$actual.err" \
   >/dev/null; then
   echo "$0: skipping -textcodeset check because nmh was built without iconv"
 if grep "mhfixmsg: Can't convert .* to .* without iconv" "$actual.err" \
   >/dev/null; then
   echo "$0: skipping -textcodeset check because nmh was built without iconv"
@@ -761,7 +763,7 @@ check "$MH_TEST_DIR"/Mail/inbox/17 "$MH_TEST_DIR"/Mail/inbox/18 'keep first'
 
 
 # check that message is not output when fed through stdin
 
 
 # check that message is not output when fed through stdin
-mhfixmsg -file - -verbose <`mhpath last` >"$actual" 2>"$actual.err"
+run_prog mhfixmsg -file - -verbose <`mhpath last` >"$actual" 2>"$actual.err"
 check "$expected" "$actual"
 if grep "mhfixmsg: $MH_TEST_DIR/Mail/.*, fix multipart boundary" \
    "$actual.err" >/dev/null; then
 check "$expected" "$actual"
 if grep "mhfixmsg: $MH_TEST_DIR/Mail/.*, fix multipart boundary" \
    "$actual.err" >/dev/null; then
@@ -870,7 +872,7 @@ EOF
 
 if [ $can_reformat_texthtml -eq 1 ]; then
   #### lynx inserts multiple blank lines, so squeeze them.
 
 if [ $can_reformat_texthtml -eq 1 ]; then
   #### lynx inserts multiple blank lines, so squeeze them.
-  mhfixmsg last -outfile - | squeeze_lines >"$actual"
+  run_prog mhfixmsg last -outfile - | squeeze_lines >"$actual"
   check "$expected" "$actual" 'ignore space'
 else
   rm -f "$expected"
   check "$expected" "$actual" 'ignore space'
 else
   rm -f "$expected"
@@ -963,7 +965,7 @@ There are two CR-LF pairs at the end of this sentence.
 \r
 EOF
 
 \r
 EOF
 
-mhfixmsg last -outfile "$actual"
+run_prog mhfixmsg last -outfile "$actual"
 check "$expected" "$actual"
 
 
 check "$expected" "$actual"
 
 
@@ -1029,7 +1031,8 @@ EOF
 
 if [ $can_reformat_texthtml -eq 1 ]; then
   #### lynx inserts multiple blank lines, so squeeze them.
 
 if [ $can_reformat_texthtml -eq 1 ]; then
   #### lynx inserts multiple blank lines, so squeeze them.
-  mhfixmsg last -replacetextplain -outfile - | squeeze_lines > "$actual"
+  run_prog mhfixmsg last -replacetextplain -outfile - | \
+    squeeze_lines > "$actual"
   check "$expected" "$actual" 'ignore space'
 else
   rm -f "$expected"
   check "$expected" "$actual" 'ignore space'
 else
   rm -f "$expected"
@@ -1067,7 +1070,7 @@ Content-Disposition: inline
 ------=_Part_876302--
 EOF
 
 ------=_Part_876302--
 EOF
 
-mhfixmsg last -replacetextplain -noreplacetextplain -outfile "$actual"
+run_prog mhfixmsg last -replacetextplain -noreplacetextplain -outfile "$actual"
 check "$expected" "$actual"
 
 
 check "$expected" "$actual"
 
 
index b1d59d109014a95a93d4be03eca4d7443031e8e8..d14475c35fcd06fa81548724fa03e93abfec5cc1 100755 (executable)
@@ -29,26 +29,26 @@ cat > $expected <<EOF
  msg part  type/subtype              size description
    5       text/plain                  25
 EOF
  msg part  type/subtype              size description
    5       text/plain                  25
 EOF
-mhlist > $actual 2>&1
+run_prog mhlist > $actual 2>&1
 check $expected $actual 'keep first'
 
 # check -noheaders
 run_test 'mhlist 5 -noheaders' '   5       text/plain                  25'
 
 # check -headers
 check $expected $actual 'keep first'
 
 # check -noheaders
 run_test 'mhlist 5 -noheaders' '   5       text/plain                  25'
 
 # check -headers
-mhlist -noheaders -headers > $actual 2>&1
+run_prog mhlist -noheaders -headers > $actual 2>&1
 check $expected $actual 'keep first'
 
 # check with folder and current message
 check $expected $actual 'keep first'
 
 # check with folder and current message
-mhlist +inbox > $actual 2>&1
+run_prog mhlist +inbox > $actual 2>&1
 check $expected $actual 'keep first'
 
 # check with specified message
 check $expected $actual 'keep first'
 
 # check with specified message
-mhlist 5 > $actual 2>&1
+run_prog mhlist 5 > $actual 2>&1
 check $expected $actual 'keep first'
 
 # check -file
 check $expected $actual 'keep first'
 
 # check -file
-mhlist -file "$MH_TEST_DIR/Mail/inbox/5" > $actual 2>&1
+run_prog mhlist -file "$MH_TEST_DIR/Mail/inbox/5" > $actual 2>&1
 check $expected $actual
 
 # check -file -
 check $expected $actual
 
 # check -file -
@@ -56,7 +56,7 @@ cat > $expected <<EOF
  msg part  type/subtype              size description
    0       text/plain                  25
 EOF
  msg part  type/subtype              size description
    0       text/plain                  25
 EOF
-mhlist -file - < "$MH_TEST_DIR/Mail/inbox/5" > $actual 2>&1
+run_prog mhlist -file - < "$MH_TEST_DIR/Mail/inbox/5" > $actual 2>&1
 check $expected $actual
 
 # check message number greater than highest
 check $expected $actual
 
 # check message number greater than highest
@@ -68,7 +68,7 @@ cat > $expected <<EOF
    2       text/plain                  25
    8       text/plain                  25
 EOF
    2       text/plain                  25
    8       text/plain                  25
 EOF
-mhlist 2 8 > $actual 2>&1
+run_prog mhlist 2 8 > $actual 2>&1
 check $expected $actual
 
 # Write message with a text/plain subpart.
 check $expected $actual
 
 # Write message with a text/plain subpart.
@@ -360,7 +360,7 @@ This is part 2.
 --1--
 EOF
 
 --1--
 EOF
 
-mhlist last > $actual 2>&1
+run_prog mhlist last > $actual 2>&1
 check $expected $actual
 
 
 check $expected $actual
 
 
index a5bb2e78fbbb31c78123d6eb4e5b0e94d94afc38..0dd8e2b23e25270f4e1d56ef6897d550d935c0c8 100755 (executable)
@@ -50,18 +50,18 @@ run_test 'mhparam -nonexistent' 'mhparam: -nonexistent unknown'
 cp $MH_TEST_DIR/Mail/.mh_profile $expected
 # -all adds current folder
 echo 'Current-Folder: '`folder -f` >>$expected
 cp $MH_TEST_DIR/Mail/.mh_profile $expected
 # -all adds current folder
 echo 'Current-Folder: '`folder -f` >>$expected
-mhparam -all >$actual
+run_prog mhparam -all >$actual
 check $expected $actual 'keep first'
 
 # check -all with a component
 echo 'mhparam: profile-components ignored with -all' >$expected_err
 check $expected $actual 'keep first'
 
 # check -all with a component
 echo 'mhparam: profile-components ignored with -all' >$expected_err
-mhparam -all path >$actual 2>$actual_err
+run_prog mhparam -all path >$actual 2>$actual_err
 check $expected $actual 'keep first'
 check $expected_err $actual_err
 
 # check -all with -components
 echo 'mhparam: -components ignored with -all' >$expected_err
 check $expected $actual 'keep first'
 check $expected_err $actual_err
 
 # check -all with -components
 echo 'mhparam: -components ignored with -all' >$expected_err
-mhparam -all -components >$actual 2>$actual_err
+run_prog mhparam -all -components >$actual 2>$actual_err
 check $expected $actual
 check $expected_err $actual_err
 
 check $expected $actual
 check $expected_err $actual_err
 
@@ -102,7 +102,7 @@ $sysconfdir
 ${MH_LIB_DIR}
 EOF
 
 ${MH_LIB_DIR}
 EOF
 
-mhparam -nocomponent \
+run_prog mhparam -nocomponent \
 context \
 mh-sequences \
 buildmimeproc \
 context \
 mh-sequences \
 buildmimeproc \
index a9aeee1ac8874d51cb0d6f37e5a458c7ae1396ca..a4b621b787926198e87098e002fccbb72aee3f7f 100755 (executable)
@@ -28,7 +28,7 @@ Usage: mhpath [+folder] [msgs] [switches]
   -help
 EOF
 
   -help
 EOF
 
-mhpath -help > $actual 2>&1
+run_prog mhpath -help > $actual 2>&1
 check $expected $actual
 
 # check -version
 check $expected $actual
 
 # check -version
@@ -61,7 +61,7 @@ $MH_TEST_DIR/Mail/inbox/8
 $MH_TEST_DIR/Mail/inbox/9
 $MH_TEST_DIR/Mail/inbox/10
 EOF
 $MH_TEST_DIR/Mail/inbox/9
 $MH_TEST_DIR/Mail/inbox/10
 EOF
-mhpath all > $actual 2>&1
+run_prog mhpath all > $actual 2>&1
 check $expected $actual
 
 # check message number greater than highest
 check $expected $actual
 
 # check message number greater than highest
@@ -81,7 +81,7 @@ $MH_TEST_DIR/Mail/inbox/8
 $MH_TEST_DIR/Mail/inbox/9
 $MH_TEST_DIR/Mail/inbox/10
 EOF
 $MH_TEST_DIR/Mail/inbox/9
 $MH_TEST_DIR/Mail/inbox/10
 EOF
-mhpath 1-99999 > $actual 2>&1
+run_prog mhpath 1-99999 > $actual 2>&1
 check $expected $actual
 
 # check new
 check $expected $actual
 
 # check new
@@ -93,7 +93,7 @@ $MH_TEST_DIR/Mail/inbox/1
 $MH_TEST_DIR/Mail/inbox/10
 $MH_TEST_DIR/Mail/inbox/11
 EOF
 $MH_TEST_DIR/Mail/inbox/10
 $MH_TEST_DIR/Mail/inbox/11
 EOF
-mhpath first last new > $actual 2>&1
+run_prog mhpath first last new > $actual 2>&1
 check $expected $actual
 
 # check invalid message list using names
 check $expected $actual
 
 # check invalid message list using names
@@ -124,7 +124,7 @@ cat > $expected <<EOF
 $MH_TEST_DIR/Mail/inbox/3
 $MH_TEST_DIR/Mail/inbox/4
 EOF
 $MH_TEST_DIR/Mail/inbox/3
 $MH_TEST_DIR/Mail/inbox/4
 EOF
-mhpath first:2 > $actual 2>&1
+run_prog mhpath first:2 > $actual 2>&1
 check $expected $actual
 
 # check reference to non-existant messages
 check $expected $actual
 
 # check reference to non-existant messages
@@ -132,7 +132,7 @@ cat > $expected <<EOF
 $MH_TEST_DIR/Mail/inbox/1
 $MH_TEST_DIR/Mail/inbox/2
 EOF
 $MH_TEST_DIR/Mail/inbox/1
 $MH_TEST_DIR/Mail/inbox/2
 EOF
-mhpath 1 2 > $actual 2>&1
+run_prog mhpath 1 2 > $actual 2>&1
 check $expected $actual
 
 
 check $expected $actual
 
 
index 64c9812b6d9bb90fbde317c3ea362bba8a16449b..d3e735448b9319e25b4f7233b21c4479fa7492f7 100755 (executable)
@@ -48,7 +48,7 @@ part       text/plain                  10
 This is a test
 EOF
 
 This is a test
 EOF
 
-mhshow -nopause $msgnum > $actual 2>&1
+run_prog mhshow -nopause $msgnum > $actual 2>&1
 check "$expected" "$actual"
 
 exit $failed
 check "$expected" "$actual"
 
 exit $failed
index 8f582b0a3f0e0cf7a87d550d4256ab7d83fdf079..9c31a657f06b59a888f558a8c02ef8c065efcf17 100755 (executable)
@@ -46,7 +46,7 @@ Content-Disposition: inline
 part       text/plain                  34
 This is a test; this is the body.
 EOF
 part       text/plain                  34
 This is a test; this is the body.
 EOF
-mhshow -nopause $msgnum > $actual 2>&1
+run_prog mhshow -nopause $msgnum > $actual 2>&1
 check "$expected" "$actual"
 
 exit $failed
 check "$expected" "$actual"
 
 exit $failed
index 4b28fa60d3673b89735b4b7de4a37753a10592ec..a05a1b4f2679fc15d96506fcec0dc74fe6360b00 100755 (executable)
@@ -157,7 +157,7 @@ part 1.1   text/plain                  29
 This is the text/plain part.
 EOF
 
 This is the text/plain part.
 EOF
 
-mhshow -part 1.1 -form mhl.null -nopause $msgnum >"$actual" 2>&1
+run_prog mhshow -part 1.1 -form mhl.null -nopause $msgnum >"$actual" 2>&1
 check "$expected" "$actual"
 
 # check a boundary condition in m_getfld():  its internal message
 check "$expected" "$actual"
 
 # check a boundary condition in m_getfld():  its internal message
@@ -297,7 +297,7 @@ part 1.1   text/plain                  29
 This is the text/plain part.
 EOF
 
 This is the text/plain part.
 EOF
 
-mhshow -part 1.1 -form mhl.null -nopause $msgnum >"$actual" 2>&1
+run_prog mhshow -part 1.1 -form mhl.null -nopause $msgnum >"$actual" 2>&1
 check "$expected" "$actual"
 
 # check a boundary condition in m_getfld():  its internal message
 check "$expected" "$actual"
 
 # check a boundary condition in m_getfld():  its internal message
@@ -385,7 +385,7 @@ part 1.1   text/plain                  29
 This is the text/plain part.
 EOF
 
 This is the text/plain part.
 EOF
 
-mhshow -part 1.1 -form mhl.null -nopause $msgnum >"$actual" 2>&1
+run_prog mhshow -part 1.1 -form mhl.null -nopause $msgnum >"$actual" 2>&1
 check "$expected" "$actual"
 
 
 check "$expected" "$actual"
 
 
index 924ee7b253d220471596dbc7b553f5e4e72198c4..96b2969d376dc9d0e7bee063f316b792cd22a465 100755 (executable)
@@ -68,7 +68,7 @@ just a newline
 =l
 =\b ^H (backspace) character, probably erased = in diff output
 EOF
 =l
 =\b ^H (backspace) character, probably erased = in diff output
 EOF
-mhshow -nopause $msgnum > $actual 2>&1
+run_prog mhshow -nopause $msgnum > $actual 2>&1
 check "$expected" "$actual"
 
 exit $failed
 check "$expected" "$actual"
 
 exit $failed
index eb74acddd53fdad662b44d261bf6f4ee2cbdac30..0d152bb3d208608616d80c68d8d8575c62ec704f 100755 (executable)
@@ -56,7 +56,7 @@ This is the text/plain part.
 EOF
 
 # check it
 EOF
 
 # check it
-mhshow -part 1.1 -form mhl.null -nopause $msgnum > $actual 2>&1
+run_prog mhshow -part 1.1 -form mhl.null -nopause $msgnum > $actual 2>&1
 check "$expected" "$actual"
 
 exit $failed
 check "$expected" "$actual"
 
 exit $failed
index d1f85427408d5dc6cc7779deae6c4f6ae60b665a..2dc035718f894cb3c2fbf913c4f4493ff4a7e7df 100755 (executable)
@@ -46,18 +46,18 @@ run_test "mhstore -file $MH_TEST_DIR/Mail/inbox/5" \
 check $expected 5.txt 'keep first'
 
 # check -file -
 check $expected 5.txt 'keep first'
 
 # check -file -
-stored_contents=`mhstore -file - < $MH_TEST_DIR/Mail/inbox/5 2>&1 | \
+stored_contents=`run_prog mhstore -file - < $MH_TEST_DIR/Mail/inbox/5 2>&1 | \
   sed 's/.*as file //'`
 check $expected $stored_contents 'keep first'
 
 # check -outfile
   sed 's/.*as file //'`
 check $expected $stored_contents 'keep first'
 
 # check -outfile
-mhstore 5 -outfile "$actual" 2>&1 | grep -v '^storing' && \
+run_prog mhstore 5 -outfile "$actual" 2>&1 | grep -v '^storing' && \
   echo unexpected output from test-mhstore check -outfile >&2
 check $expected "$actual" 'keep first'
 
 # check -outfile -
 echo 'storing message 5 to stdout' >>"$expected"
   echo unexpected output from test-mhstore check -outfile >&2
 check $expected "$actual" 'keep first'
 
 # check -outfile -
 echo 'storing message 5 to stdout' >>"$expected"
-mhstore 5 -outfile - >"$actual" 2>&1
+run_prog mhstore 5 -outfile - >"$actual" 2>&1
 check $expected "$actual"
 
 # check message number greater than highest
 check $expected "$actual"
 
 # check message number greater than highest
index 63f4f8069942db1438c208fb51276cedfc7e29d7..1fba4609fb171d3db942ae2bb474005f30d3a1d1 100755 (executable)
@@ -32,23 +32,23 @@ EOF
 cat > $expected <<EOF
 new: must specify sequences or set Unseen-Sequence
 EOF
 cat > $expected <<EOF
 new: must specify sequences or set Unseen-Sequence
 EOF
-new > $actual 2>&1
+run_prog new > $actual 2>&1
 check $expected $actual
 
 # test with no desired messages
 cat > $expected <<EOF
  total      0.
 EOF
 check $expected $actual
 
 # test with no desired messages
 cat > $expected <<EOF
  total      0.
 EOF
-new aseq > $actual 2>&1
+run_prog new aseq > $actual 2>&1
 check $expected $actual 'keep first'
 check $expected $actual 'keep first'
-new -folders $folders aseq > $actual 2>&1
+run_prog new -folders $folders aseq > $actual 2>&1
 check $expected $actual
 
 # test fnext/fprev with no desired messages
 cat /dev/null > $expected
 check $expected $actual
 
 # test fnext/fprev with no desired messages
 cat /dev/null > $expected
-fnext aseq > $actual 2>&1
+run_prog fnext aseq > $actual 2>&1
 check $expected $actual 'keep first'
 check $expected $actual 'keep first'
-fprev aseq > $actual 2>&1
+run_prog fprev aseq > $actual 2>&1
 check $expected $actual
 
 # add 1 desired message in each folder
 check $expected $actual
 
 # add 1 desired message in each folder
@@ -63,7 +63,7 @@ foo2       1.  1
 inbox      1.* 1
  total      3.
 EOF
 inbox      1.* 1
  total      3.
 EOF
-new aseq > $actual 2>&1
+run_prog new aseq > $actual 2>&1
 check $expected $actual
 
 # test with .folders
 check $expected $actual
 
 # test with .folders
@@ -72,7 +72,7 @@ inbox      1.* 1
 foo2       1.  1
  total      2.
 EOF
 foo2       1.  1
  total      2.
 EOF
-new -folders $folders aseq > $actual 2>&1
+run_prog new -folders $folders aseq > $actual 2>&1
 check $expected $actual
 
 # add 2 desired messages to another sequence in each folder
 check $expected $actual
 
 # add 2 desired messages to another sequence in each folder
@@ -87,12 +87,12 @@ foo2       3.  1 3-4
 inbox      3.* 1 3-4
  total      9.
 EOF
 inbox      3.* 1 3-4
  total      9.
 EOF
-new aseq bseq > $actual 2>&1
+run_prog new aseq bseq > $actual 2>&1
 check $expected $actual 'keep first'
 
 # set aseq bseq as unseen
 echo 'Unseen-Sequence: aseq bseq' >> $MH
 check $expected $actual 'keep first'
 
 # set aseq bseq as unseen
 echo 'Unseen-Sequence: aseq bseq' >> $MH
-new > $actual 2>&1
+run_prog new > $actual 2>&1
 check $expected $actual
 
 # test unseen
 check $expected $actual
 
 # test unseen
@@ -113,49 +113,49 @@ cat > $expected <<EOF
    3  09/29 Test3              Testing message 3<<This is message number 3 >>
    4  09/29 Test4              Testing message 4<<This is message number 4 >>
 EOF
    3  09/29 Test3              Testing message 3<<This is message number 3 >>
    4  09/29 Test4              Testing message 4<<This is message number 4 >>
 EOF
-unseen > $actual 2>&1
+run_prog unseen > $actual 2>&1
 check $expected $actual
 
 # test fnext with the current folder not in the list
 echo 'Current-Folder: foo1' > $MH_TEST_DIR/Mail/context
 echo 'inbox  1 3-4' > $expected
 check $expected $actual
 
 # test fnext with the current folder not in the list
 echo 'Current-Folder: foo1' > $MH_TEST_DIR/Mail/context
 echo 'inbox  1 3-4' > $expected
-fnext -folders $folders > $actual 2>&1
+run_prog fnext -folders $folders > $actual 2>&1
 check $expected $actual
 
 # test fprev with the current folder not in the list
 echo 'Current-Folder: foo1' > $MH_TEST_DIR/Mail/context
 echo 'inbox  1 3-4' > $expected
 check $expected $actual
 
 # test fprev with the current folder not in the list
 echo 'Current-Folder: foo1' > $MH_TEST_DIR/Mail/context
 echo 'inbox  1 3-4' > $expected
-fprev -folders $folders > $actual 2>&1
+run_prog fprev -folders $folders > $actual 2>&1
 check $expected $actual
 
 # test fnext with current folder in the middle of the list
 echo 'Current-Folder: foo2' > $MH_TEST_DIR/Mail/context
 echo 'inbox  1 3-4' > $expected
 check $expected $actual
 
 # test fnext with current folder in the middle of the list
 echo 'Current-Folder: foo2' > $MH_TEST_DIR/Mail/context
 echo 'inbox  1 3-4' > $expected
-fnext > $actual 2>&1
+run_prog fnext > $actual 2>&1
 check $expected $actual
 
 # test fprev with current folder in the middle of the list
 echo 'Current-Folder: foo2' > $MH_TEST_DIR/Mail/context
 echo 'foo1  1 3-4' > $expected
 check $expected $actual
 
 # test fprev with current folder in the middle of the list
 echo 'Current-Folder: foo2' > $MH_TEST_DIR/Mail/context
 echo 'foo1  1 3-4' > $expected
-fprev > $actual 2>&1
+run_prog fprev > $actual 2>&1
 check $expected $actual
 
 # test fprev with current folder at the beginning of the list
 echo 'Current-Folder: foo1' > $MH_TEST_DIR/Mail/context
 echo 'inbox  1 3-4' > $expected
 check $expected $actual
 
 # test fprev with current folder at the beginning of the list
 echo 'Current-Folder: foo1' > $MH_TEST_DIR/Mail/context
 echo 'inbox  1 3-4' > $expected
-fprev > $actual 2>&1
+run_prog fprev > $actual 2>&1
 check $expected $actual
 
 # test fnext with current folder at the end of the list
 echo 'Current-Folder: inbox' > $MH_TEST_DIR/Mail/context
 echo 'foo1  1 3-4' > $expected
 check $expected $actual
 
 # test fnext with current folder at the end of the list
 echo 'Current-Folder: inbox' > $MH_TEST_DIR/Mail/context
 echo 'foo1  1 3-4' > $expected
-fnext > $actual 2>&1
+run_prog fnext > $actual 2>&1
 check $expected $actual
 
 # test fnext with no current folder
 rm $MH_TEST_DIR/Mail/context
 echo 'foo1  1 3-4' > $expected
 check $expected $actual
 
 # test fnext with no current folder
 rm $MH_TEST_DIR/Mail/context
 echo 'foo1  1 3-4' > $expected
-fnext > $actual 2>&1
+run_prog fnext > $actual 2>&1
 check $expected $actual
 
 # test fnext with only one folder in the list
 check $expected $actual
 
 # test fnext with only one folder in the list
@@ -163,7 +163,7 @@ cat > $folders <<EOF
 inbox
 EOF
 echo 'inbox  1 3-4' > $expected
 inbox
 EOF
 echo 'inbox  1 3-4' > $expected
-fnext -folders $folders > $actual 2>&1
+run_prog fnext -folders $folders > $actual 2>&1
 check $expected $actual
 
 exit $failed
 check $expected $actual
 
 exit $failed
index e1434dcef5ef359cb767cb66490040bb6164540e..85da34408aa1913b9422e9aec576dc252eecddf3 100755 (executable)
@@ -77,8 +77,9 @@ run_test 'pick -not -lbrace -subject NoMatch -and -subject message.3 -rbrace' \
 11'
 
 # Test MHPDEBUG.
 11'
 
 # Test MHPDEBUG.
-MHPDEBUG=1 pick -not -lbrace -subject NoMatch -and -subject message.3 -rbrace \
- >/dev/null 2>"$actual"
+# Don't use run_prog here because it loses the environment setting.
+MHPDEBUG=1 pick -not -lbrace -subject NoMatch -and -subject message.3 \
+  -rbrace >/dev/null 2>"$actual"
 cat >"$expected" <<EOF
 NOT
 | AND
 cat >"$expected" <<EOF
 NOT
 | AND
@@ -92,7 +93,8 @@ set +e
 # Produce 0 if no messages match and standard output is not a tty.
 # Note that there is an error message on stderr, but it's redirected
 # to /dev/null here.
 # Produce 0 if no messages match and standard output is not a tty.
 # Note that there is an error message on stderr, but it's redirected
 # to /dev/null here.
-echo `pick -subject message.3 -and -from Test4 >"$actual" 2>/dev/null` \
+echo \
+  `run_prog pick -subject message.3 -and -from Test4 >"$actual" 2>/dev/null` \
   >/dev/null
 cat >"$expected" <<EOF
 0
   >/dev/null
 cat >"$expected" <<EOF
 0
@@ -104,11 +106,11 @@ if test -t 1  &&  (printf '' >/dev/tty) 2>/dev/null; then
   # output is a tty.  To test that even when run with stdout
   # detached, write directly to /dev/tty.  Can't capture the
   # output so hopefully the user will notice it.
   # output is a tty.  To test that even when run with stdout
   # detached, write directly to /dev/tty.  Can't capture the
   # output so hopefully the user will notice it.
-  pick -subject message.3 -and -from Test4 >/dev/tty 2>/dev/null
+  run_prog pick -subject message.3 -and -from Test4 >/dev/tty 2>/dev/null
 fi
 
 # Also, check that the exit status is 1.
 fi
 
 # Also, check that the exit status is 1.
-pick -subject message.3 -and -from Test4 >/dev/null 2>&1
+run_prog pick -subject message.3 -and -from Test4 >/dev/null 2>&1
 run_test "echo $?" '1'
 
 set -e
 run_test "echo $?" '1'
 
 set -e
@@ -135,7 +137,7 @@ run_test 'pick -to some -nolist' '11 hits'
 run_test 'pick -to user@example.com -nolist' '11 hits'
 
 # Test -after.
 run_test 'pick -to user@example.com -nolist' '11 hits'
 
 # Test -after.
-pick -after '28 Sep 2008 00:00:00' >"$actual" 2>&1
+run_prog pick -after '28 Sep 2008 00:00:00' >"$actual" 2>&1
 cat >"$expected" <<EOF
 11
 EOF
 cat >"$expected" <<EOF
 11
 EOF
@@ -143,7 +145,7 @@ check "$expected" "$actual"
 
 # Invert exit status so execution doesn't terminate due to -e.
 set +e
 
 # Invert exit status so execution doesn't terminate due to -e.
 set +e
-pick -after '29 Sep 2008 00:00:00' >"$actual" 2>/dev/null
+run_prog pick -after '29 Sep 2008 00:00:00' >"$actual" 2>/dev/null
 set -e
 cat >"$expected" <<EOF
 0
 set -e
 cat >"$expected" <<EOF
 0
@@ -151,21 +153,21 @@ EOF
 check "$expected" "$actual"
 
 # Test -before.  While -after doesn't include the specified date, -before does.
 check "$expected" "$actual"
 
 # Test -before.  While -after doesn't include the specified date, -before does.
-pick -before '29 Sep 2008 00:00:01' last:3 >"$actual" 2>&1
+run_prog pick -before '29 Sep 2008 00:00:01' last:3 >"$actual" 2>&1
 cat >"$expected" <<EOF
 9
 10
 11
 EOF
 check "$expected" "$actual"
 cat >"$expected" <<EOF
 9
 10
 11
 EOF
 check "$expected" "$actual"
-pick -before '28 Sep 2008 00:00:00:' last:3 >"$actual" 2>&1
+run_prog pick -before '28 Sep 2008 00:00:00:' last:3 >"$actual" 2>&1
 cat >"$expected" <<EOF
 9
 10
 EOF
 check "$expected" "$actual"
 set +e
 cat >"$expected" <<EOF
 9
 10
 EOF
 check "$expected" "$actual"
 set +e
-pick -before '28 Sep 2006 00:00:00' last:3 >"$actual" 2>/dev/null
+run_prog pick -before '28 Sep 2006 00:00:00' last:3 >"$actual" 2>/dev/null
 set -e
 cat >"$expected" <<EOF
 0
 set -e
 cat >"$expected" <<EOF
 0
@@ -174,13 +176,15 @@ check "$expected" "$actual"
 
 # Test -datefield.
 set +e
 
 # Test -datefield.
 set +e
-pick -datefield date -after '29 Sep 2008 00:00:00' >"$actual" 2>/dev/null
+run_prog pick -datefield date -after '29 Sep 2008 00:00:00' \
+  >"$actual" 2>/dev/null
 set -e
 cat >"$expected" <<EOF
 0
 EOF
 check "$expected" "$actual"
 set -e
 cat >"$expected" <<EOF
 0
 EOF
 check "$expected" "$actual"
-pick -datefield delivery-date -after '29 Sep 2008 00:00:00' >"$actual" 2>&1
+run_prog pick -datefield delivery-date -after '29 Sep 2008 00:00:00' \
+  >"$actual" 2>&1
 cat >"$expected" <<EOF
 11
 EOF
 cat >"$expected" <<EOF
 11
 EOF
@@ -239,7 +243,7 @@ EOF
 
 echo 12 >"$expected"
 
 
 echo 12 >"$expected"
 
-pick -subject 'multi-line header field' 12 >"$actual" 2>&1
+run_prog pick -subject 'multi-line header field' 12 >"$actual" 2>&1
 check "$expected" "$actual"
 
 # Test MIME-encoded header.
 check "$expected" "$actual"
 
 # Test MIME-encoded header.
@@ -257,7 +261,7 @@ EOF
 echo 13 >"$expected"
 
 set +e
 echo 13 >"$expected"
 
 set +e
-LC_CTYPE=en_US.UTF-8 pick -subject foobar 13 >"$actual" 2>&1
+LC_CTYPE=en_US.UTF-8 run_prog pick -subject foobar 13 >"$actual" 2>&1
 set -e
 check "$expected" "$actual"
 
 set -e
 check "$expected" "$actual"
 
index 0cafe7f3f333867da1bae0d7f9f38877a3b248c0..9c1dac3d22c5f26be1225dd9391f7231ad6f8a69 100755 (executable)
@@ -28,6 +28,6 @@ EOF
 # Nothing should to go stdout.
 cat /dev/null > $expected_out
 
 # Nothing should to go stdout.
 cat /dev/null > $expected_out
 
-pick -a > $actual_out 2> $actual_err
+run_prog pick -a > $actual_out 2> $actual_err
 check "$expected_err" "$actual_err"
 check "$expected_out" "$actual_out"
 check "$expected_err" "$actual_err"
 check "$expected_out" "$actual_out"
index fbed212963ec7e7f5ba48279e71e7f1198fcf3ac..544af6682e8b987cf0c74c680ff8ea21dc4eaee4 100755 (executable)
@@ -55,7 +55,7 @@ MHMTSCONF="$mts_fakesendmail"
 test_messageid ()
 {
   msgid_style="$1"
 test_messageid ()
 {
   msgid_style="$1"
-  send -draft -mts sendmail/pipe -msgid -messageid "$msgid_style"
+  run_prog send -draft -mts sendmail/pipe -msgid -messageid "$msgid_style"
   shift
 
   # fakesendmail drops the message and any cc's into this mbox.
   shift
 
   # fakesendmail drops the message and any cc's into this mbox.
index 8266323189568c9ba3b40e882d1102417608bb67..afcd1319a20392553c94788658a1b24723effd34 100755 (executable)
@@ -54,7 +54,7 @@ MHMTSCONF="$mts_fakesendmail"
 # remaining arguments: expected output(s)
 test_sendmail ()
 {
 # remaining arguments: expected output(s)
 test_sendmail ()
 {
-  send -draft -mts "$1"
+  run_prog send -draft -mts "$1"
   shift
 
   # fakesendmail drops the message and any cc's into this mbox.
   shift
 
   # fakesendmail drops the message and any cc's into this mbox.
index ee06f2884ffdb0c9bf67c587479f1ae83e056c8f..62c1863b334b6c57796f351c2a663262dcc559ad 100755 (executable)
@@ -35,7 +35,7 @@ MHMTSCONF="$mts_fakesendmail"
 test_alias ()
 {
   if [ "$1" = 'sendmail/smtp' ]; then
 test_alias ()
 {
   if [ "$1" = 'sendmail/smtp' ]; then
-    send -draft -alias "${MH_TEST_DIR}/Mail/aliases" -mts sendmail/smtp
+    run_prog send -draft -alias "${MH_TEST_DIR}/Mail/aliases" -mts sendmail/smtp
 
     # fakesendmail drops the message and any cc's into this mbox.
     mbox="${MH_TEST_DIR}"/Mail/fakesendmail.mbox
 
     # fakesendmail drops the message and any cc's into this mbox.
     mbox="${MH_TEST_DIR}"/Mail/fakesendmail.mbox
@@ -56,8 +56,8 @@ test_alias ()
 
   elif [ "$1" = 'sendmail/pipe' ]; then
     set +e
 
   elif [ "$1" = 'sendmail/pipe' ]; then
     set +e
-    send -draft -alias "${MH_TEST_DIR}/Mail/aliases" -mts sendmail/pipe \
-      >"${testname}.actual" 2>&1
+    run_prog send -draft -alias "${MH_TEST_DIR}/Mail/aliases" \
+      -mts sendmail/pipe >"${testname}.actual" 2>&1
     if [ $? -eq 0 ]; then
       printf '%s: sendmail/pipe should have failed but didn'"'"'t\n' "$0"
     else
     if [ $? -eq 0 ]; then
       printf '%s: sendmail/pipe should have failed but didn'"'"'t\n' "$0"
     else
index 3b1a3d0b9b99840281dd997a42774f61a2f56374..6767d747bfec44e47dade98d29157bcd3d6d0052 100755 (executable)
@@ -28,7 +28,7 @@ echo "clientname: nosuchhost.example.com" >> ${MHMTSCONF}
 test_post ()
 { pid=`"${MH_OBJ_DIR}/test/fakesmtp" "$1" $localport`
 
 test_post ()
 { pid=`"${MH_OBJ_DIR}/test/fakesmtp" "$1" $localport`
 
-    send -draft -server 127.0.0.1 -port $localport $3 || exit 1
+    run_prog send -draft -server 127.0.0.1 -port $localport $3 || exit 1
 
     #
     # It's hard to calculate the exact Date: header post is going to
 
     #
     # It's hard to calculate the exact Date: header post is going to
index af5573ea9d287c8631348c3fd30d8b1f1bee9962..c5f08c004811c65d3a0ff8da61f8f91b7da79bbb 100755 (executable)
@@ -47,11 +47,11 @@ test_sendfiles ()
 
   if [ "$argstyle" = 'new' ]; then
     (cd "$MH_TEST_DIR"  &&
 
   if [ "$argstyle" = 'new' ]; then
     (cd "$MH_TEST_DIR"  &&
-     sendfiles "$@" -to recipient@example.com -subject "sendfiles test" \
-       "$testfile" >/dev/null 2>&1)
+     run_prog sendfiles "$@" -to recipient@example.com \
+       -subject "sendfiles test" "$testfile" >/dev/null 2>&1)
   elif [ "$argstyle" = 'old' ]; then
     (cd "$MH_TEST_DIR"  &&
   elif [ "$argstyle" = 'old' ]; then
     (cd "$MH_TEST_DIR"  &&
-     sendfiles "$@" recipient@example.com "sendfiles test" \
+     run_prog sendfiles "$@" recipient@example.com "sendfiles test" \
        "$testfile" >/dev/null 2>&1)
   fi
 
        "$testfile" >/dev/null 2>&1)
   fi
 
@@ -89,7 +89,7 @@ Usage: sendfiles [switches] -to recipient -subject subject file1 [file2 ...]
   Can use PERSON environment variable instead of -from switch.
 EOF
 
   Can use PERSON environment variable instead of -from switch.
 EOF
 
-sendfiles -help >"$actual" 2>&1
+run_prog sendfiles -help >"$actual" 2>&1
 check "$expected" "$actual"
 
 # check -version
 check "$expected" "$actual"
 
 # check -version
index 69eb9dd1ab05c7d613dbb5eea1f31eb96445490c..9a25bc068ddd4e0ab24209f13aeeb35f0bb18124 100755 (executable)
@@ -35,7 +35,7 @@ Usage: prompter [switches] file
   -help
 EOF
 
   -help
 EOF
 
-prompter -help >$actual 2>&1
+run_prog prompter -help >$actual 2>&1
 check $expected $actual
 
 # check -version
 check $expected $actual
 
 # check -version
@@ -70,7 +70,7 @@ Resent-fcc:
 EOF
 
 printf 'recipient@example.com\ncc@example.com\n+outbox\nmessage body\n' | \
 EOF
 
 printf 'recipient@example.com\ncc@example.com\n+outbox\nmessage body\n' | \
-  prompter $MH_TEST_DIR/prompter-file > /dev/null
+  run_prog prompter $MH_TEST_DIR/prompter-file >/dev/null
 
 check "$expected" "$MH_TEST_DIR/prompter-file" 'keep first'
 
 
 check "$expected" "$MH_TEST_DIR/prompter-file" 'keep first'
 
@@ -83,7 +83,7 @@ Resent-fcc:
 EOF
 
 printf 'recipient@example.com\ncc@example.com\n+outbox\nmessage body\n.\n' | \
 EOF
 
 printf 'recipient@example.com\ncc@example.com\n+outbox\nmessage body\n.\n' | \
-  prompter -doteof $MH_TEST_DIR/prompter-file > /dev/null
+  run_prog prompter -doteof $MH_TEST_DIR/prompter-file >/dev/null
 
 check "$expected" "$MH_TEST_DIR/prompter-file" 'keep first'
 
 
 check "$expected" "$MH_TEST_DIR/prompter-file" 'keep first'
 
@@ -96,7 +96,7 @@ Resent-fcc:
 EOF
 
 printf 'recipient@example.com\ncc@example.com\n+outbox\nmessage body\n' | \
 EOF
 
 printf 'recipient@example.com\ncc@example.com\n+outbox\nmessage body\n' | \
-  prompter -doteof -nodoteof $MH_TEST_DIR/prompter-file > /dev/null
+  run_prog prompter -doteof -nodoteof $MH_TEST_DIR/prompter-file >/dev/null
 
 check "$expected" "$MH_TEST_DIR/prompter-file" 'keep first'
 
 
 check "$expected" "$MH_TEST_DIR/prompter-file" 'keep first'
 
@@ -110,10 +110,10 @@ Resent-fcc:
 message body
 EOF
 
 message body
 EOF
 
-printf 'appendage\n' >> "$expected"
+printf 'appendage\n' >>"$expected"
 
 printf 'recipient@example.com\ncc@example.com\n+outbox\nappendage\n' | \
 
 printf 'recipient@example.com\ncc@example.com\n+outbox\nappendage\n' | \
-  prompter -noprepend $MH_TEST_DIR/prompter-file > /dev/null
+  run_prog prompter -noprepend $MH_TEST_DIR/prompter-file >/dev/null
 
 check "$expected" "$MH_TEST_DIR/prompter-file"
 
 
 check "$expected" "$MH_TEST_DIR/prompter-file"
 
@@ -138,7 +138,7 @@ message body
 EOF
 
 printf 'recipient@example.com\ncc@example.com\n+outbox\nprependage\n' | \
 EOF
 
 printf 'recipient@example.com\ncc@example.com\n+outbox\nprependage\n' | \
-  prompter -noprepend -prepend $MH_TEST_DIR/prompter-file > /dev/null
+  run_prog prompter -noprepend -prepend $MH_TEST_DIR/prompter-file >/dev/null
 
 check "$MH_TEST_DIR/prompter-file" "$expected" 'keep first'
 
 
 check "$MH_TEST_DIR/prompter-file" "$expected" 'keep first'
 
@@ -154,7 +154,7 @@ Resent-fcc: +outbox
 --------
 EOF
 
 --------
 EOF
 
-prompter -rapid $MH_TEST_DIR/prompter-file > "$actual" < /dev/null
+run_prog prompter -rapid $MH_TEST_DIR/prompter-file >"$actual" </dev/null
 
 check "$expected" "$actual"
 
 
 check "$expected" "$actual"
 
@@ -172,7 +172,8 @@ message body
 --------
 EOF
 
 --------
 EOF
 
-prompter -rapid -norapid $MH_TEST_DIR/prompter-file > "$actual" < /dev/null
+run_prog prompter -rapid -norapid $MH_TEST_DIR/prompter-file \
+  >"$actual" </dev/null
 
 check "$expected" "$actual"
 
 
 check "$expected" "$actual"
 
@@ -195,7 +196,7 @@ message body
 EOF
 
 printf 'woot woot\n' | \
 EOF
 
 printf 'woot woot\n' | \
-  prompter -erase '\15' -kill '\7f' $MH_TEST_DIR/prompter-file > "$actual"
+  run_prog prompter -erase '\15' -kill '\7f' $MH_TEST_DIR/prompter-file >"$actual"
 
 check "$expected" "$actual"
 
 
 check "$expected" "$actual"
 
@@ -215,7 +216,8 @@ message body
 --------
 EOF
 
 --------
 EOF
 
-prompter -nobody -body $MH_TEST_DIR/prompter-file > "$actual" < /dev/null
+run_prog prompter -nobody -body $MH_TEST_DIR/prompter-file >"$actual" \
+  </dev/null
 
 check "$expected" "$actual"
 
 
 check "$expected" "$actual"
 
@@ -227,7 +229,7 @@ Resent-cc: cc@example.com
 Resent-fcc: +outbox
 EOF
 
 Resent-fcc: +outbox
 EOF
 
-prompter -nobody $MH_TEST_DIR/prompter-file > /dev/null
+run_prog prompter -nobody $MH_TEST_DIR/prompter-file >/dev/null
 
 check "$expected" "$MH_TEST_DIR/prompter-file"
 
 
 check "$expected" "$MH_TEST_DIR/prompter-file"
 
index 5e34615eedd2dd6741eb21e48f651670e210f6db..e69e140ecffd0fd1114cfcd00031d54772e9d0fa 100755 (executable)
@@ -32,7 +32,7 @@ Usage: rcvdist [switches] [switches for postproc] address ...
   -help
 EOF
 
   -help
 EOF
 
-$rcvdist -help >"$actual" 2>&1
+run_prog $rcvdist -help >"$actual" 2>&1
 check "$expected" "$actual"
 
 # check -version
 check "$expected" "$actual"
 
 # check -version
@@ -59,7 +59,7 @@ MHMTSCONF="$mts_fakesendmail"
 # arguments: rcvdist switches
 test_rcvdist ()
 {
 # arguments: rcvdist switches
 test_rcvdist ()
 {
-  $rcvdist "$@"
+  run_prog $rcvdist "$@"
 
   # fakesendmail drops the message and any cc's into this mbox.
   mbox="${MH_TEST_DIR}"/Mail/fakesendmail.mbox
 
   # fakesendmail drops the message and any cc's into this mbox.
   mbox="${MH_TEST_DIR}"/Mail/fakesendmail.mbox
index 51deed7728f203dd47a5e4b17c27cf9ddfdde431..ae2b294cf455f30884aef600f297ec6439137f4e 100755 (executable)
@@ -33,7 +33,7 @@ Usage: rcvpack [switches] file
   -help
 EOF
 
   -help
 EOF
 
-$rcvpack -help >"$actual" 2>&1
+run_prog $rcvpack -help >"$actual" 2>&1
 check "$expected" "$actual"
 
 # check -version
 check "$expected" "$actual"
 
 # check -version
@@ -50,29 +50,30 @@ run_test "$rcvpack -nonexistent" 'rcvpack: -nonexistent unknown'
 run_test "$rcvpack" 'rcvpack: rcvpack [switches] file'
 
 # check mbox creation
 run_test "$rcvpack" 'rcvpack: rcvpack [switches] file'
 
 # check mbox creation
-$rcvpack <${MH_TEST_DIR}/Mail/inbox/1 ${MH_TEST_DIR}/Mail/mbox
+run_prog $rcvpack <${MH_TEST_DIR}/Mail/inbox/1 ${MH_TEST_DIR}/Mail/mbox
 inc -file ${MH_TEST_DIR}/Mail/mbox -silent
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
 
 # check -mbox
 inc -file ${MH_TEST_DIR}/Mail/mbox -silent
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
 
 # check -mbox
-$rcvpack -mmdf -mbox <${MH_TEST_DIR}/Mail/inbox/1 ${MH_TEST_DIR}/Mail/mbox2
+run_prog $rcvpack -mmdf -mbox ${MH_TEST_DIR}/Mail/mbox2 \
+  <${MH_TEST_DIR}/Mail/inbox/1
 # Filter out "From " lines because their timestamps can differ by a second.
 grep -v '^From ' "${MH_TEST_DIR}/Mail/mbox" >"${MH_TEST_DIR}/Mail/mbox-filt"
 grep -v '^From ' "${MH_TEST_DIR}/Mail/mbox2" >"${MH_TEST_DIR}/Mail/mbox2-filt"
 check "${MH_TEST_DIR}/Mail/mbox-filt" "${MH_TEST_DIR}/Mail/mbox2-filt"
 
 # check append to existing mbox file
 # Filter out "From " lines because their timestamps can differ by a second.
 grep -v '^From ' "${MH_TEST_DIR}/Mail/mbox" >"${MH_TEST_DIR}/Mail/mbox-filt"
 grep -v '^From ' "${MH_TEST_DIR}/Mail/mbox2" >"${MH_TEST_DIR}/Mail/mbox2-filt"
 check "${MH_TEST_DIR}/Mail/mbox-filt" "${MH_TEST_DIR}/Mail/mbox2-filt"
 
 # check append to existing mbox file
-$rcvpack <${MH_TEST_DIR}/Mail/inbox/2 ${MH_TEST_DIR}/Mail/mbox
+run_prog $rcvpack <${MH_TEST_DIR}/Mail/inbox/2 ${MH_TEST_DIR}/Mail/mbox
 inc -file ${MH_TEST_DIR}/Mail/mbox -silent
 check "${MH_TEST_DIR}/Mail/inbox/2" "${MH_TEST_DIR}/Mail/inbox/12" 'keep first'
 
 # check -mmdf
 inc -file ${MH_TEST_DIR}/Mail/mbox -silent
 check "${MH_TEST_DIR}/Mail/inbox/2" "${MH_TEST_DIR}/Mail/inbox/12" 'keep first'
 
 # check -mmdf
-$rcvpack -mmdf <${MH_TEST_DIR}/Mail/inbox/3 ${MH_TEST_DIR}/Mail/mmdf
+run_prog $rcvpack -mmdf <${MH_TEST_DIR}/Mail/inbox/3 ${MH_TEST_DIR}/Mail/mmdf
 inc -file ${MH_TEST_DIR}/Mail/mmdf -silent
 check "${MH_TEST_DIR}/Mail/inbox/3" "${MH_TEST_DIR}/Mail/inbox/12" 'keep first'
 
 # check append to existing mmdf file
 inc -file ${MH_TEST_DIR}/Mail/mmdf -silent
 check "${MH_TEST_DIR}/Mail/inbox/3" "${MH_TEST_DIR}/Mail/inbox/12" 'keep first'
 
 # check append to existing mmdf file
-$rcvpack -mmdf <${MH_TEST_DIR}/Mail/inbox/4 ${MH_TEST_DIR}/Mail/mmdf
+run_prog $rcvpack -mmdf <${MH_TEST_DIR}/Mail/inbox/4 ${MH_TEST_DIR}/Mail/mmdf
 inc -file ${MH_TEST_DIR}/Mail/mmdf -silent
 check "${MH_TEST_DIR}/Mail/inbox/4" "${MH_TEST_DIR}/Mail/inbox/13" 'keep first'
 
 inc -file ${MH_TEST_DIR}/Mail/mmdf -silent
 check "${MH_TEST_DIR}/Mail/inbox/4" "${MH_TEST_DIR}/Mail/inbox/13" 'keep first'
 
index 82d270d7dfe9358e7bd8ca68050d1958d7d2386e..6445f69adffb612624e5b02299551623bfbd26e1 100755 (executable)
@@ -38,7 +38,7 @@ Usage: rcvstore [+folder] [switches]
   -help
 EOF
 
   -help
 EOF
 
-$rcvstore -help >$actual 2>&1
+run_prog $rcvstore -help >$actual 2>&1
 check $expected $actual
 
 # check -version
 check $expected $actual
 
 # check -version
@@ -56,23 +56,23 @@ cat >$expected <<EOF
 rcvstore: empty file
 EOF
 
 rcvstore: empty file
 EOF
 
-$rcvstore </dev/null >$actual 2>&1
+run_prog $rcvstore </dev/null >$actual 2>&1
 check $expected $actual
 
 # check with no switches
 cat >$expected <<EOF
 EOF
 check $expected $actual
 
 # check with no switches
 cat >$expected <<EOF
 EOF
-$rcvstore <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
+run_prog $rcvstore <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
 check $expected $actual 'keep first'
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
 
 # check + of existing folder
 check $expected $actual 'keep first'
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
 
 # check + of existing folder
-$rcvstore +inbox <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
+run_prog $rcvstore +inbox <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
 check $expected $actual 'keep first'
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
 
 # check + of new folder
 check $expected $actual 'keep first'
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
 
 # check + of new folder
-$rcvstore +newfolder <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
+run_prog $rcvstore +newfolder <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
 check $expected $actual 'keep first'
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/newfolder/1" \
   'keep first'
 check $expected $actual 'keep first'
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/newfolder/1" \
   'keep first'
@@ -84,14 +84,14 @@ rcvstore: folder ${MH_TEST_DIR}/Mail/newfolder doesn't exist
 EOF
 
 set +e
 EOF
 
 set +e
-$rcvstore +newfolder -nocreate <${MH_TEST_DIR}/Mail/inbox/1 >$actual \
+run_prog $rcvstore +newfolder -nocreate <${MH_TEST_DIR}/Mail/inbox/1 >$actual \
   2>$actual_err
 set -e
 check $expected $actual 'keep first'
 check $expected_err $actual_err
 
 # check -create
   2>$actual_err
 set -e
 check $expected $actual 'keep first'
 check $expected_err $actual_err
 
 # check -create
-$rcvstore +newfolder -nocreate -create <${MH_TEST_DIR}/Mail/inbox/1 \
+run_prog $rcvstore +newfolder -nocreate -create <${MH_TEST_DIR}/Mail/inbox/1 \
   >$actual 2>&1
 check $expected $actual 'keep first'
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/newfolder/1" \
   >$actual 2>&1
 check $expected $actual 'keep first'
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/newfolder/1" \
@@ -100,7 +100,7 @@ rmdir "${MH_TEST_DIR}/Mail/newfolder"
 
 # check addition to unseen sequence
 printf 'Unseen-Sequence: unseen\n' >> $MH
 
 # check addition to unseen sequence
 printf 'Unseen-Sequence: unseen\n' >> $MH
-$rcvstore <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
+run_prog $rcvstore <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
 check $expected $actual 'keep first'
 run_test 'mark -sequence unseen -list' 'unseen: 11'
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
 check $expected $actual 'keep first'
 run_test 'mark -sequence unseen -list' 'unseen: 11'
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
@@ -109,59 +109,62 @@ touch "${MH_TEST_DIR}/Mail/inbox/11"
 rmm 11
 
 # check -nounseen
 rmm 11
 
 # check -nounseen
-$rcvstore -nounseen <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
+run_prog $rcvstore -nounseen <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
 check $expected $actual 'keep first'
 run_test 'mark -sequence unseen -list' 'unseen: '
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
 
 # check -unseen
 check $expected $actual 'keep first'
 run_test 'mark -sequence unseen -list' 'unseen: '
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
 
 # check -unseen
-$rcvstore -nounseen -unseen <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
+run_prog $rcvstore -nounseen -unseen <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
 check $expected $actual 'keep first'
 run_test 'mark -sequence unseen -list' 'unseen: 11'
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
 
 # check -sequence
 check $expected $actual 'keep first'
 run_test 'mark -sequence unseen -list' 'unseen: 11'
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
 
 # check -sequence
-$rcvstore -sequence newseq <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
+run_prog $rcvstore -sequence newseq <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
 check $expected $actual 'keep first'
 run_test 'mark -sequence newseq -list' 'newseq: 11'
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
 
 # check that default is -nozero
 mark -sequence newseq all
 check $expected $actual 'keep first'
 run_test 'mark -sequence newseq -list' 'newseq: 11'
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
 
 # check that default is -nozero
 mark -sequence newseq all
-$rcvstore -sequence newseq <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
+run_prog $rcvstore -sequence newseq <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
 check $expected $actual 'keep first'
 run_test 'mark -sequence newseq -list' 'newseq: 1-11'
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
 
 # check -zero
 mark -sequence newseq all
 check $expected $actual 'keep first'
 run_test 'mark -sequence newseq -list' 'newseq: 1-11'
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
 
 # check -zero
 mark -sequence newseq all
-$rcvstore -sequence newseq -zero <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
+run_prog $rcvstore -sequence newseq -zero \
+  <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
 check $expected $actual 'keep first'
 run_test 'mark -sequence newseq -list' 'newseq: 11'
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
 
 # check -nozero
 mark -sequence newseq all
 check $expected $actual 'keep first'
 run_test 'mark -sequence newseq -list' 'newseq: 11'
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
 
 # check -nozero
 mark -sequence newseq all
-$rcvstore -seq newseq -zero -nozero <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
+run_prog $rcvstore -seq newseq -zero -nozero \
+  <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
 check $expected $actual 'keep first'
 run_test 'mark -sequence newseq -list' 'newseq: 1-11'
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
 
 # check that default is -public
 check $expected $actual 'keep first'
 run_test 'mark -sequence newseq -list' 'newseq: 1-11'
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
 
 # check that default is -public
-$rcvstore -sequence pubseq <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
+run_prog $rcvstore -sequence pubseq <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
 check $expected $actual 'keep first'
 run_test 'mark -sequence pubseq -list' 'pubseq: 11'
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
 
 # check -nopublic
 check $expected $actual 'keep first'
 run_test 'mark -sequence pubseq -list' 'pubseq: 11'
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
 
 # check -nopublic
-$rcvstore -sequence privseq -nopublic <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
+run_prog $rcvstore -sequence privseq -nopublic \
+  <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
 check $expected $actual 'keep first'
 run_test 'mark -sequence privseq -nopublic -list' 'privseq (private): 11'
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
 
 # check -public
 check $expected $actual 'keep first'
 run_test 'mark -sequence privseq -nopublic -list' 'privseq (private): 11'
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
 
 # check -public
-$rcvstore -sequence pubseq -nopublic -public <${MH_TEST_DIR}/Mail/inbox/1 \
-  >$actual 2>&1
+run_prog $rcvstore -sequence pubseq -nopublic -public \
+  <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
 check $expected $actual 'keep first'
 run_test 'mark -sequence pubseq -public -list' 'pubseq: 11'
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
 check $expected $actual 'keep first'
 run_test 'mark -sequence pubseq -public -list' 'pubseq: 11'
 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
@@ -186,7 +189,7 @@ fi
 
 # check default Msg-Protect
 msgprot=`mhparam msgprot`
 
 # check default Msg-Protect
 msgprot=`mhparam msgprot`
-$rcvstore <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
+run_prog $rcvstore <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
 check $expected $actual 'keep first'
 run_test "find ${MH_TEST_DIR}/Mail/inbox/11 -perm $msgprot" \
   "${MH_TEST_DIR}/Mail/inbox/11"
 check $expected $actual 'keep first'
 run_test "find ${MH_TEST_DIR}/Mail/inbox/11 -perm $msgprot" \
   "${MH_TEST_DIR}/Mail/inbox/11"
@@ -195,7 +198,7 @@ check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
 # check Msg-Protect profile entry
 msgprot=640
 printf 'Msg-Protect: %s\n' "$msgprot" >>$MH
 # check Msg-Protect profile entry
 msgprot=640
 printf 'Msg-Protect: %s\n' "$msgprot" >>$MH
-$rcvstore <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
+run_prog $rcvstore <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1
 check $expected $actual
 run_test "find ${MH_TEST_DIR}/Mail/inbox/11 -perm $msgprot" \
   "${MH_TEST_DIR}/Mail/inbox/11"
 check $expected $actual
 run_test "find ${MH_TEST_DIR}/Mail/inbox/11 -perm $msgprot" \
   "${MH_TEST_DIR}/Mail/inbox/11"
index 1d0fea8cdc0244f87d22c37850a01f983a4dda8c..f0c58d14bc301d46dd6c0be092380d9623bb4e3e 100755 (executable)
@@ -37,7 +37,7 @@ Usage: rcvtty [command ...]
   -help
 EOF
 
   -help
 EOF
 
-$rcvtty -help >"$actual" 2>&1
+run_prog $rcvtty -help >"$actual" 2>&1
 check "$expected" "$actual"
 
 # check -version
 check "$expected" "$actual"
 
 # check -version
@@ -54,7 +54,7 @@ esac
 # any of their ttys.
 cat >"$expected" <<EOF
 EOF
 # any of their ttys.
 cat >"$expected" <<EOF
 EOF
-$rcvtty <${MH_TEST_DIR}/Mail/inbox/1 -biff >"$actual" 2>&1
+run_prog $rcvtty <${MH_TEST_DIR}/Mail/inbox/1 -biff >"$actual" 2>&1
 check "$expected" "$actual"
 
 
 check "$expected" "$actual"
 
 
index da9242d2b8cfcceb5816987ce849b987adf827c1..645f4f1c7872d5cc158e0bdf9a962ef9c87c0f86 100755 (executable)
@@ -21,14 +21,14 @@ actual=$MH_TEST_DIR/$$.actual
 
 cd $MH_TEST_DIR
 
 
 cd $MH_TEST_DIR
 
-folder -create +other -fast >/dev/null
-folder -create +another -fast >/dev/null
+run_prog folder -create +other -fast >/dev/null
+run_prog folder -create +another -fast >/dev/null
 
 # check with no options and no current message
 run_test 'refile' 'refile: no folder specified'
 
 # check with current message
 
 # check with no options and no current message
 run_test 'refile' 'refile: no folder specified'
 
 # check with current message
-folder +inbox 4 >/dev/null
+run_prog folder +inbox 4 >/dev/null
 run_test 'refile +other' ''
 run_test 'folders -noheader' \
 'another  has no messages.
 run_test 'refile +other' ''
 run_test 'folders -noheader' \
 'another  has no messages.
@@ -38,7 +38,7 @@ other    has  1 message   (1- 1).
 TOTAL = 10 messages in 3 folders.'
 
 # check with specified message
 TOTAL = 10 messages in 3 folders.'
 
 # check with specified message
-folder +inbox 5 >/dev/null
+run_prog folder +inbox 5 >/dev/null
 run_test 'refile 5 +other' ''
 run_test 'folders -noheader' \
 'another  has no messages.
 run_test 'refile 5 +other' ''
 run_test 'folders -noheader' \
 'another  has no messages.
@@ -67,7 +67,7 @@ TOTAL = 11 messages in 3 folders.'
 
 # check message number greater than highest
 run_test 'refile 11 +other' "refile: message 11 doesn't exist"
 
 # check message number greater than highest
 run_test 'refile 11 +other' "refile: message 11 doesn't exist"
-folder -f +another >/dev/null
+run_prog folder -f +another >/dev/null
 
 # check -src
 run_test 'refile 9 -src +inbox +other' ''
 
 # check -src
 run_test 'refile 9 -src +inbox +other' ''
index 327f1c924e1f3c093effc23b620c1d8ac7bb28df..ecfafb654399048426c1ba6025555686d62e9d69 100755 (executable)
@@ -40,7 +40,8 @@ Test1 writes:
 > This is message number 1
 EOF
 
 > This is message number 1
 EOF
 
-repl -editor true -format -form $form -group -nocc me -nowhatnowproc 1 || exit 1
+run_prog repl -editor true -format -form $form -group -nocc me \
+  -nowhatnowproc 1 || exit 1
 
 check "$expected" "$actual"
 
 
 check "$expected" "$actual"
 
index ed5f97db2fc3546b91bfc494f5282434370fc7bc..9ead17f2b193dd107d8d688e09e7e5441cb32ed1 100755 (executable)
@@ -52,8 +52,8 @@ Test1 writes:
 > This is a new test message
 EOF
 
 > This is a new test message
 EOF
 
-repl -editor true -cc cc -format -form $form -width 72 -nowhatnowproc 11 \
-                                               || exit 1
+run_prog repl -editor true -cc cc -format -form $form -width 72 \
+  -nowhatnowproc 11 || exit 1
 
 check "$expected" "$actual"
 
 
 check "$expected" "$actual"
 
index 042bf4ef62cab527f7a56e2716e4a020e755995a..63d99dde633db8c3bafb148fb9c1ff52ca8a01ae 100755 (executable)
@@ -55,7 +55,7 @@ Usage: repl: [+folder] [msg] [switches]
   -nofmtproc
 EOF
 
   -nofmtproc
 EOF
 
-repl -help >$actual 2>&1
+run_prog repl -help >$actual 2>&1
 check $expected $actual
 
 # check -version
 check $expected $actual
 
 # check -version
@@ -88,7 +88,7 @@ Comments: In-reply-to Test1 <test1@example.com>
 --------
 EOF
 
 --------
 EOF
 
-repl -cc me -editor true -nowhatnowproc 1
+run_prog repl -cc me -editor true -nowhatnowproc 1
 check $expected $actual
 
 # check -nocc me
 check $expected $actual
 
 # check -nocc me
@@ -105,7 +105,7 @@ Comments: In-reply-to Test1 <test1@example.com>
 --------
 EOF
 
 --------
 EOF
 
-repl -cc me -nocc me -editor true -nowhatnowproc 1
+run_prog repl -cc me -nocc me -editor true -nowhatnowproc 1
 check $expected $actual
 
 # check -cc me with Local- and Alternate-Mailbox addtions, Bug #36635:
 check $expected $actual
 
 # check -cc me with Local- and Alternate-Mailbox addtions, Bug #36635:
@@ -125,7 +125,7 @@ Comments: In-reply-to Test1 <test1@example.com>
 --------
 EOF
 
 --------
 EOF
 
-repl -cc me -editor true -nowhatnowproc 1
+run_prog repl -cc me -editor true -nowhatnowproc 1
 check $expected $actual
 
 
 check $expected $actual
 
 
@@ -144,7 +144,7 @@ Comments: In-reply-to Test1 <test1@example.com>
 --------
 EOF
 
 --------
 EOF
 
-repl -cc me -nocc me -editor true -nowhatnowproc 1
+run_prog repl -cc me -nocc me -editor true -nowhatnowproc 1
 check $expected $actual
 
 
 check $expected $actual
 
 
@@ -175,7 +175,7 @@ Comments: In-reply-to Test11 <test11@example.com>
 --------
 EOF
 
 --------
 EOF
 
-repl -cc to -editor true -nowhatnowproc 11
+run_prog repl -cc to -editor true -nowhatnowproc 11
 check $expected $actual
 
 
 check $expected $actual
 
 
index 20d7637dd9829b1033fb42b66f2ea387f5a4c4d7..cd6ef8e5c1e571104da3ec84201957032ddf96db 100755 (executable)
@@ -37,7 +37,7 @@ Test1 writes:
 > This is message number 1
 EOF
 
 > This is message number 1
 EOF
 
-repl -editor true -format -form $form -nowhatnowproc 1 || exit 1
+run_prog repl -editor true -format -form $form -nowhatnowproc 1 || exit 1
 
 check "$expected" "$actual"
 
 
 check "$expected" "$actual"
 
index 632c54bae83e7590e6195bca9ece876707d9008d..1e600ec4c88b0754f0c09e0859a86c9829b2d447 100755 (executable)
@@ -30,7 +30,7 @@ cat >"$expected" <<EOF
   10  09/29 Test10             Testing message 10<<This is message number 10 >>
 EOF
 
   10  09/29 Test10             Testing message 10<<This is message number 10 >>
 EOF
 
-scan +inbox -width 80 >"$actual" || exit 1
+run_prog scan +inbox -width 80 >"$actual" || exit 1
 check "$expected" "$actual"
 
 # check highlighting
 check "$expected" "$actual"
 
 # check highlighting
@@ -50,7 +50,7 @@ EOF
 printf 'Unseen-Sequence: unseen\n' >> $MH
 mark -sequence cur 5
 mark -sequence unseen 10
 printf 'Unseen-Sequence: unseen\n' >> $MH
 mark -sequence cur 5
 mark -sequence unseen 10
-scan -form scan.highlighted -width 80 >"$actual" || exit 1
+run_prog scan -form scan.highlighted -width 80 >"$actual" || exit 1
 check "$expected" "$actual"
 
 
 check "$expected" "$actual"
 
 
index 255adacedb53315afdd7faf7398fac6deb4ac31b..db1d3ba7bf57d643c5d4f73e18c58e4c534bd0f8 100755 (executable)
@@ -76,7 +76,7 @@ else
     exit 1
 fi
 
     exit 1
 fi
 
-scan -width 80 +inbox 11 > $actual || exit 1
+run_prog scan -width 80 +inbox 11 > $actual || exit 1
 check "$expected" "$actual"
 
 #
 check "$expected" "$actual"
 
 #
@@ -103,6 +103,7 @@ cat >"$expected" <<EOF
 EOF
 
 if test "$ICONV_ENABLED" -eq 1; then
 EOF
 
 if test "$ICONV_ENABLED" -eq 1; then
+    # Don't use run_prog here because it loses those environment settings.
     LC_CTYPE=ISO-8859-1 MM_CHARSET=ISO-8859-1 scan -width 75 last >"$actual"
     check "$expected" "$actual"
 fi
     LC_CTYPE=ISO-8859-1 MM_CHARSET=ISO-8859-1 scan -width 75 last >"$actual"
     check "$expected" "$actual"
 fi
@@ -131,7 +132,7 @@ else
     echo "Unsupported width for U+2019: $width"
 fi
 
     echo "Unsupported width for U+2019: $width"
 fi
 
-LC_CTYPE=en_US.UTF-8 MM_CHARSET=UTF-8 scan -width 75 last >"$actual"
+LC_CTYPE=en_US.UTF-8 MM_CHARSET=UTF-8 run_prog scan -width 75 last >"$actual"
 check "$expected" "$actual"
 
 
 check "$expected" "$actual"
 
 
index fb00e513c51783768937ca9c7866be4caec7ae71..f1d529e8f21bc6e4743f282f7f2fbb250dc5743c 100755 (executable)
@@ -120,9 +120,10 @@ run_test 'pick -nolist cur' 'pick: no cur message'
 # Check large number of sequences.
 for i in 1 2 3 4 5; do
   for j in 0 1 2 3 4 5 6 7 8 9; do
 # Check large number of sequences.
 for i in 1 2 3 4 5; do
   for j in 0 1 2 3 4 5 6 7 8 9; do
-    mark $i -seq seq$i${j}0 -seq seq$i${j}1 -seq seq$i${j}2 -seq seq$i${j}3 \
-            -seq seq$i${j}4 -seq seq$i${j}5 -seq seq$i${j}6 -seq seq$i${j}7 \
-            -seq seq$i${j}8 -seq seq$i${j}9
+    run_prog mark $i -seq seq$i${j}0 -seq seq$i${j}1 -seq seq$i${j}2 \
+                     -seq seq$i${j}3 -seq seq$i${j}4 -seq seq$i${j}5 \
+                     -seq seq$i${j}6 -seq seq$i${j}7 -seq seq$i${j}8 \
+                     -seq seq$i${j}9
     run_test "pick seq$i${j}0 seq$i${j}1 seq$i${j}2 seq$i${j}3 seq$i${j}4 \
                    seq$i${j}5 seq$i${j}6 seq$i${j}7 seq$i${j}8 seq$i${j}9" $i
   done
     run_test "pick seq$i${j}0 seq$i${j}1 seq$i${j}2 seq$i${j}3 seq$i${j}4 \
                    seq$i${j}5 seq$i${j}6 seq$i${j}7 seq$i${j}8 seq$i${j}9" $i
   done
index db6c945b39a4c19fcd83aa5b308ede54977e6810..cadda35360a99455b509b6acd34acd47bc06ecbd 100755 (executable)
@@ -42,7 +42,7 @@ Usage: slocal [switches]
   -help
 EOF
 
   -help
 EOF
 
-$slocal -help >"$actual" 2>&1
+run_prog $slocal -help >"$actual" 2>&1
 check "$expected" "$actual"
 
 # check -version
 check "$expected" "$actual"
 
 # check -version
@@ -78,28 +78,29 @@ cat >"$md"  <<EOF
 EOF
 chmod go-w "$md"
 
 EOF
 chmod go-w "$md"
 
-$slocal -maildelivery "$md" $mbox <"$MH_TEST_DIR"/Mail/inbox/1
+run_prog $slocal -maildelivery "$md" $mbox <"$MH_TEST_DIR"/Mail/inbox/1
 check "$MH_TEST_DIR/Mail/inbox/1" "$actual" 'keep first'
 
 if [ ${failed:-0} -eq 1 ]; then
   printf "\nRerunning failed basic slocal command with -verbose -debug to help
     diagnose test failure . . .\n\n"
 check "$MH_TEST_DIR/Mail/inbox/1" "$actual" 'keep first'
 
 if [ ${failed:-0} -eq 1 ]; then
   printf "\nRerunning failed basic slocal command with -verbose -debug to help
     diagnose test failure . . .\n\n"
-  $slocal -verbose -debug -maildelivery "$md" $mbox <"$MH_TEST_DIR"/Mail/inbox/1
+  run_prog $slocal -verbose -debug -maildelivery "$md" $mbox \
+    <"$MH_TEST_DIR"/Mail/inbox/1
   exit 1
 fi
 
 # check -debug
   exit 1
 fi
 
 # check -debug
-$slocal -debug -maildelivery "$md" $mbox <"$MH_TEST_DIR"/Mail/inbox/1 \
+run_prog $slocal -debug -maildelivery "$md" $mbox <"$MH_TEST_DIR"/Mail/inbox/1 \
   >"$actual2" 2>&1
 run_test "grep ^retrieving $actual2" 'retrieving message from stdin'
 
 # check -verbose
   >"$actual2" 2>&1
 run_test "grep ^retrieving $actual2" 'retrieving message from stdin'
 
 # check -verbose
-$slocal -verbose -maildelivery "$md" $mbox <"$MH_TEST_DIR"/Mail/inbox/1 \
-  >"$actual2" 2>&1
+run_prog $slocal -verbose -maildelivery "$md" $mbox \
+  <"$MH_TEST_DIR"/Mail/inbox/1 >"$actual2" 2>&1
 run_test "grep ^delivering $actual2" "delivering to pipe \"$tee\", success."
 
 # check -noverbose
 run_test "grep ^delivering $actual2" "delivering to pipe \"$tee\", success."
 
 # check -noverbose
-$slocal -verbose -noverbose -maildelivery "$md" $mbox \
+run_prog $slocal -verbose -noverbose -maildelivery "$md" $mbox \
   <"$MH_TEST_DIR"/Mail/inbox/1 >"$actual2" 2>&1
 run_test "grep ^delivering $actual2" ''
 rm -f "$actual2"
   <"$MH_TEST_DIR"/Mail/inbox/1 >"$actual2" 2>&1
 run_test "grep ^delivering $actual2" ''
 rm -f "$actual2"
@@ -109,7 +110,7 @@ cat >"$md"  <<EOF
 From test2@example.com qpipe A "$tee $actual"
 EOF
 
 From test2@example.com qpipe A "$tee $actual"
 EOF
 
-$slocal -maildelivery "$md" $mbox <"$MH_TEST_DIR"/Mail/inbox/2
+run_prog $slocal -maildelivery "$md" $mbox <"$MH_TEST_DIR"/Mail/inbox/2
 check "$MH_TEST_DIR/Mail/inbox/2" "$actual" 'keep first'
 
 # check R and ?
 check "$MH_TEST_DIR/Mail/inbox/2" "$actual" 'keep first'
 
 # check R and ?
@@ -118,7 +119,7 @@ From test3@example.com qpipe R "$tee $actual"
 From test3@example.com qpipe ? "$tee $actual2"
 EOF
 
 From test3@example.com qpipe ? "$tee $actual2"
 EOF
 
-$slocal -maildelivery "$md" $mbox <"$MH_TEST_DIR"/Mail/inbox/3
+run_prog $slocal -maildelivery "$md" $mbox <"$MH_TEST_DIR"/Mail/inbox/3
 check "$MH_TEST_DIR/Mail/inbox/3" "$actual" 'keep first'
 check "$MH_TEST_DIR/Mail/inbox/3" "$actual2" 'keep first'
 
 check "$MH_TEST_DIR/Mail/inbox/3" "$actual" 'keep first'
 check "$MH_TEST_DIR/Mail/inbox/3" "$actual2" 'keep first'
 
@@ -128,7 +129,7 @@ From test4@example.com qpipe R "$tee $actual"
 From test4@example.com qpipe N "$tee $actual2"
 EOF
 
 From test4@example.com qpipe N "$tee $actual2"
 EOF
 
-$slocal -maildelivery "$md" $mbox <"$MH_TEST_DIR"/Mail/inbox/4
+run_prog $slocal -maildelivery "$md" $mbox <"$MH_TEST_DIR"/Mail/inbox/4
 check "$MH_TEST_DIR/Mail/inbox/4" "$actual" 'keep first'
 check "$MH_TEST_DIR/Mail/inbox/4" "$actual2" 'keep first'
 
 check "$MH_TEST_DIR/Mail/inbox/4" "$actual" 'keep first'
 check "$MH_TEST_DIR/Mail/inbox/4" "$actual2" 'keep first'
 
@@ -138,7 +139,7 @@ From test5@example.com qpipe R "$tee $actual"
 default 1 qpipe A "$tee $actual2"
 EOF
 
 default 1 qpipe A "$tee $actual2"
 EOF
 
-$slocal -maildelivery "$md" $mbox <"$MH_TEST_DIR"/Mail/inbox/5
+run_prog $slocal -maildelivery "$md" $mbox <"$MH_TEST_DIR"/Mail/inbox/5
 check "$MH_TEST_DIR/Mail/inbox/5" "$actual" 'keep first'
 check "$MH_TEST_DIR/Mail/inbox/5" "$actual2" 'keep first'
 
 check "$MH_TEST_DIR/Mail/inbox/5" "$actual" 'keep first'
 check "$MH_TEST_DIR/Mail/inbox/5" "$actual2" 'keep first'
 
@@ -151,7 +152,8 @@ cat >"$md"  <<EOF
 addr "$me" qpipe A "$tee $actual"
 EOF
 
 addr "$me" qpipe A "$tee $actual"
 EOF
 
-$slocal -addr "$me" -maildelivery "$md" $mbox <"$MH_TEST_DIR"/Mail/inbox/6
+run_prog $slocal -addr "$me" -maildelivery "$md" $mbox \
+  <"$MH_TEST_DIR"/Mail/inbox/6
 check "$MH_TEST_DIR/Mail/inbox/6" "$actual" 'keep first'
 
 # check -info
 check "$MH_TEST_DIR/Mail/inbox/6" "$actual" 'keep first'
 
 # check -info
@@ -159,7 +161,8 @@ cat >"$md"  <<EOF
 * - qpipe A "\$(info) $actual"
 EOF
 
 * - qpipe A "\$(info) $actual"
 EOF
 
-$slocal -info $tee -maildelivery "$md" $mbox <"$MH_TEST_DIR"/Mail/inbox/7
+run_prog $slocal -info $tee -maildelivery "$md" $mbox \
+  <"$MH_TEST_DIR"/Mail/inbox/7
 check "$MH_TEST_DIR/Mail/inbox/7" "$actual" 'keep first'
 
 # check -sender, which is compared with "source"
 check "$MH_TEST_DIR/Mail/inbox/7" "$actual" 'keep first'
 
 # check -sender, which is compared with "source"
@@ -167,7 +170,8 @@ cat >"$md"  <<EOF
 source "$me" qpipe A "$tee $actual"
 EOF
 
 source "$me" qpipe A "$tee $actual"
 EOF
 
-$slocal -sender "$me" -maildelivery "$md" $mbox <"$MH_TEST_DIR"/Mail/inbox/8
+run_prog $slocal -sender "$me" -maildelivery "$md" $mbox \
+  <"$MH_TEST_DIR"/Mail/inbox/8
 check "$MH_TEST_DIR/Mail/inbox/8" "$actual" 'keep first'
 
 # check -user
 check "$MH_TEST_DIR/Mail/inbox/8" "$actual" 'keep first'
 
 # check -user
@@ -175,20 +179,23 @@ cat >"$md"  <<EOF
 * - qpipe A "$tee $actual"
 EOF
 
 * - qpipe A "$tee $actual"
 EOF
 
-$slocal -user "$me" -maildelivery "$md" $mbox <"$MH_TEST_DIR"/Mail/inbox/9
+run_prog $slocal -user "$me" -maildelivery "$md" $mbox \
+  <"$MH_TEST_DIR"/Mail/inbox/9
 check "$MH_TEST_DIR/Mail/inbox/9" "$actual" 'keep first'
 
 # check -mailbox
 cat >"$md"  <<EOF
 EOF
 
 check "$MH_TEST_DIR/Mail/inbox/9" "$actual" 'keep first'
 
 # check -mailbox
 cat >"$md"  <<EOF
 EOF
 
-$slocal -mailbox "$actual" -maildelivery "$md" <"$MH_TEST_DIR"/Mail/inbox/10
+run_prog $slocal -mailbox "$actual" -maildelivery "$md" \
+  <"$MH_TEST_DIR"/Mail/inbox/10
 inc -file "$actual" -silent -truncate
 rm -f "$actual"
 check "$MH_TEST_DIR/Mail/inbox/10" "$MH_TEST_DIR/Mail/inbox/11" 'keep first'
 
 # check -file
 inc -file "$actual" -silent -truncate
 rm -f "$actual"
 check "$MH_TEST_DIR/Mail/inbox/10" "$MH_TEST_DIR/Mail/inbox/11" 'keep first'
 
 # check -file
-$slocal -mailbox "$actual" -maildelivery "$md" -file "$MH_TEST_DIR"/Mail/inbox/1
+run_prog $slocal -mailbox "$actual" -maildelivery "$md" \
+  -file "$MH_TEST_DIR"/Mail/inbox/1
 inc -file "$actual" -silent -truncate
 rm -f "$actual"
 check "$MH_TEST_DIR/Mail/inbox/1" "$MH_TEST_DIR/Mail/inbox/11" 'keep first'
 inc -file "$actual" -silent -truncate
 rm -f "$actual"
 check "$MH_TEST_DIR/Mail/inbox/1" "$MH_TEST_DIR/Mail/inbox/11" 'keep first'
@@ -198,17 +205,19 @@ cat >"$md"  <<EOF
 * - qpipe A "$tee $actual"
 EOF
 
 * - qpipe A "$tee $actual"
 EOF
 
-$slocal -suppressdup -maildelivery "$md" $mbox <"$MH_TEST_DIR"/Mail/inbox/2
+run_prog $slocal -suppressdup -maildelivery "$md" $mbox \
+  <"$MH_TEST_DIR"/Mail/inbox/2
 check "$MH_TEST_DIR/Mail/inbox/2" "$actual" 'keep first'
 
 check "$MH_TEST_DIR/Mail/inbox/2" "$actual" 'keep first'
 
-$slocal -suppressdup -maildelivery "$md" $mbox <"$MH_TEST_DIR"/Mail/inbox/2
+run_prog $slocal -suppressdup -maildelivery "$md" $mbox \
+  <"$MH_TEST_DIR"/Mail/inbox/2
 if [ -f "$actual" ]; then
   echo $0: check -suppressdup failed
   failed=`expr ${failed:-0} + 1`
 fi
 
 # check -nosuppressdup
 if [ -f "$actual" ]; then
   echo $0: check -suppressdup failed
   failed=`expr ${failed:-0} + 1`
 fi
 
 # check -nosuppressdup
-$slocal -suppress -nosuppressdup -maildelivery "$md" $mbox \
+run_prog $slocal -suppress -nosuppressdup -maildelivery "$md" $mbox \
   <"$MH_TEST_DIR"/Mail/inbox/2
 check "$MH_TEST_DIR/Mail/inbox/2" "$actual" 'keep first'
 
   <"$MH_TEST_DIR"/Mail/inbox/2
 check "$MH_TEST_DIR/Mail/inbox/2" "$actual" 'keep first'
 
diff --git a/test/valgrind.supp b/test/valgrind.supp
new file mode 100644 (file)
index 0000000..db68600
--- /dev/null
@@ -0,0 +1,18 @@
+{
+   Invalid free in valgrind/vgpreload_memcheck-amd64-linux.so
+   Memcheck:Free
+   fun:free
+   fun:__libc_freeres
+   fun:_vgnU_freeres
+   fun:__run_exit_handlers
+   fun:exit
+}
+
+{
+   Syscall param sendmsg(msg.msg_name) points to uninitialised byte(s)
+   Memcheck:Param
+   sendmsg(msg.msg_name)
+   fun:__sendmsg_nocancel
+   fun:readline
+   fun:getans_via_readline
+}
index 9f308aa322aeac809ebde91f3f3e386ca3f1dff0..27dcb9cdd6f62b7a9aeb400aac58bcc9c719e558 100755 (executable)
@@ -38,7 +38,7 @@ touch $expected $expectederr $actual $actualerr
 #
 
 set +e
 #
 
 set +e
-whatnowtest=`echo cd | TERM=dumb whatnow -prompt ''`
+whatnowtest=`echo cd | TERM=dumb run_prog whatnow -prompt ''`
 set -e
 
 case ${whatnowtest} in
 set -e
 
 case ${whatnowtest} in
@@ -63,12 +63,13 @@ esac
 # whatnow's exit status is always 1 so that is not a failure
 set +e
 echo "attach $testname_quoted" | \
 # whatnow's exit status is always 1 so that is not a failure
 set +e
 echo "attach $testname_quoted" | \
-  TERM=dumb whatnow -attach foo -noedit -prompt '' 2>> $actualerr >> $actual
-echo "alist" | TERM=dumb whatnow -attach foo -noedit -prompt '' \
+  TERM=dumb run_prog whatnow -attach foo -noedit -prompt '' 2>> $actualerr \
+    >> $actual
+echo "alist" | TERM=dumb run_prog whatnow -attach foo -noedit -prompt '' \
                                2>> $actualerr >> $actual
 echo "detach $testname_quoted" | \
   TERM=dumb whatnow -attach foo -noedit -prompt '' 2>> $actualerr >> $actual
                                2>> $actualerr >> $actual
 echo "detach $testname_quoted" | \
   TERM=dumb whatnow -attach foo -noedit -prompt '' 2>> $actualerr >> $actual
-echo "alist" | TERM=dumb whatnow -attach foo -noedit -prompt '' \
+echo "alist" | TERM=dumb run_prog whatnow -attach foo -noedit -prompt '' \
                                2>> $actualerr >> $actual
 set -e
 
                                2>> $actualerr >> $actual
 set -e
 
index 48389cbf02174145c91c797e2dc7b5b83169ba27..bfa6f4ee4d560e88713ff181e74e1389d69601fe 100755 (executable)
@@ -32,7 +32,7 @@ actual=$MH_TEST_DIR/$$.actual
 #
 
 set +e
 #
 
 set +e
-whatnowtest=`echo cd | TERM=dumb whatnow -prompt ''`
+whatnowtest=`echo cd | TERM=dumb run_prog whatnow -prompt ''`
 set -e
 
 case ${whatnowtest} in
 set -e
 
 case ${whatnowtest} in
@@ -58,7 +58,8 @@ EOF
 # ||true to ignore whatnow's exit status
 # watch the quoting -- shell and printf and then the shell run inside whatnow
 printf 'cd %s/foo\\'"'"'s\\ bar\npwd\n' "$MH_TEST_DIR" | \
 # ||true to ignore whatnow's exit status
 # watch the quoting -- shell and printf and then the shell run inside whatnow
 printf 'cd %s/foo\\'"'"'s\\ bar\npwd\n' "$MH_TEST_DIR" | \
-  TERM=dumb whatnow -noedit -prompt '' 2> "$actualerr" > "$actual" || true
+  TERM=dumb run_prog whatnow -noedit -prompt '' 2> "$actualerr" > "$actual" || \
+  true
 
 check "$expectederr" "$actualerr"
 check "$expected" "$actual"
 
 check "$expectederr" "$actualerr"
 check "$expected" "$actual"
index b70f593661a55d76af4b4460654c2d186ee02977..e23111cc852dbfc4097c016b2986548ac248ad2b 100755 (executable)
@@ -33,7 +33,7 @@ actual=$MH_TEST_DIR/$$.actual
 #
 
 set +e
 #
 
 set +e
-whatnowtest=`echo cd | TERM=dumb whatnow -prompt ''`
+whatnowtest=`echo cd | TERM=dumb run_prog whatnow -prompt ''`
 set -e
 
 case ${whatnowtest} in
 set -e
 
 case ${whatnowtest} in
@@ -58,7 +58,7 @@ cat > $expectederr <<EOF
 EOF
 
 # NB use of sort as the order of output of ls is not guaranteed
 EOF
 
 # NB use of sort as the order of output of ls is not guaranteed
-echo 'ls' | TERM=dumb whatnow -noedit -prompt '' 2> "$actualerr" | \
+echo 'ls' | TERM=dumb run_prog whatnow -noedit -prompt '' 2> "$actualerr" | \
        sort > "$actual"
 
 check "$expectederr" "$actualerr" 'keep first'
        sort > "$actual"
 
 check "$expectederr" "$actualerr" 'keep first'
@@ -68,7 +68,7 @@ check "$expected" "$actual" 'keep first'
 # /bin/sh sets SHELL, which bash does.
 unset SHELL
 
 # /bin/sh sets SHELL, which bash does.
 unset SHELL
 
-echo 'ls' | TERM=dumb whatnow -noedit -prompt '' 2> "$actualerr" | \
+echo 'ls' | TERM=dumb run_prog whatnow -noedit -prompt '' 2> "$actualerr" | \
        sort > "$actual"
 
 check "$expectederr" "$actualerr"
        sort > "$actual"
 
 check "$expectederr" "$actualerr"
index b53bb0862ea4882b7d36acb5b019b06734d97776..e7bd78f43542ab5a28c0db9e7cd228a62fc613b5 100755 (executable)
@@ -48,7 +48,7 @@ Usage: whom [switches] [file]
   -help
 EOF
 
   -help
 EOF
 
-whom -help | head -10 >$actual 2>&1
+run_prog whom -help | head -10 >$actual 2>&1
 check $expected $actual
 
 # check -version
 check $expected $actual
 
 # check -version