aboutsummaryrefslogtreecommitdiff
path: root/test/notmuch-test
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-08-03test: use --minversion to detect GNU Parallel.David Bremner
Based on a suggestion of Ole Tange [1]. [1]: id:CA+4vN7x6jp4HCiEybZ=5g+2X6Pa7etBFX3Bbd=UYty37gR6wEQ@mail.gmail.com
2021-06-07test: aggregate-results updatesTomi Ollila
notmuch-test will now call aggregate-results.sh with file list that it compiles based on the test ran, and aggregate-results will report failure is any of the test files are missing. With this notmuch-test no longer has to exit in non-parallel run if some test fail to write its report file -- so it works as parallel tests in this sense. Changed test_done() in test-lib.sh write report file in one write(2), so there is (even) less chance it being partially written. Also, now it writes 'total' last and aggregate-results.sh expects this line to exist in all report files for reporting to be successful. Added 'set -eu' to notmuch-test and modified code to work with these settings. That makes it harder to get mistakes slipped into committed code.
2021-04-26test: hide message from moreutils parallel.David Bremner
The argument --version confuses moreutils parallel, but this is OK, because its confusing does not include printing "GNU"
2021-04-24test: check for GNU parallel with --version optionsTobias Backer Dirks
The lastest versions of GNU parallel no longer make mention of GNU within their help output. This causes the test script to mistakenly use the moreutils parallel execution. In order to fix this, while maintaining compatibility with previous versions of GNU parallel, --version should be used. Signed-off-by: Tobias Backer Dirks <omgitsaheadcrab@gmail.com>
2019-05-26test: report summary even when abortingDaniel Kahn Gillmor
In certain cases of test suite failure, the summary report was not being printed. In particular, any failure on the parallel test suite, and any aborted test in the serialized test suite would end up hiding the summary. It's better to always show the summary where we can (while preserving the return code). If we do abort due to this high-level failure, though, we should also announce to the user that we're doing so as close to the end of the process as possible, to make it easier to find the problem. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-25test: allow disabling timeout with NOTMUCH_TEST_TIMEOUT=0Daniel Kahn Gillmor
To aid in diagnosing test suite tooling that interacts poorly with coreutils' timeout, it's handy to be able to bypass it entirely. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-23test-lib.sh: colors to test output when parallel(1) is run on ttyTomi Ollila
Done via $COLORS_WITHOUT_TTY environment variable as passing options to commands through parallel(1) does not look trivial. Reorganized color checking in test-lib.sh a bit for this (perhaps were not fully necessary but rest still an improvement): - color checking commands in subshell are not run before arg parsing (args may disable colors with --no-color) - [ -t 1 ] is checked before forking subshell
2019-05-20tests: fail and report when a parallel build fails (or times out)Daniel Kahn Gillmor
When a parallel build fails (or when it times out, if timeout is present), the test suite should not blithely succeed. Catch these failures and at least report them. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-20tests: make timeout configurable with NOTMUCH_TEST_TIMEOUT (default: 2m)Daniel Kahn Gillmor
The current 2 minute timeout is reasonable, but to exercise the test suite or induce timeout failures, we might want to make it shorter. This makes it configurable so you can run (for example): make check NOTMUCH_TEST_TIMEOUT=10s We stick with the default of 2m. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
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.
2019-05-07tests: run all tests in parallel, if availableJameson Graef Rollins
If either the moreutils or GNU parallel utility are available, run all tests in parallel. On my eight core machine this makes for a ~x7 speed-up in the full test suite (1m24s -> 12s). The design of the test suite makes this parallelization trivial.
2019-05-07tests: remove entangling corpus index optimizationJameson Graef Rollins
The add_email_corpus test utility includes logic that tries to re-use an index of the corpus if available. This was seemingly done as an optimization, so that every test that uses the corpus didn't have to create it's own index of the corpus. However, this has the perverse side effect of entangling tests together, and breaks parallelization. Forcing each test to do it's own index does increase the overall time of the test slightly (~6%), but this will be more than made up for in the next patch that introduces paraellization.
2017-10-20test: use source and build paths in notmuch-testJani Nikula
Make a distinction between source and build directories.
2017-08-18test: Update extant references to corpus.mailVladimir Panteleev
971cdc72cdb80f060193bc0914dc9badcc29696b renamed corpus.mail to corpora.mail. Although 971cdc72cdb80f060193bc0914dc9badcc29696b updated some of the remaining corpus.mail references, two remained, causing the test suite to leave behind an unignored corpora.mail directory.
2016-06-28test/notmuch-test: simple streamliningTomi Ollila
A few simple things that applies well to test/notmuch-test.sh - Shell does pathname expansion also without doing `echo ...` in subshell. - Redirections >/dev/null 2>/dev/null hide (improbable but) potential serious errors; adding -f to rm instead. - Inter-file capitalization consistency in comments. - Unnecesary space removal.
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.)
2014-01-13test: renamed test scripts to format T\d\d\d-name.shTomi Ollila
All test scripts to be executed are now named as T\d\d\d-name.sh, numers in increments of 10. This eases adding new tests and developers to see which are test scripts that are executed by test suite and in which order.
2013-12-09test: print empty line at the beginning of test script, not at endTomi Ollila
In preparation for quiet mode print empty line before writing the test description. This is done now in function designed for it -- it will also be called when test fails.
2013-11-07test: move emacs-tree test into mainlineMark Walters
We move the emacs-tree test and associated files into the main test directory and add the test to the list in notmuch-test.
2013-10-31test: Add compact testBen Gamari
Signed-off-by: Ben Gamari <bgamari.foss@gmail.com>
2013-09-08test: exit with nonzero value when not all tests completed successfullyTomi Ollila
If any of the tests in our test system is not passing the execution of the test suite completes with nonzero exit value. It is better to rely on the exit value of the test system instead of some arbitrary strings in test output (or use both).
2013-06-29test: add tests for insertPeter Wang
Add tests for new 'insert' command.
2013-05-13test: add tests for the handling of References and In-Reply-To headersAaron Ecay
These tests are known_broken, the following commit fixes them. amended per id:87txmi1zq3.fsf@nikula.org id:87vc6yalo7.fsf@zancas.localnet
2013-05-12test: add basic test for notmuch setupJani Nikula
And annotate with test_subtest_known_broken. Hooray.
2012-12-08Adding tests for --format=sexp.Peter Feigl
Add basic tests, the same as for json, for the S-Expression output format.
2012-12-02test/hex-escaping: new test for hex escaping routinesDavid Bremner
These are more like unit tests, to (try to) make sure the library functionality is working before building more complicated things on top of it.
2012-11-29test: Abort driver if a test script abortsAustin Clements
Previously, if a test script aborted (e.g., because it passed too few arguments to a test function), the test driver loop would simply continue on to the next test script and the final results would declare that everything passed (except that the test count would look suspiciously low, but maybe you just misremembered how many tests there were). Now, if a test script exits with a non-zero status and did not produce a final results file, we propagate that failure out of the driver loop immediately. To keep this simple, this patch removes the PID from the test-results file name. This PID was inherited from the git test system and seems unnecessary, since the file name already includes the name of the test script and the test-results directory is created anew for each run.
2012-10-31test: add tests for date:since..until range queriesJani Nikula
A brief initial test set.
2012-10-31test: add smoke tests for the date/time parser moduleJani Nikula
Test the date/time parser module directly, independent of notmuch, using the parse-time test tool. Credits to Michal Sojka <sojkam1@fel.cvut.cz> for writing most of the tests.
2012-08-12test: Add test for messages with missing headersAustin Clements
Currently the JSON tests for search and show are broken because notmuch attempts to dereference a NULL pointer.
2012-07-09test: add basic show, search --format=text testsPeter Wang
There didn't seem to be these basic tests for --format=text, as there are for --format=json. These are just the tests from the `json' script, with adjusted expected outputs.
2012-04-28test: Add tests for 'config' commandPeter Wang
Start a new test script.
2012-04-07test: add some exclude testsMark Walters
Systematically test the exclude options for search. Also move the search existing exclude tests into the new test. There is some overlap between the two sets of tests but many of the existing ones are there because they triggered bugs in the past so I have kept them to ensure coverage.
2012-03-01emacs: Tests for user-defined sectionsDaniel Schoepe
A new file was added for notmuch-hello tests.
2012-02-04test: add test for hiding Original Message region at beginning of a messageDmitry Kurochkin
The test is currently broken and will be fixed by a subsequent patch. The patch adds a new file for tests of Emacs notmuch-show view. Based on patch by David Edmondson [1]. [1] id:"1327562380-12894-4-git-send-email-dme@dme.org"
2012-02-03test: remove ".sh" extension from the recently added Emacs testsDmitry Kurochkin
All test files, except for the recently added Emacs tests, do not have ".sh" extension. So remove it from the new test files for consistency.
2012-01-25test: Add address cleaning tests.David Edmondson
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-14test: add tests for "notmuch reply" --reply-to=senderMark Walters
2011-12-28test: emacs: test notmuch-wash-subject-to-* functionsJani Nikula
Signed-off-by: Jani Nikula <jani@nikula.org>
2011-12-11test: add tests for hooksJani Nikula
Signed-off-by: Jani Nikula <jani@nikula.org>
2011-12-08test: tests for command-line-arguments.cDavid Bremner
This was needed because no current notmuch code exercises the NOTMUCH_OPT_STRING style arguments.
2011-12-06Merge branch 'release'David Bremner
Conflicts: NEWS Conflicts resolved by inserting the 0.10.2 stanza before 0.11
2011-12-05test: add tests for python bindingsDavid Bremner
We start modestly, with a (slightly modified) test case from Kazuo Teramoto. Originally it just made sure the bindings didn't crash; here we check that by comparing the output with that of notmuch search.
2011-11-26Merge branch 'release'David Bremner
2011-11-25test: add simple tests for online helpdebian/0.10.1-10.10.1David Bremner
Nothing fancy, but we can at least detect segmentation faults.
2011-11-18test: make all tests terminable with Ctrl-cTomi Ollila
Some tests don't break when HUP signal is sent tho those (by pressing ctrl-c on the terminal). Therefore, the top-level test script catches the HUP and sends TERM signal to the started test script.
2011-11-15test: add tests for notmuch search --offset and --limitJani Nikula
Signed-off-by: Jani Nikula <jani@nikula.org>
2011-11-15test: add tests for notmuch countJani Nikula
Signed-off-by: Jani Nikula <jani@nikula.org>