summaryrefslogtreecommitdiff
path: root/test/test-lib.sh
AgeCommit message (Collapse)Author
2010-10-28test: Emit a friendly error message if run with bash < 4.0.Carl Worth
The bash code in the test suite is using associative arrays which were only added to bash as of release 4.0. If the test suite is run with an older bash, we now immediately error out and explain the situation, (instead of emitting confusing error messages and failing dozens of tests, which is what happened before this change).
2010-10-27test: Set alternate HOME during tests.Carl Worth
We set the HOME environment variable to the test directory to avoid the tests relying on any configuration files from the test author's own home directory, (such as ${HOME}/.emacs or similar).
2010-10-22test: Add simple tests for navigating notmuch-hello and notmuch-search viewsCarl Worth
We simulate the act of selecting the "inbox" saved search from notmuch-hello and the act of selecting a desired thread from the notmuch-search results. The test for the navigation of notmuch-hello is currently marked as BROKEN since its output is in the opposite order compared to the '(notmuch-search "tag:inbox")' test. This question of ordering is a currently open issue on the notmuch mailing list, so we'll let the test suite reflect that for now. Finally, this commit also abstracts some common emacs lisp code, (waiting for the current buffer's process to complete), into a new notmuch-test-wait function that is made available to anything calling test_emacs.
2010-10-22test: Add a new test_expect_equal_failureCarl Worth
Which allows us to have a known-broken test that would otherwise use test_expect_equal.
2010-10-22test: Add a new test_emacs function to test-lib.shCarl Worth
This should be quite handy for doing automated testing of the emacs-based functionality in notmuch. This function invokes emacs with the necessary command-line arguments, (to run in batch mode with no local initialization, to load the notmuch code from the source directory, and to ensure an 80-column width).
2010-10-22test: Fix add_email_corpus function to be quiet.Carl Worth
This simply avoids some unneeded noise in the "make test" output.
2010-09-20test: Fix the search and dump-restore tests to operator on non-empty mail store.Carl Worth
We do this with a new add_email_corpus function that establishes a mail store with 50 messages from the notmuch mailing list.
2010-09-20test: Remove useless NOTMUCH variable (in favor of simply "notmuch")Carl Worth
When the NOTMUCH variable was originally invented it was used as an explicit path to the notmuch binary being tested. Today, the test suite sets the PATH variable instead, so the NOTMUCH variable always has a value of simply "notmuch". We simplifying that by using the constant value rather than the continual variable reference.
2010-09-20test: Remove some dead code in test-lib.shCarl Worth
These assignements weren't being used at all and were just confusing me, (the real assignments happen later on in the file).
2010-09-20test: Print section names, and rename all test sectionsCarl Worth
Now that we can usefully pass section names via the NOTMUCH_SKIP_TESTS environment variable, it's useful to actually print those names out for the user. Then, since we're now printing these names, let's use nicer names, (not excessively long but also not using abbreviations like "msg").
2010-09-20test: Make the --valgrind option useful, (and drop --verbose).Carl Worth
In order for --valgrind to be useful, we drop noisy additional output of all of the commands being executed in verbose mode. This makes --verbose alone quite useless, so we don't document it any more. Also, add a zlib valgrind suppression that was showing up frequently in the test suite.
2010-09-20test: Rename GIT_SKIP_TESTS to NOTMUCH_SKIP_TESTSCarl Worth
By scanning test-lib.sh for occurrences of "git" or "GIT", I found that most of those are internal things, (like the GIT_TEST_TEE_STARTED variable). But GIT_SKIP_TESTS is part of the user-interface to the test suite, so we rename it to reference notmuch rather than git. Also, the GIT_TRACE warning is git-specific, so we drop that as well.
2010-09-20test: Fix test suite so that --valgrind option works.Carl Worth
The output is ugly, and we need a better suppressions file, but this is at least a start.
2010-09-17test: Rework test-suite input to avoid ulti-command stringsCarl Worth
The original git test suite works by concatenating many commands into a very long string (each separated by &&). This is painful to work with since it prevents the editor from helping by parsing the shell script, indenting, colorizing, etc. Instead, we switch this back to something like the original notmuch test suite, and add two new functions to test-lib.sh (test_begin_subtest and test_expect_equal) to support these. This also fixes the test suite to once again display the diff when a test fails to generate the expected input.
2010-09-17test: Cleanup the test outputCarl Worth
This makes the new, git-derived test suite report results in a manner similar to the original notmuch test suite. Notable changes include: * No more initial '*' on every line * Only colorize a single word * Don't print useless test numbers * Use "PASS" in place of "ok" * Begin sentences with a capital letter * Print test descriptions for each block * Separate each block of tests with a blank line * Don't summarize counts between each block
2010-09-16test: Set all times to UTCMichal Sojka
In order to have repeatable test suite, all times in messages are set to UTC time zone to match the time zone (TZ variable) set in test-lib.sh. Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
2010-09-16test: Update helper functionsMichal Sojka
Modify the helper functions to work with git-based test suite i.e. 1) Quote arguments where it is necessary. 2) Do not use $NOTMUCH. It is equal to "notmuch" since $PATH is set to the build tree. 3) Modify pass_if_equal to fit into the git-based test suite. Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
2010-09-16Update test framework for use with notmuchMichal Sojka
This removes Git specific things from the test-lib.sh and adds helper functions for notmuch taken from Carl's notmuch-test script. README is also slightly modified to reflect the current state. Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
2010-09-16Copy test framework from GitMichal Sojka
Git uses a simple and yet powerful test framework, written in shell. The framework is easy to use for both users and developers so I think it would help if it is used in notmuch as well. This is a copy of Git's test framework from commit b6b0afdc30e066788592ca07c9a6c6936c68cc11 in git repository. Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>