aboutsummaryrefslogtreecommitdiff
path: root/test/README
AgeCommit message (Collapse)Author
2023-07-21test: support testing notmuch as installedDavid Bremner
We put some effort into testing the built copy rather than some installed copy. On the other hand for people like packagers, testing the installed copy is also of interest. When NOTMUCH_TEST_INSTALLED is set to a nonempty value, tests do not require a built notmuch tree or running configure. Some of the tests marked as broken when running against installed notmuch are probably fixable.
2021-01-17test: add (back) upgrade testsDavid Bremner
In ee897cab8b721 the upgrade tests from pre v3 databases were removed. The reasons for that are still valid, but we should still test the code paths that do the upgrade, and it is relatively straightforward to do that for v3 to v3 upgrades.
2020-08-16test: update README to reflect dropping upgrade testsDavid Bremner
These test databases have been unneeded since ee897cab8.
2019-05-07tests: environment variable to specify that tests should be serializedJameson Graef Rollins
If NOTMUCH_TEST_SERIALIZE is non-null all tests will be run in series, rather than in parallel.
2017-10-21test: remove --root option and fix TMP_DIRECTORY cleanupJani Nikula
The primary motivation here is to fix TMP_DIRECTORY cleanup prior to running each test when the current working directory is not the test subdirectory. Tests with failures would leave their TMP_DIRECTORY directory behind for debugging, and repeated out-of-tree test runs would have old temp directories. (This lead to e.g. T310-emacs.sh hanging because emacs would prompt for overwriting files.) We remove the likely anyway defunct --root test option while at it, just to be on the safe side when doing 'rm -rf' on the TMP_DIRECTORY.
2017-07-18Fix orthographyDaniel Kahn Gillmor
2017-03-25tests: add compatibility layerMikhail
Make test-lib-common.sh load test-lib-<$PLATFORM>.sh to create additional shim for platform specifics. Use test-lib-FREEBSD.sh to call GNU utilities instead of native ones. - amended by db following Tomi's suggestions
2017-03-09test: require test_begin_subtest before test_expect_codeJani Nikula
Unify the subtests by requiring test_begin_subtest before test_expect_code. (Similar change for test_expect_success has already been done.) This increases clarity in the test scripts by having a separate line for the start of the subtest with the heading, and makes it possible to simplify the test infrastructure by making all subtests similar.
2017-03-09test: require test_begin_subtest before test_expect_successJani Nikula
Unify the subtests by requiring test_begin_subtest before test_expect_success. (Similar change for test_expect_code will follow.) This increases clarity in the test scripts by having a separate line for the start of the subtest with the heading, and makes it possible to simplify the test infrastructure by making all subtests similar.
2016-05-19test: copyright information updatesTomi Ollila
Files in test directories had only copyright of a single individual, of which code was adapted here as a base of the test system. Since then many Notmuch Developers have contributed to the test system, which is now acknowledged with a constant string in some of the test files. The README file in test directory instructed new files contain a copyright notice, but that has never been done (and it is also not needed). To simplify things a bit (and lessen confusion) this instruction is now removed. As a side enchangement, all of the 3 entries in the whole source tree cd'ing to `dirname` of "$0" now uses syntax cd "$(dirname "$0")". This makes these particular lines work when current working directory is e.g. /c/Program Files/notmuch/test/. (Probably it would fail elsewhere, though.)
2016-03-04test/README: have matching test script file namesTomi Ollila
A while ago test script names were changed to format Tddd-basename.sh. Update README to reflect that. While at it, included some small requirements updates.
2015-09-25test suite: don't consider skipped individual tests as failingDavid Bremner
It isn't completely clear what we want to do here, but 1) We currently don't fail if we skip a whole test file (mainly because we neglect to count those skipped tests properly). This change at least makes the two kinds of skipping consistent. 2) Automated build environments may have good reasons for building with a minimal set of prereqs, and we don't want to discourage running our test suite by breaking builds.
2015-08-07test: make script exit (1) if it "fails" to source (.) a fileTomi Ollila
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.
2015-03-29test: add support for compiling and running C snippetsDavid Bremner
This is to limit the copy-pasta involved in running C tests. I decided to keep things simple and not try to provide an actual C skeleton. The setting of LD_LIBRARY_PATH is to force using the built libnotmuch rather than any potential system one.
2014-03-11test: add machinery to download and verify databasesDavid Bremner
Note that it is intentional that the checksum file is not downloaded. The intent is to check those into git.
2013-12-09test: implement and document NOTMUCH_TEST_QUIET variable usageTomi Ollila
When NOTMUCH_TEST_QUIET environment variable is set to non-null value messages when new test script starts and when test PASSes are disabled. This eases picking the cases when tests FAIL (as those are still printed).
2013-03-07test/README: mention the test_expect_equal_json and *sanitize* functionsAaron Ecay
also fix one typo
2012-11-29test: Make the emacsclient binary user-configurableAustin Clements
And require that if TEST_EMACS is specified, so is TEST_EMACSCLIENT. Previously, the test framework always used "emacsclient", even if the Emacs in use was overridden by TEST_EMACS. This causes problems if both Emacs 23 and Emacs 24 are installed, the Emacs 23 emacsclient is the system default, but TEST_EMACS is set to emacs24. Specifically, with an Emacs 24 server and an Emacs 23 client, emacs tests that run very quickly may produce no output from emacsclient, causing the test to fail. The Emacs server uses a very simple line-oriented protocol in which the client sends a request to evaluate an expression and the server sends a request to print the result of evaluation. Prior to Emacs bzr commit 107565 on March 11th, 2012 (released in Emacs 24.1), if multiple commands were sent to the emacsclient between when it sent the evaluation command and when it entered its receive loop, it would only process the first response command, ignoring the rest of the received buffer. This wasn't a problem with the Emacs 23 server because it sent only the command to print the evaluation result. However, the Emacs 24 server first sends an unprompted command specifying the PID of the Emacs server, then processes the evaluation request, then sends the command to print the result. If the evaluation is fast enough, it can send both of these commands before emacsclient enters the receive loop. Hence, if an Emacs 24 server is used with an Emacs 23 emacsclient, it may miss the response printing command, ultimately causing intermittent notmuch test failures.
2012-11-16Fixed 2 misspellings of word 'separate'Tomi Ollila
"Seperate: The second most common misspelling on the Internet..." (from http://www.re-vision.com/spelling/separate.html). s/seperate/separate/ in debian/NEWS.Debian & test/README done.
2012-09-01test: make test_expect_equal_file() arguments flexibleDmitry Kurochkin
Before the change, test_expect_equal_file() function treated the first argument as "actual output file" and the second argument as "expected output file". When the test fails, the files are copied for later inspection. The first files was copied to "$testname.output" and the second file to "$testname.expected". The argument order for test_expect_equal_file() is often wrong which results in confusing diff output and incorrectly named files. The patch solves the issue by changing test_expect_equal_file() to treat arguments just as two files, without any special properties (like "actual" and "expected"). The file names for copying is now based on the given file name: "$testname.$file1" and "$testname.$file2". E.g. if test_expect_equal_file() is called with "OUTPUT" and "EXPECTED", the copied files can be named "emacs.1.OUTPUT" and "emacs.1.EXPECTED". The down side of this approach is that diff argument order depends on test_expect_equal_file() argument order. So sometimes we get diff from expected to actual results, and sometimes the other way around. But the files are always named correctly.
2012-01-25test: Add `test_emacs_expect_t'.David Edmondson
Add a new test function to allow simpler testing of emacs functionality. `test_emacs_expect_t' takes one argument - a lisp expression to evaluate. The test passes if the expression returns `t', otherwise it fails and the output is reported to the tester.
2012-01-21Document external dependencies in the test suiteEthan Glasser-Camp
Add an explicit note to the README explaining what programs are necessary and the perhaps-surprising behavior of skipping tests if they aren't present. Signed-off-by: Ethan Glasser-Camp <ethan@betacantrips.com>
2011-12-28test: allow user to choose which emacs to run tests with.David Bremner
As we start to pay more attention to emacs24, it helps to be able to select a different version of emacs to run the tests with to verify version specific bugs. A separate variable TEST_EMACS is needed to avoid being overwritten by the make variable EMACS in Makefile.config For what it's worth, the value of emacs is chosen at the time tmp.emacs/run_emacs is created, so is fixed for all subtests.
2011-12-07test: add functions to count how much times notmuch was calledDmitry Kurochkin
The patch adds two auxiliary functions and a variable: notmuch_counter_reset $notmuch_counter_command notmuch_counter_value They allow to count how many times notmuch binary is called. notmuch_counter_reset() function generates a script that counts how many times it is called and resets the counter to zero. The function sets $notmuch_counter_command variable to the path to the generated script that should be called instead of notmuch to do the counting. The notmuch_counter_value() function returns the current counter value.
2011-12-06test: add test-binaries targetDavid Bremner
The goal here is to have a simple way of making sure all of the binaries needed to run tests are available.
2011-09-10test: remove documentation for test_expect_equal_failure.David Bremner
The actual function was deleted in commit 4cc67276
2011-09-10test: improve known broken tests supportDmitry Kurochkin
There is existing support for broken tests. But it is not convenient to use. The primary issue is that we have to maintain a set of test_expect_*_failure functions which are equivalent to the normal test_expect_* counterparts except for what functions are called for result reporting. The patch adds test_subtest_known_broken function which marks a subset as broken, making the normal test_expect_* functions behave as test_expect_*_failure. All test_expect_*_failure functions are removed. Test_known_broken_failure_ is changed to format details the same way as test_failure_ does. Another benefit of this change is that the diff when a broken test is fixed would be small and nice. Documentation is updated accordingly.
2011-09-10test: update documentation for test_emacs in test/READMEDmitry Kurochkin
Update test_emacs documentation in test/README according to the latest changes in emacs tests. Move the note regarding setting variables from test/emacs to test/README.
2011-06-29test: document test_expect_equal_fileJameson Graef Rollins
This test was not properly documented when it was originally added (my bad).
2011-06-28test:Improve test behaviors when --root is usedMark Anderson
Change add_email_corpus, emacs_deliver_message and tests to use $TEST_DIRECTORY instead of '..'. This improves the behavior of the usage of --root=<dir>, as the assumption of what '..' means will usually be incorrect. Document -root option in README and update valgrind to work with -root.
2011-06-23fix sum moar typos [text files]Pieter Praet
Various typo fixes in auxiliary text files included with the source, (README, TODO, etc.). Signed-off-by: Pieter Praet <pieter@praet.org> Edited-by: Carl Worth <cworth@cworth.org> Restricted to just text files.
2011-05-27test: change "#!/bin/bash" to "#!/usr/bin/env bash" enhances portabilityJoel Borggrén-Franck
Change #!/bin/bash at start of tests to "#!/usr/bin/env bash". That way systems running on bash < 4 can prepend bash >= 4 to path before running the tests.
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-09-20test/README: Document add_email_corpus (and add_message/generate_message)Carl Worth
While adding the documentation here for add_email_corpus I noticed that the other email-adding functions in test-lib.sh were not yet documented here, so add all of that documentation.
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/README: Update to become notmuch-specific rather than git-specificCarl Worth
This file was obviously describing the git test suite previously, and would have been very hard to understand in the context of the notmuch test suite. HOpefully it's easier to follow now.
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>