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)
commit02a2eeb427d6b424029f6e5e5ddad4c6ec987741
treeabdc66ca743a1f21c70238e4c118a51d08c253f1
parentaf3eba97fde00d6bc922df87732b3d28f717f120
test: make script exit (1) if it "fails" to source (.) a file

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