mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-24 20:08:10 +01:00
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.
This commit is contained in:
parent
af3eba97fd
commit
02a2eeb427
71 changed files with 74 additions and 73 deletions
|
@ -79,7 +79,7 @@ while getopts v:c:s: opt; do
|
||||||
done
|
done
|
||||||
shift `expr $OPTIND - 1`
|
shift `expr $OPTIND - 1`
|
||||||
|
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
SHORT_CORPUS=$(basename ${CORPUS:-database})
|
SHORT_CORPUS=$(basename ${CORPUS:-database})
|
||||||
DBNAME=${SHORT_CORPUS}${SUFFIX}
|
DBNAME=${SHORT_CORPUS}${SUFFIX}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
test_description='notmuch new'
|
test_description='notmuch new'
|
||||||
|
|
||||||
. ./perf-test-lib.sh
|
. ./perf-test-lib.sh || exit 1
|
||||||
|
|
||||||
# ensure initial 'notmuch new' is run by memory_start
|
# ensure initial 'notmuch new' is run by memory_start
|
||||||
uncache_database
|
uncache_database
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
test_description='dump and restore'
|
test_description='dump and restore'
|
||||||
|
|
||||||
. ./perf-test-lib.sh
|
. ./perf-test-lib.sh || exit 1
|
||||||
|
|
||||||
memory_start
|
memory_start
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
test_description='notmuch new'
|
test_description='notmuch new'
|
||||||
|
|
||||||
. ./perf-test-lib.sh
|
. ./perf-test-lib.sh || exit 1
|
||||||
|
|
||||||
uncache_database
|
uncache_database
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
test_description='dump and restore'
|
test_description='dump and restore'
|
||||||
|
|
||||||
. ./perf-test-lib.sh
|
. ./perf-test-lib.sh || exit 1
|
||||||
|
|
||||||
time_start
|
time_start
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
test_description='tagging'
|
test_description='tagging'
|
||||||
|
|
||||||
. ./perf-test-lib.sh
|
. ./perf-test-lib.sh || exit 1
|
||||||
|
|
||||||
time_start
|
time_start
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
. ./version.sh
|
. ./version.sh || exit 1
|
||||||
|
|
||||||
corpus_size=large
|
corpus_size=large
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ do
|
||||||
echo "error: unknown performance test option '$1'" >&2; exit 1 ;;
|
echo "error: unknown performance test option '$1'" >&2; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
. ../test/test-lib-common.sh
|
. ../test/test-lib-common.sh || exit 1
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|
|
@ -138,7 +138,7 @@ Source 'test-lib.sh'
|
||||||
After assigning test_description, the test script should source
|
After assigning test_description, the test script should source
|
||||||
test-lib.sh like this:
|
test-lib.sh like this:
|
||||||
|
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
This test harness library does the following things:
|
This test harness library does the following things:
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
# Test harness
|
# Test harness
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
test_description="online help"
|
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'
|
||||||
test_expect_success 'notmuch help' 'notmuch help'
|
test_expect_success 'notmuch help' 'notmuch help'
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description='"notmuch compact"'
|
test_description='"notmuch compact"'
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
add_message '[subject]=One'
|
add_message '[subject]=One'
|
||||||
add_message '[subject]=Two'
|
add_message '[subject]=Two'
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
test_description='"notmuch config"'
|
test_description='"notmuch config"'
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
test_begin_subtest "Get string value"
|
test_begin_subtest "Get string value"
|
||||||
test_expect_equal "$(notmuch config get user.name)" "Notmuch Test Suite"
|
test_expect_equal "$(notmuch config get user.name)" "Notmuch Test Suite"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
test_description='"notmuch setup"'
|
test_description='"notmuch setup"'
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
test_begin_subtest "Notmuch new without a config suggests notmuch setup"
|
test_begin_subtest "Notmuch new without a config suggests notmuch setup"
|
||||||
output=$(notmuch --config=new-notmuch-config new 2>&1)
|
output=$(notmuch --config=new-notmuch-config new 2>&1)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description='"notmuch new" in several variations'
|
test_description='"notmuch new" in several variations'
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
test_begin_subtest "No new messages"
|
test_begin_subtest "No new messages"
|
||||||
output=$(NOTMUCH_NEW --debug)
|
output=$(NOTMUCH_NEW --debug)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description='"notmuch count" for messages and threads'
|
test_description='"notmuch count" for messages and threads'
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
add_email_corpus
|
add_email_corpus
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description='"notmuch insert"'
|
test_description='"notmuch insert"'
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
test_require_external_prereq gdb
|
test_require_external_prereq gdb
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description='"notmuch search" in several variations'
|
test_description='"notmuch search" in several variations'
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
add_email_corpus
|
add_email_corpus
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description='various settings for "notmuch search --output="'
|
test_description='various settings for "notmuch search --output="'
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
add_email_corpus
|
add_email_corpus
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description='"notmuch address" in several variants'
|
test_description='"notmuch address" in several variants'
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
add_email_corpus
|
add_email_corpus
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description='"notmuch search" by folder: and path: (with variations)'
|
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]=bad' '[subject]="To the bone"'
|
||||||
add_message '[dir]=.' '[subject]="Top level"'
|
add_message '[dir]=.' '[subject]="Top level"'
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
# id:3wd4o8wa7fx.fsf@testarossa.amd.com
|
# id:3wd4o8wa7fx.fsf@testarossa.amd.com
|
||||||
|
|
||||||
test_description='that notmuch does not overlap term positions'
|
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"'
|
add_message '[to]="a@b.c, x@y.z"'
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description='messages with unquoted . in name'
|
test_description='messages with unquoted . in name'
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
add_message \
|
add_message \
|
||||||
'[from]="Some.Name for Someone <bugs@quoting.com>"' \
|
'[from]="Some.Name for Someone <bugs@quoting.com>"' \
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description='"notmuch search" --offset and --limit parameters'
|
test_description='"notmuch search" --offset and --limit parameters'
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
add_email_corpus
|
add_email_corpus
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description='"notmuch search, count and show" with excludes in several variations'
|
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'
|
# Generates a thread consisting of a top level message and 'length'
|
||||||
# replies. The subject of the top message 'subject: top message"
|
# replies. The subject of the top message 'subject: top message"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description='"notmuch tag"'
|
test_description='"notmuch tag"'
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
add_message '[subject]=One'
|
add_message '[subject]=One'
|
||||||
add_message '[subject]=Two'
|
add_message '[subject]=Two'
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description="--format=json output"
|
test_description="--format=json output"
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
test_begin_subtest "Show message: json"
|
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\""
|
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\""
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description="--format=sexp output"
|
test_description="--format=sexp output"
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
test_begin_subtest "Show message: sexp"
|
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\""
|
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\""
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description="--format=text output"
|
test_description="--format=text output"
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
test_begin_subtest "Show message: text"
|
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\""
|
add_message "[subject]=\"text-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"text-show-message\""
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description="output of multipart message"
|
test_description="output of multipart message"
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
cat <<EOF > embedded_message
|
cat <<EOF > embedded_message
|
||||||
From: Carl Worth <cworth@cworth.org>
|
From: Carl Worth <cworth@cworth.org>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description="naming of threads with changing subject"
|
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)"
|
test_begin_subtest "Initial thread name (oldest-first search)"
|
||||||
add_message '[subject]="thread-naming: Initial thread subject"' \
|
add_message '[subject]="thread-naming: Initial thread subject"' \
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description="naming of authors with unusual addresses"
|
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"
|
test_begin_subtest "Add author with empty quoted real name"
|
||||||
add_message '[subject]="author-naming: Initial thread subject"' \
|
add_message '[subject]="author-naming: Initial thread subject"' \
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
test_description='notmuch show --format=raw'
|
test_description='notmuch show --format=raw'
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
add_message
|
add_message
|
||||||
add_message
|
add_message
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description="\"notmuch reply\" in several variations"
|
test_description="\"notmuch reply\" in several variations"
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
test_begin_subtest "Basic reply"
|
test_begin_subtest "Basic reply"
|
||||||
add_message '[from]="Sender <sender@example.com>"' \
|
add_message '[from]="Sender <sender@example.com>"' \
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description="\"notmuch reply --reply-to=sender\" in several variations"
|
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"
|
test_begin_subtest "Basic reply-to-sender"
|
||||||
add_message '[from]="Sender <sender@example.com>"' \
|
add_message '[from]="Sender <sender@example.com>"' \
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description="\"notmuch dump\" and \"notmuch restore\""
|
test_description="\"notmuch dump\" and \"notmuch restore\""
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
add_email_corpus
|
add_email_corpus
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description="handling of uuencoded data"
|
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"' \
|
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
|
'[body]="This message is used to ensure that notmuch correctly handles a
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description="threading when messages received out of order"
|
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
|
# Generate all single-root four message thread structures. We'll use
|
||||||
# this for multiple tests below.
|
# this for multiple tests below.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description="author reordering;"
|
test_description="author reordering;"
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
test_begin_subtest "Adding parent message"
|
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"'
|
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"'
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description="From line heuristics (with multiple configured addresses)"
|
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)"
|
test_begin_subtest "Magic from guessing (nothing to go on)"
|
||||||
add_message '[from]="Sender <sender@example.com>"' \
|
add_message '[from]="Sender <sender@example.com>"' \
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description="messages with ridiculously-long message IDs"
|
test_description="messages with ridiculously-long message IDs"
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
test_begin_subtest "Referencing long ID before adding"
|
test_begin_subtest "Referencing long ID before adding"
|
||||||
generate_message '[subject]="Reference of ridiculously-long message ID"' \
|
generate_message '[subject]="Reference of ridiculously-long message ID"' \
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description="encoding issues"
|
test_description="encoding issues"
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
test_begin_subtest "Message with text of unknown charset"
|
test_begin_subtest "Message with text of unknown charset"
|
||||||
add_message '[content-type]="text/plain; charset=unknown-8bit"' \
|
add_message '[content-type]="text/plain; charset=unknown-8bit"' \
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
test_description="emacs interface"
|
test_description="emacs interface"
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
EXPECTED=$TEST_DIRECTORY/emacs.expected-output
|
EXPECTED=$TEST_DIRECTORY/emacs.expected-output
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description="Emacs with large search results buffer"
|
test_description="Emacs with large search results buffer"
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
x=xxxxxxxxxx # 10
|
x=xxxxxxxxxx # 10
|
||||||
x=$x$x$x$x$x$x$x$x$x$x # 100
|
x=$x$x$x$x$x$x$x$x$x$x # 100
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
test_description="emacs: mail subject to filename"
|
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 ...)
|
# emacs server can't be started in a child process with $(test_emacs ...)
|
||||||
test_emacs '(ignore)' > /dev/null
|
test_emacs '(ignore)' > /dev/null
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
test_description="maildir synchronization"
|
test_description="maildir synchronization"
|
||||||
|
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
# Create the expected maildir structure
|
# Create the expected maildir structure
|
||||||
mkdir $MAIL_DIR/cur
|
mkdir $MAIL_DIR/cur
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
# - verification of signatures from expired/revoked keys
|
# - verification of signatures from expired/revoked keys
|
||||||
|
|
||||||
test_description='PGP/MIME signature verification and decryption'
|
test_description='PGP/MIME signature verification and decryption'
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
add_gnupg_home ()
|
add_gnupg_home ()
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
test_description='exception symbol hiding'
|
test_description='exception symbol hiding'
|
||||||
|
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
test_begin_subtest 'running test' run_test
|
test_begin_subtest 'running test' run_test
|
||||||
mkdir -p ${PWD}/fakedb/.notmuch
|
mkdir -p ${PWD}/fakedb/.notmuch
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description='folder tags removed and added through file renames remain consistent'
|
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"
|
test_begin_subtest "No new messages"
|
||||||
output=$(NOTMUCH_NEW)
|
output=$(NOTMUCH_NEW)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description='atomicity'
|
test_description='atomicity'
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
# This script tests the effects of killing and restarting "notmuch
|
# This script tests the effects of killing and restarting "notmuch
|
||||||
# new" at arbitrary points. If notmuch new is properly atomic, the
|
# new" at arbitrary points. If notmuch new is properly atomic, the
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description="python bindings"
|
test_description="python bindings"
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
test_require_external_prereq ${NOTMUCH_PYTHON}
|
test_require_external_prereq ${NOTMUCH_PYTHON}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description="ruby bindings"
|
test_description="ruby bindings"
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
if [ "${NOTMUCH_HAVE_RUBY_DEV}" = "0" ]; then
|
if [ "${NOTMUCH_HAVE_RUBY_DEV}" = "0" ]; then
|
||||||
test_subtest_missing_external_prereq_["ruby development files"]=t
|
test_subtest_missing_external_prereq_["ruby development files"]=t
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description='hooks'
|
test_description='hooks'
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
HOOK_DIR=${MAIL_DIR}/.notmuch/hooks
|
HOOK_DIR=${MAIL_DIR}/.notmuch/hooks
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description="argument parsing"
|
test_description="argument parsing"
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
test_begin_subtest "sanity check"
|
test_begin_subtest "sanity check"
|
||||||
$TEST_DIRECTORY/arg-test pos1 --keyword=one --string=foo pos2 --int=7 --flag=one --flag=three > OUTPUT
|
$TEST_DIRECTORY/arg-test pos1 --keyword=one --string=foo pos2 --int=7 --flag=one --flag=three > OUTPUT
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
test_description="emacs test function sanity"
|
test_description="emacs test function sanity"
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
test_begin_subtest "emacs test function sanity"
|
test_begin_subtest "emacs test function sanity"
|
||||||
test_emacs_expect_t 't'
|
test_emacs_expect_t 't'
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
test_description="emacs address cleaning"
|
test_description="emacs address cleaning"
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
test_begin_subtest "notmuch-test-address-clean part 1"
|
test_begin_subtest "notmuch-test-address-clean part 1"
|
||||||
test_emacs_expect_t '(notmuch-test-address-cleaning-1)'
|
test_emacs_expect_t '(notmuch-test-address-cleaning-1)'
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
test_description="emacs notmuch-hello view"
|
test_description="emacs notmuch-hello view"
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
EXPECTED=$TEST_DIRECTORY/emacs.expected-output
|
EXPECTED=$TEST_DIRECTORY/emacs.expected-output
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
test_description="emacs notmuch-show view"
|
test_description="emacs notmuch-show view"
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
EXPECTED=$TEST_DIRECTORY/emacs-show.expected-output
|
EXPECTED=$TEST_DIRECTORY/emacs-show.expected-output
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
test_description="emacs notmuch-show charset handling"
|
test_description="emacs notmuch-show charset handling"
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
|
|
||||||
UTF8_YEN=$'\xef\xbf\xa5'
|
UTF8_YEN=$'\xef\xbf\xa5'
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
test_description="emacs tree view interface"
|
test_description="emacs tree view interface"
|
||||||
. test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
EXPECTED=$TEST_DIRECTORY/tree.expected-output
|
EXPECTED=$TEST_DIRECTORY/tree.expected-output
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description='messages with missing headers'
|
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
|
# Notmuch requires at least one of from, subject, or to or it will
|
||||||
# ignore the file. Generate two messages so that together they cover
|
# ignore the file. Generate two messages so that together they cover
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description="hex encoding and decoding"
|
test_description="hex encoding and decoding"
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
test_begin_subtest "round trip"
|
test_begin_subtest "round trip"
|
||||||
find $TEST_DIRECTORY/corpus -type f -print | sort | xargs cat > EXPECTED
|
find $TEST_DIRECTORY/corpus -type f -print | sort | xargs cat > EXPECTED
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description="date/time parser module"
|
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
|
# Sanity/smoke tests for the date/time parser independent of notmuch
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description="date:since..until queries"
|
test_description="date:since..until queries"
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
add_email_corpus
|
add_email_corpus
|
||||||
|
|
||||||
|
|
|
@ -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
|
# database is constructed properly, even in the presence of
|
||||||
# non-RFC-compliant headers'
|
# non-RFC-compliant headers'
|
||||||
|
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
test_begin_subtest "Use References when In-Reply-To is broken"
|
test_begin_subtest "Use References when In-Reply-To is broken"
|
||||||
add_message '[id]="foo@one.com"' \
|
add_message '[id]="foo@one.com"' \
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description='"notmuch show"'
|
test_description='"notmuch show"'
|
||||||
|
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
add_email_corpus
|
add_email_corpus
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description="database upgrade"
|
test_description="database upgrade"
|
||||||
|
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
dbtarball=database-v1.tar.xz
|
dbtarball=database-v1.tar.xz
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description="database version and feature compatibility"
|
test_description="database version and feature compatibility"
|
||||||
|
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
test_begin_subtest "future database versions abort open"
|
test_begin_subtest "future database versions abort open"
|
||||||
${TEST_DIRECTORY}/make-db-version ${MAIL_DIR} 9999 ""
|
${TEST_DIRECTORY}/make-db-version ${MAIL_DIR} 9999 ""
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test_description="error reporting for library"
|
test_description="error reporting for library"
|
||||||
|
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh || exit 1
|
||||||
|
|
||||||
backup_database () {
|
backup_database () {
|
||||||
rm -rf notmuch-dir-backup
|
rm -rf notmuch-dir-backup
|
||||||
|
|
|
@ -40,7 +40,7 @@ TEST_DIRECTORY=$(pwd)
|
||||||
notmuch_path=`find_notmuch_path "$TEST_DIRECTORY"`
|
notmuch_path=`find_notmuch_path "$TEST_DIRECTORY"`
|
||||||
|
|
||||||
# configure output
|
# configure output
|
||||||
. $notmuch_path/sh.config
|
. $notmuch_path/sh.config || exit 1
|
||||||
|
|
||||||
if test -n "$valgrind"
|
if test -n "$valgrind"
|
||||||
then
|
then
|
||||||
|
|
|
@ -96,7 +96,8 @@ _x32="$_x04$_x04$_x04$_x04$_x04$_x04$_x04$_x04"
|
||||||
# test_description='Description of this test...
|
# test_description='Description of this test...
|
||||||
# This test checks if command xyzzy does the right thing...
|
# This test checks if command xyzzy does the right thing...
|
||||||
# '
|
# '
|
||||||
# . ./test-lib.sh
|
# . ./test-lib.sh || exit 1
|
||||||
|
|
||||||
[ "x$ORIGINAL_TERM" != "xdumb" ] && (
|
[ "x$ORIGINAL_TERM" != "xdumb" ] && (
|
||||||
TERM=$ORIGINAL_TERM &&
|
TERM=$ORIGINAL_TERM &&
|
||||||
export TERM &&
|
export TERM &&
|
||||||
|
@ -1223,7 +1224,7 @@ test_init_ () {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
. ./test-lib-common.sh
|
. ./test-lib-common.sh || exit 1
|
||||||
|
|
||||||
emacs_generate_script
|
emacs_generate_script
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
test_description='the verbosity options of the test framework itself.'
|
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' '
|
test_expect_success 'print something in test_expect_success and pass' '
|
||||||
echo "hello stdout" &&
|
echo "hello stdout" &&
|
||||||
|
|
Loading…
Reference in a new issue