]> git.notmuchmail.org Git - notmuch/commitdiff
test: make script exit (1) if it "fails" to source (.) a file
authorTomi Ollila <tomi.ollila@iki.fi>
Thu, 6 Aug 2015 09:13:36 +0000 (12:13 +0300)
committerDavid Bremner <david@tethera.net>
Fri, 7 Aug 2015 19:56:39 +0000 (21:56 +0200)
The files (test) scripts source (with builtin command `.`) provides
information which the scripts depend, and without the `source` to
succeed allowing script to continue may lead to dangerous situations
(e.g. rm -rf "${undefined_variable}"/*).

At the end of all source (.) lines construct ' || exit 1' was added;
In our case the script script will exit if it cannot find (or read) the
file to be sourced. Additionally script would also exits if the last
command of the sourced file exited nonzero.

71 files changed:
devel/gen-testdb.sh
performance-test/M00-new.sh
performance-test/M01-dump-restore.sh
performance-test/T00-new.sh
performance-test/T01-dump-restore.sh
performance-test/T02-tag.sh
performance-test/perf-test-lib.sh
test/README
test/T000-basic.sh
test/T010-help-test.sh
test/T020-compact.sh
test/T030-config.sh
test/T040-setup.sh
test/T050-new.sh
test/T060-count.sh
test/T070-insert.sh
test/T080-search.sh
test/T090-search-output.sh
test/T095-address.sh
test/T100-search-by-folder.sh
test/T110-search-position-overlap-bug.sh
test/T120-search-insufficient-from-quoting.sh
test/T130-search-limiting.sh
test/T140-excludes.sh
test/T150-tagging.sh
test/T160-json.sh
test/T170-sexp.sh
test/T180-text.sh
test/T190-multipart.sh
test/T200-thread-naming.sh
test/T205-author-naming.sh
test/T210-raw.sh
test/T220-reply.sh
test/T230-reply-to-sender.sh
test/T240-dump-restore.sh
test/T250-uuencode.sh
test/T260-thread-order.sh
test/T270-author-order.sh
test/T280-from-guessing.sh
test/T290-long-id.sh
test/T300-encoding.sh
test/T310-emacs.sh
test/T320-emacs-large-search-buffer.sh
test/T330-emacs-subject-to-filename.sh
test/T340-maildir-sync.sh
test/T350-crypto.sh
test/T360-symbol-hiding.sh
test/T370-search-folder-coherence.sh
test/T380-atomicity.sh
test/T390-python.sh
test/T395-ruby.sh
test/T400-hooks.sh
test/T410-argument-parsing.sh
test/T420-emacs-test-functions.sh
test/T430-emacs-address-cleaning.sh
test/T440-emacs-hello.sh
test/T450-emacs-show.sh
test/T455-emacs-charsets.sh
test/T460-emacs-tree.sh
test/T470-missing-headers.sh
test/T480-hex-escaping.sh
test/T490-parse-time-string.sh
test/T500-search-date.sh
test/T510-thread-replies.sh
test/T520-show.sh
test/T530-upgrade.sh
test/T550-db-features.sh
test/T560-lib-error.sh
test/test-lib-common.sh
test/test-lib.sh
test/test-verbose

index 621b31e67fc22a402795e2a6c3c9b3c72054fb0f..61ae48a316ad6d52755eb578a3db32230638ddf2 100755 (executable)
@@ -79,7 +79,7 @@ while getopts v:c:s: opt; do
 done
 shift `expr $OPTIND - 1`
 
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 SHORT_CORPUS=$(basename ${CORPUS:-database})
 DBNAME=${SHORT_CORPUS}${SUFFIX}
index 99c3f52091d659fb9ef710bd1afa856d5fae2ecc..a040a97e043a65e3691361a53556dba6f0f17da5 100755 (executable)
@@ -2,7 +2,7 @@
 
 test_description='notmuch new'
 
-. ./perf-test-lib.sh
+. ./perf-test-lib.sh || exit 1
 
 # ensure initial 'notmuch new' is run by memory_start
 uncache_database
index be5894a65d6049bc9ab9f12a326164bbee280e98..8fea98242d2cb91785ba08fdb5d717ce138532c2 100755 (executable)
@@ -2,7 +2,7 @@
 
 test_description='dump and restore'
 
-. ./perf-test-lib.sh
+. ./perf-test-lib.sh || exit 1
 
 memory_start
 
index 553bb8b66a1f7dc32af48a8528da1fdab8049284..b9f211581f5a20986605dbe0fb54c727e7ddd93d 100755 (executable)
@@ -2,7 +2,7 @@
 
 test_description='notmuch new'
 
-. ./perf-test-lib.sh
+. ./perf-test-lib.sh || exit 1
 
 uncache_database
 
index b2ff94001a3c15b91bfbb5a1e398df8940d72246..9cfd5cd624accdb1e77b6c3a17bc2a79cebbfedc 100755 (executable)
@@ -2,7 +2,7 @@
 
 test_description='dump and restore'
 
-. ./perf-test-lib.sh
+. ./perf-test-lib.sh || exit 1
 
 time_start
 
index 78ceccccbe2813e28001f24bb00d6df17e951ec2..dacb50b8bbf822eb808ae20202b1a0fb2615aa98 100755 (executable)
@@ -2,7 +2,7 @@
 
 test_description='tagging'
 
-. ./perf-test-lib.sh
+. ./perf-test-lib.sh || exit 1
 
 time_start
 
index 88601fc79f884bf418ca53ed320fbde4fdca5831..00d2f1c6050bb7330bba19e4a17a7bbe097cae42 100644 (file)
@@ -1,4 +1,4 @@
-. ./version.sh
+. ./version.sh || exit 1
 
 corpus_size=large
 
@@ -25,7 +25,7 @@ do
                echo "error: unknown performance test option '$1'" >&2; exit 1 ;;
        esac
 done
-. ../test/test-lib-common.sh
+. ../test/test-lib-common.sh || exit 1
 
 set -e
 
index daf416002ae16274757e06649647563cccd79caf..ce403cef298dd8aaeac60ab94b49a029d7839ed4 100644 (file)
@@ -138,7 +138,7 @@ Source 'test-lib.sh'
 After assigning test_description, the test script should source
 test-lib.sh like this:
 
-       . ./test-lib.sh
+       . ./test-lib.sh || exit 1
 
 This test harness library does the following things:
 
index ef642457ffafb85fb32940401bc6c3c15e68a43d..d6811bd1075639d71986b283880d6bb40312a3b1 100755 (executable)
@@ -14,7 +14,7 @@ then
        exit 1
 fi
 
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 ################################################################
 # Test harness
index d7266ffca73d945c75fbab0aab198d543cb81768..c173237631125ebd68894508763f1f61fab94d74 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description="online help"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 test_expect_success 'notmuch --help' 'notmuch --help'
 test_expect_success 'notmuch help' 'notmuch help'
index 507f769857ddad7ead5912d286008f35c9af979c..8b4dbbc481891e9cec748fa35cf9d5c6a1e0f029 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='"notmuch compact"'
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 add_message '[subject]=One'
 add_message '[subject]=Two'
index 7d14a85f9b4696ccfc88ea584b3f3240341e58e9..f404908a4a1c71f3f65e92c375d988604ffa469c 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description='"notmuch config"'
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 test_begin_subtest "Get string value"
 test_expect_equal "$(notmuch config get user.name)" "Notmuch Test Suite"
index 0e9f279a6e714c6359261bb6d44d38d6442e68c8..cf0c00bc5c1fcd3900754db00cee34cf8be7c428 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description='"notmuch setup"'
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 test_begin_subtest "Notmuch new without a config suggests notmuch setup"
 output=$(notmuch --config=new-notmuch-config new 2>&1)
index ff1c35497945fc14519940d0a75f442b9622f935..625739232369bb9783e7aa41cf25417dba6604d0 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='"notmuch new" in several variations'
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 test_begin_subtest "No new messages"
 output=$(NOTMUCH_NEW --debug)
index da86c8cc70cf4a9f32669fd1b3472353f528d295..5ef3879f765b04cbc9d4085ed3639235eb40f38b 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='"notmuch count" for messages and threads'
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 add_email_corpus
 
index 7e71c3b12afc1164faa9c5196f8d2296af56693b..e7ec6a6cc579d7d2b812e7e19dfb5851b3e25ae8 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='"notmuch insert"'
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 test_require_external_prereq gdb
 
index 05027fb0fee0bfbc7b1548421220e860bef1144d..5e8b20ce1657869d6a9d6c1d0039f3764f48d575 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='"notmuch search" in several variations'
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 add_email_corpus
 
index fe2ec9af8c2a0bd062c35bbbad9077a8190d23cd..a28eaf20a5d0f112eaf64d432f1a249a4e861b59 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='various settings for "notmuch search --output="'
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 add_email_corpus
 
index ed0cac7807ffd8d1a7ffa06e0132d3832631ef5b..8eecb2a6a7babd041ffd16c75f980c6f408b51bf 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='"notmuch address" in several variants'
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 add_email_corpus
 
index 583bdf5eb0869a1031fab79649ee20ee356fe645..2844ec61f47fc6f93cde459ac1e4e34c4b7af6f2 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='"notmuch search" by folder: and path: (with variations)'
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 add_message '[dir]=bad' '[subject]="To the bone"'
 add_message '[dir]=.' '[subject]="Top level"'
index 5da6ad6f2ef7ee018e7b605d7442137e68a8f172..2a4238f95fc93ca48830b6d13f113bf6fe7b6268 100755 (executable)
@@ -18,7 +18,7 @@
 # id:3wd4o8wa7fx.fsf@testarossa.amd.com
 
 test_description='that notmuch does not overlap term positions'
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 add_message '[to]="a@b.c, x@y.z"'
 
index e83ea3d190848831d63ae1aef246ed4a7f2c78e3..4862d82644df6979b2e84f98d8006fdadf18c957 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='messages with unquoted . in name'
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 add_message \
   '[from]="Some.Name for Someone <bugs@quoting.com>"' \
index 303762cf7bbab4f843e9a6c85a8555d928b98d05..c8986f4e405795b58cda66553c80e5e9588bcf4a 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='"notmuch search" --offset and --limit parameters'
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 add_email_corpus
 
index 8bbbc2dd033700119bc6768264940eab821b0d06..f91d4d7f0cac11bd7282d9b7a8156c1ac6808294 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='"notmuch search, count and show" with excludes in several variations'
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 # Generates a thread consisting of a top level message and 'length'
 # replies. The subject of the top message 'subject: top message"
index 4a2673d442b17379f8d18f4950f325a5247c7ea9..821d39334e5c9684551c7dc4f03afa7502618b81 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='"notmuch tag"'
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 add_message '[subject]=One'
 add_message '[subject]=Two'
index c1cf649d6dcad15735767911f414aa58361a4060..b346f37ee4717d43e8229079ec5d0482d84d08fe 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="--format=json output"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 test_begin_subtest "Show message: json"
 add_message "[subject]=\"json-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[bcc]=\"test_suite+bcc@notmuchmail.org\"" "[reply-to]=\"test_suite+replyto@notmuchmail.org\"" "[body]=\"json-show-message\""
index 667e3195d836906c2d27498ade17a1f6fa7b0611..800ebc6310e7f6cd7e9b5dac50303461e673008e 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="--format=sexp output"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 test_begin_subtest "Show message: sexp"
 add_message "[subject]=\"sexp-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[bcc]=\"test_suite+bcc@notmuchmail.org\"" "[reply-to]=\"test_suite+replyto@notmuchmail.org\"" "[body]=\"sexp-show-message\""
index b5ccefc9fccd82e7539a46f9379b8db6750e90df..3a265dbd5a73a24ef76354258ede1e689d8d8d26 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="--format=text output"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 test_begin_subtest "Show message: text"
 add_message "[subject]=\"text-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"text-show-message\""
index ad8d29eafcc69802f6226fa60be5860da056d887..7c4c9f71913fc695a29a668294d5ece21cf6f0d5 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="output of multipart message"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 cat <<EOF > embedded_message
 From: Carl Worth <cworth@cworth.org>
index dcfc1b3651d90ba9d71804afe3eb6d3157b5f4fe..132c1d77370fcfa62ae4709b4eca33a66b8937cc 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="naming of threads with changing subject"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 test_begin_subtest "Initial thread name (oldest-first search)"
 add_message '[subject]="thread-naming: Initial thread subject"' \
index cb678ae83856bacab1c447350952332574a250cb..69d8dc50ff8652f7f40a0d2a591f8f622e77a01d 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="naming of authors with unusual addresses"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 test_begin_subtest "Add author with empty quoted real name"
 add_message '[subject]="author-naming: Initial thread subject"' \
index daf5735cd6da3fd8b3ea870e517eee0739d31ca6..dfea2d19caa93fece9fdbd3dc0ba0fbefd94c828 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description='notmuch show --format=raw'
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 add_message
 add_message
index b0d854a1fc000a3a3b85089eb7c4ea5d6ab538cf..30b78f679d97d82aa42d4817d93c654b5177cf7e 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="\"notmuch reply\" in several variations"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 test_begin_subtest "Basic reply"
 add_message '[from]="Sender <sender@example.com>"' \
index 30e5e385e0b32ae2cad2d278192226214424328d..608334dc023ecd4bb4d82636bbd60dd8d596b80f 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="\"notmuch reply --reply-to=sender\" in several variations"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 test_begin_subtest "Basic reply-to-sender"
 add_message '[from]="Sender <sender@example.com>"' \
index efe463ea03dd104ad06995a877e91e39b455a78f..e6976ff8f2788634d202ed63e0960b0fa0cf6227 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="\"notmuch dump\" and \"notmuch restore\""
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 add_email_corpus
 
index b3e1ac191bba9c8f6d7e60d85b6dc0b5cc3aa8c0..6f45d3959bf2d6f020d9ab8731331deb106dd0b7 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="handling of uuencoded data"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 add_message [subject]=uuencodetest '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' \
 '[body]="This message is used to ensure that notmuch correctly handles a
index 5239bd443512988f9d11f04fa4cba1894db918c1..f720c99817a1561ef8df2c1300644d8a2ee600db 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="threading when messages received out of order"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 # Generate all single-root four message thread structures.  We'll use
 # this for multiple tests below.
index 6ffeffc719476630c21055dc978d7d934df371c8..9124ece6f911a8f9862dfc1d008a45680fab90d0 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="author reordering;"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 test_begin_subtest "Adding parent message"
 generate_message [body]=findme [id]=new-parent-id [subject]=author-reorder-threadtest '[from]="User <user@example.com>"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"'
index 6dfaa40a9478ccdc6bf415ff0fb4fe66d89c88d7..7c562fb9e3537c139f058bd2510b72b02ae988c1 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="From line heuristics (with multiple configured addresses)"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 test_begin_subtest "Magic from guessing (nothing to go on)"
 add_message '[from]="Sender <sender@example.com>"' \
index 85e620fadd404f8c3ffaf4e4316f4f469e0fb943..1fb7c037ee52833c23ea7205d15c4222e572d605 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="messages with ridiculously-long message IDs"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 test_begin_subtest "Referencing long ID before adding"
 generate_message '[subject]="Reference of ridiculously-long message ID"' \
index b6c86bf02f11616dbf50fc8db2689882244086df..8d201c7e8aa42d94c316c3e21a51658c58843de0 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="encoding issues"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 test_begin_subtest "Message with text of unknown charset"
 add_message '[content-type]="text/plain; charset=unknown-8bit"' \
index d72799b4e1fff881e3d258ff81ae7277b16ee94f..61bc369af494208aa919073f244d835a3912ca45 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description="emacs interface"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 EXPECTED=$TEST_DIRECTORY/emacs.expected-output
 
index 8b1251fec1a683c3ff426630de565b826b82fdc9..3fd6958a0441d6a73bc6004b8b242e2537dbd96f 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="Emacs with large search results buffer"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 x=xxxxxxxxxx # 10
 x=$x$x$x$x$x$x$x$x$x$x # 100
index 230c324d2ea4d60aa35bfbd4af30eb73a6c716d1..517fa8398261ad7c3aea91d641685c8bdba9baf8 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description="emacs: mail subject to filename"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 # emacs server can't be started in a child process with $(test_emacs ...)
 test_emacs '(ignore)' > /dev/null
index 3186e70f56e4c03a3eb45dc85d1fd955f8e59a89..efeaa3f60d6e28fa4489a05dad2837ff844dd4fa 100755 (executable)
@@ -2,7 +2,7 @@
 
 test_description="maildir synchronization"
 
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 # Create the expected maildir structure
 mkdir $MAIL_DIR/cur
index 477b397e419e644dbbf48d92b0a7d13b09e373e5..3656cce951ca08263ae6cdfe8c0acf8ceb38f515 100755 (executable)
@@ -5,7 +5,7 @@
 # - verification of signatures from expired/revoked keys
 
 test_description='PGP/MIME signature verification and decryption'
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 add_gnupg_home ()
 {
index 98e4d4dc3e4289a55e1889d970961f09902162e9..4ec0ea65710baba535cc7910fd3e55895f7edce6 100755 (executable)
@@ -9,7 +9,7 @@
 
 test_description='exception symbol hiding'
 
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 test_begin_subtest 'running test' run_test
 mkdir -p ${PWD}/fakedb/.notmuch
index 5e72a6ccfd3a372bad4127c494e7dfe51cd6945d..da4ec2b8c61a15403b14433b0774ca6aaaf7f2b7 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='folder tags removed and added through file renames remain consistent'
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 test_begin_subtest "No new messages"
 output=$(NOTMUCH_NEW)
index ee1e2f43d838960a9f8d8173c666bf2ae95834b1..845dfde75fd6e8bae20283da3285d3046b498761 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='atomicity'
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 # This script tests the effects of killing and restarting "notmuch
 # new" at arbitrary points.  If notmuch new is properly atomic, the
index c3f24f79453208e6119dc3ea01ad20de1fe83b8b..4726bc366ecebda8fc48e694ad802403ea4c6807 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="python bindings"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 test_require_external_prereq ${NOTMUCH_PYTHON}
 
index 8b8e6d24db534b0c45bb88f11e2bb3856c5a78da..d5cade8fbecd7d5ddd4a5c71f1f65470861703b7 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="ruby bindings"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 if [ "${NOTMUCH_HAVE_RUBY_DEV}" = "0" ]; then
     test_subtest_missing_external_prereq_["ruby development files"]=t
index 1adab2f078e51cbe79b9509431e902d5b15a0e69..ed1191319fecbf49f681b0f46ee4a197a45ccdee 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='hooks'
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 HOOK_DIR=${MAIL_DIR}/.notmuch/hooks
 
index 2e5d7ae3ab4da7f809d8ce4f6a7a1e7716515d66..f8ff8ff9139dd90edd15eafda6b9a76cb908f56a 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="argument parsing"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 test_begin_subtest "sanity check"
 $TEST_DIRECTORY/arg-test  pos1  --keyword=one --string=foo pos2 --int=7 --flag=one --flag=three > OUTPUT
index ca4a7988567452af1f2d3296ba462d275516fb3f..955c5f7ff295beacdf3dc52b61e5a2ef6b2561c0 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description="emacs test function sanity"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 test_begin_subtest "emacs test function sanity"
 test_emacs_expect_t 't'
index 04723467e80814b26f574b8af71284d102250273..664b79d293fb0ead36326ab4c8a7e04af1da0c7f 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description="emacs address cleaning"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 test_begin_subtest "notmuch-test-address-clean part 1"
 test_emacs_expect_t '(notmuch-test-address-cleaning-1)'
index f7296166a7bdd84b8762b7028a27e3bd88ace808..a8ed22824e0c3efce61a86b42a886b59f09ad1ca 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description="emacs notmuch-hello view"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 EXPECTED=$TEST_DIRECTORY/emacs.expected-output
 
index bfcd5efedaf9f409d37aa75c36eaddb668a2cc64..0342a8745b3d136e942809768a1a5ee6b0368419 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description="emacs notmuch-show view"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 EXPECTED=$TEST_DIRECTORY/emacs-show.expected-output
 
index 3078f9c956a0e1a3423b631ef54a9c1a6ad1980e..7624fa4d10a645b8b8c5d636e76370b4a7904030 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description="emacs notmuch-show charset handling"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 
 UTF8_YEN=$'\xef\xbf\xa5'
index 8e9f37cbf9c6926f8de1b6e665d545ce90dae725..b6181b51c2ff741562d3cbe2f73097862c97bbc9 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 test_description="emacs tree view interface"
-. test-lib.sh
+. ./test-lib.sh || exit 1
 
 EXPECTED=$TEST_DIRECTORY/tree.expected-output
 
index cb38301c255a1d0b8dd661636499930862fd5b7f..e256c10ac47a8f370cd42e95eb0bcafbd20b4845 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description='messages with missing headers'
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 # Notmuch requires at least one of from, subject, or to or it will
 # ignore the file.  Generate two messages so that together they cover
index ad50e1bcc0716a5ad587f0deb50b7e1912d8d893..10527b185fce927c8dab732d7b6ce7d816017812 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="hex encoding and decoding"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 test_begin_subtest "round trip"
 find $TEST_DIRECTORY/corpus -type f -print | sort | xargs cat > EXPECTED
index 6aa9d433bfd40da5562aca16cb0ff79943d502d3..ab90fcc5a76d444c831843d681c2499afc936c2e 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="date/time parser module"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 # Sanity/smoke tests for the date/time parser independent of notmuch
 
index 70bcf344b4f76db35d9c1ccc13177018eb6b0287..b28496b78e2e352b0f7de65fda77ded38a4c51f1 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="date:since..until queries"
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 add_email_corpus
 
index 1392fbedd0527b58b861602314b0073515108732..5ab066ac7baab83c3822172993f34fb48161ecf4 100755 (executable)
@@ -9,7 +9,7 @@ test_description='test of proper handling of in-reply-to and references headers'
 # database is constructed properly, even in the presence of
 # non-RFC-compliant headers'
 
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 test_begin_subtest "Use References when In-Reply-To is broken"
 add_message '[id]="foo@one.com"' \
index 0657c9937f02db91d48164c42383a6af83176331..fb232a32510f77eced30311d02da2fc4a757d73e 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 test_description='"notmuch show"'
 
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 add_email_corpus
 
index 6b42a690fa9002573ef9639167d757987223281b..7faf03d335099d92c6a4d4942441904e019ad4b0 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 test_description="database upgrade"
 
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 dbtarball=database-v1.tar.xz
 
index 5569768c1ec682651afddbab37d5fd8f7aa8850a..f94a660d750838b63d6ab263190bbdfef126831d 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 test_description="database version and feature compatibility"
 
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 test_begin_subtest "future database versions abort open"
 ${TEST_DIRECTORY}/make-db-version ${MAIL_DIR} 9999 ""
index b1e77aa0ee3878506d5136050376ed2d2c6f4a75..1ef4ff23a37f1e30a69c878d8d81b67e01339e97 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 test_description="error reporting for library"
 
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 backup_database () {
     rm -rf notmuch-dir-backup
index f99ed11162ade498eaef756b9a65774a6a29afec..b1fc33d4044d45a2cc248508604094174b0efaf2 100644 (file)
@@ -40,7 +40,7 @@ TEST_DIRECTORY=$(pwd)
 notmuch_path=`find_notmuch_path "$TEST_DIRECTORY"`
 
 # configure output
-. $notmuch_path/sh.config
+. $notmuch_path/sh.config || exit 1
 
 if test -n "$valgrind"
 then
index eeb5487bd6a31c29acedc597932b924d4638ffed..0bf7163e9f34863c9671689cdca98dcca0cfd85b 100644 (file)
@@ -96,7 +96,8 @@ _x32="$_x04$_x04$_x04$_x04$_x04$_x04$_x04$_x04"
 # test_description='Description of this test...
 # This test checks if command xyzzy does the right thing...
 # '
-# . ./test-lib.sh
+# . ./test-lib.sh || exit 1
+
 [ "x$ORIGINAL_TERM" != "xdumb" ] && (
                TERM=$ORIGINAL_TERM &&
                export TERM &&
@@ -1223,7 +1224,7 @@ test_init_ () {
 }
 
 
-. ./test-lib-common.sh
+. ./test-lib-common.sh || exit 1
 
 emacs_generate_script
 
index 4100c05149f1718896b5ec916111d684979358ce..1723ce665caa73287c4ae5dced5099786626c15b 100755 (executable)
@@ -2,7 +2,7 @@
 
 test_description='the verbosity options of the test framework itself.'
 
-. ./test-lib.sh
+. ./test-lib.sh || exit 1
 
 test_expect_success 'print something in test_expect_success and pass' '
   echo "hello stdout" &&