summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2015-10-14cli: delete directory documents on directory removal0.21_rc0Jani Nikula
There was a problem with the directory documents being left behind when the filesystem directory was removed. This was worked around in [1]. However, that ignored the fact that the directory documents are also still listed by notmuch_directory_get_child_directories() leading to confusing results when running notmuch new. The directory documents are found and queued for removal over and over again. Fix the problem for real by removing the directory documents. This fixes the tests flagged as broken in [2]. The (non-deterministic) hack test from [3] also still passes with this change. [1] commit acd66cdec075312944e527febd46382e54d99367 [2] commit ed9ceda623d3f22fb66365b33db63c5c982067d3 [3] id:1441445731-4362-1-git-send-email-jani@nikula.org
2015-10-10test: flag one more notmuch new test as brokenJani Nikula
Drop the test update added in [1] and mark the test as broken, like the tests flagged as broken in [2]. These all reflect the same underlying breakage with (lack of) directory deletion. [1] commit e4e04bbc328f990e36b77f508aef904d156029b1 [2] commit ed9ceda623d3f22fb66365b33db63c5c982067d3
2015-09-26test: add notmuch address --deduplicate=(no|mailbox|address) testsJani Nikula
First a simple smoke test first, next generate messages with multiple email address variants and check the behaviour of deduplication schemes with these.
2015-09-25lib: add support for date:<expr>..! to mean date:<expr>..<expr>Jani Nikula
It doesn't seem likely we can support simple date:<expr> expanding to date:<expr>..<expr> any time soon. (This can be done with a future version of Xapian, or with a custom query query parser.) In the mean time, provide shorthand date:<expr>..! to mean the same. This is useful, as the expansion takes place before interpetation, and we can use, for example, date:yesterday..! to match from beginning of yesterday to end of yesterday. Idea from Mark Walters <markwalters1009@gmail.com>.
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-09-25make test: NOTMUCH_TEST_QUIET=1 is now the defaultTomi Ollila
make test V=1 (or any other value than 0) and make test V=0 works similar way as build in general
2015-09-24test: notmuch address --deduplicate=no testsJani Nikula
Test not using address deduplication. Incorporate some trivial output sorting tests here, as they seem to lack tests.
2015-09-24test: check argc in symbol-testJani Nikula
Check argc mainly to fix unused parameter warning: test/symbol-test.cc:7:14: warning: unused parameter ‘argc’ [-Wunused-parameter] int main(int argc, char** argv) { ^ This makes more sense than telling the compiler it's unused on purpose.
2015-09-20cli/count: update to use notmuch_query_search_messages_stDavid Bremner
This brings back status information that may have been hidden by the great library logging conversion. Note the change of the internal API / return-value for count_files. The other count calls to the lib will also get error handling when that API is updated in the lib.
2015-09-07test: fix whitespace/indentation in symbol-testJani Nikula
Not of much consequence, but makes it nicer to do further edits.
2015-09-04test: move backup_database and restore_database to libraryDavid Bremner
The plan is to re-use them in testing the same errors from the CLI
2015-08-14lib: Add "lastmod:" queries for filtering by last modificationAustin Clements
The implementation is essentially the same as the date range search prior to Jani's fancy date parser.
2015-08-14cli: add global option "--uuid"David Bremner
The function notmuch_exit_if_unmatched_db_uuid is split from notmuch_process_shared_options because it needs an open notmuch database. There are two exceptional cases in uuid handling. 1) notmuch config and notmuch setup don't currently open the database, so it doesn't make sense to check the UUID. 2) notmuch compact opens the database inside the library, so we either need to open the database just to check uuid, or change the API.
2015-08-14cli/count: add --lastmodDavid Bremner
In the short term we need a way to get lastmod information e.g. for the test suite. In the long term we probably want to add lastmod information to at least the structured output for several other clients (e.g. show, search).
2015-08-13lib: API to retrieve database revision and UUIDAustin Clements
This exposes the committed database revision to library users along with a UUID that can be used to detect when revision numbers are no longer comparable (e.g., because the database has been replaced).
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-08-07emacs: make modifications to message Fcc vars buffer-localDavid Bremner
Previously we globally modified these variables, which tended to cause problems for people using message-mode, but not notmuch-mua-mail, to send mail. User visible changes: - Calling notmuch-fcc-header-setup is no longer optional. OTOH, it seems to do the right thing if notmuch-fcc-dirs is set to nil. - The Fcc header is visible during message composition - The name in the mode line is changed, and no longer matches exactly the menu label. - Previously notmuch-mua-send-and-exit was never called. Either we misunderstood define-mail-user-agent, or it had a bug. So there was no difference if the user called message-send-and-exit directly. Now there will be. - User bindings to C-c C-c and C-c C-s in message-mode-map are overridden. The user can override them in notmuch-message-mode-map, but then they're on their own for Fcc handling.
2015-08-04test: add debugging output to notmuch-new tests, mark 5 as brokenDavid Bremner
I marked the tests where I really couldn't understand the output as broken. It could also be that I don't understand how directory removal is supposed to work.
2015-08-04cli/new: add more debugging outputDavid Bremner
Try to narrow down what part of the code adds files and directories to the queue(s) to be deleted. Update one test. The output is slightly confusing, but I believe it is correct, resulting from a directory being discovered but containing only ignored files.
2015-08-04test: don't claim single message mbox support is going awayDavid Bremner
We gave up on this.
2015-08-04test: use the python interpreter in sh.configDavid Bremner
The configure script chooses "python" if both python and python{2,3} exist exists, so this could change the version of python used to run the test suite. The checking for ${NOTMUCH_PYTHON} in the test suite is arguably over-engineering, since the configure step will fail if it can't find it.
2015-06-14test: add initial ruby testsDavid Bremner
This is pretty much a line by line translation of the existing python tests, with two new tests for the count API.
2015-06-12lib: reject relative paths in n_d_{create,open}_verboseDavid Bremner
There are many places in the notmuch code where the path is assumed to be absolute. If someone (TM) wants a project, one could remove these assumptions. In the mean time, prevent users from shooting themselves in the foot. Update test suite mark tests for this error as no longer broken, and also convert some tests that used relative paths for nonexistent directories.
2015-06-12lib: add NOTMUCH_STATUS_PATH_ERRORDavid Bremner
The difference with FILE_ERROR is that this is for things that are wrong with the path before looking at the disk. Add some 3 tests; two broken as a reminder to actually use this new code.
2015-06-08test: redirect man output to /dev/nullDavid Bremner
In the case the these tests fail, they generate a bunch of output; this output is not very interesting because it is just the successful output of a man page. It does however make it hard to see what tests are actually failing, even with NOTMUCH_TEST_QUIET
2015-06-08test: make python tests compatible with python3David Bremner
Making the test suite actually run them with python3 is left for future work.
2015-06-02Merge branch 'release'David Bremner
20.1 plus NEWS fixup
2015-06-01cli: add standard option processing to config, help and setupDavid Bremner
In particular this fixes a recently encountered bug where the "--config" argument to "notmuch setup" is silently ignored, which the unpleasant consequence of overwriting the users config file.
2015-05-31cli: change "setup" to "set up" where used as a verbJ. Lewis Muir
The word "setup" is a noun, not a verb. Change occurrences of "setup" where used as a verb to "set up".
2015-05-31test: remove redundant 'file' command from gdb scripts.David Bremner
Quoting Debian bug 787341 It failed to build on arm64: the last ten tests in T070-insert failed. What's happening here is that GDB is segfaulting in response to the "file" command. GDB on arm64 can be a bit buggy. However, the "file" command is redundant here as GDB has already got the file from the --args on the command line.
2015-04-08test: move nonexistent directory to something under notmuch's control.David Bremner
Apparently some systems actually have a directory called /nonexist[ae]nt. It's hard to fathom a good reason for that, but oh well. As long as we don't create such a directory inside the notmuch source tree, the new version should be more robust.
2015-04-08test: be consistent about spelling `nonexistent'David Bremner
Apparently most of the misspellings are my fault.
2015-04-03test/thread-order: more robust loop exit in case of broken inputTomi Ollila
When creating $THREADS data it may end of not having 'None' at all or the numbers in line output yields a loop. To avoid loop the value in current array index is set to 'None' so that if the same item is reached again the loop will end. Also empty string as next array index will end the loop.
2015-03-29test: make one error output test more robust.David Bremner
Since notmuch_database_status_string can return NULL, passing it directly to fputs is not a good idea.
2015-03-29test: add more error reporting testsDavid Bremner
This second half of the error reporting tests actually uses the function notmuch_database_status_string to retrieve the last logged error
2015-03-29lib: replace almost all fprintfs in library with _n_d_logDavid Bremner
This is not supposed to change any functionality from an end user point of view. Note that it will eliminate some output to stderr. The query debugging output is left as is; it doesn't really fit with the current primitive logging model. The remaining "bad" fprintf will need an internal API change.
2015-03-29lib: add "verbose" versions of notmuch_database_{open,create}David Bremner
The compatibility wrapper ensures that clients calling notmuch_database_open will receive consistent output for now. The changes to notmuch-{new,search} and test/symbol-test are just to make the test suite pass. The use of IGNORE_RESULT is justified by two things. 1) I don't know what else to do. 2) asprintf guarantees the output string is NULL if an error occurs, so at least we are not passing garbage back.
2015-03-29test: add error reporting testsDavid Bremner
This first half of the tests is all that don't need to retrieve the the error string explicitly from the notmuch database structure.
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.
2015-03-15test: Add two tests for error output from notmuch_database_openDavid Bremner
This is arguably testing the same thing twice, but in the brave new future where we don't use printf anymore, each subcommand will be responsible for handling the output on it's own.
2015-03-11CLI: make gpg binary used by libgmime configurable.David Bremner
Previously we set up a way for the top level notmuch command to choose which gpg binary was invoked by libgmime. In this commit we add the (mostly boilerplate) code to allow the notmuch-config command to read and write this path, and use it in the appropriate struct. Update tests for new default variable
2015-03-07parse-time-string: fix setting and rounding of secondsJani Nikula
If seconds are not specified in the string to be parsed, they're not set according to the reference time (in the no rounding case) nor rounded properly (in the rounding up cases). Fix this. The bug caused searches such as date:10:30..10:30 to match messages with date exactly 10:30:00 only, and not in range 10:30:00..10:30:59 (inclusive) as documented. Note that date searches referring "noon" or "5pm" will still be interpreted as exact to the second.
2015-03-06test: extract and flag second rounding tests as brokenJani Nikula
Extract and add some more tests relating to rounding seconds into a separate subtest, and flag it as broken. If seconds are not specified, the time is not set or rounded according to the interface defined in parse-time-string/parse-time-string.h. Instead, seconds are always set to 00 in reality, which is broken.
2015-03-06test: add some more time testsJani Nikula
Ensure the seconds are set properly.
2015-03-06test: improve the time parsing testsJani Nikula
Set the reference time to 12:13:14 instead of 11:11:00 to ensure hours and minutes are not mixed up, and seconds are really set instead of defaulted to 00.
2015-01-24Add indexing for the mimetype termTodd
This adds the indexing support for the "mimetype:" term and removes the broken test flag. The indexing is probablistic in Xapian terms, which gives a better experience to end users. Standard content-types of the form "foo/bar" are automatically interpreted as phrases in Xapian due to the embedded slash. Assume, separate messages with application/pdf and application/x-pdf are indexed, then: - mimetype:application/x-pdf will find only the application/x-pdf - mimetype:application/pdf will find only the application/pdf - mimetype:pdf will find both of the messages
2015-01-24test: Add failing unit tests for indexed mime typesTodd
Adds three failing unit tests for searching of mime-types. An attempt was made at adding a negative test (i.e. searching for a non-existent mime-type and ensuring it didn't return a message), but that test would always pass making it pointless.
2015-01-19test: prepare test-lib.sh for possible test system debug sessionTomi Ollila
When something in tests fails one possibility to test is to run the test script as `bash -x TXXX-testname.sh`. As stderr (fd 2) was redirected to separate file during test execution also this set -x (xtrace) output would also go there. test-lib.sh saves the stderr to fd 7 from where it can be restored, and bash has BASH_XTRACEFD variable, which is now given the same value 7, making bash to output all xtrade information (consistently) there. This lib file used to save fd's 1 & 2 to 6 & 7 (respectively) in test_begin_subtest(), but as those needs to be set *before* XTRACEFD variable is set those are now saved at the beginning of the lib (once). This is safe and simple thing to do. To make xtrace output more verbose PS4 variable was set to contain the source file, line number and if execution is in function, that function name. Setting this variable has no effect when not xtracing. As it is known that fd 6 is redirected stdout, printing status can now use that fd, instead of saving stdout to fd 5 and use it.
2015-01-17thread-naming test: Test empty subject names.Jesse Rosenthal
We test all empty subjects, and then empty subjects followed by non-empty subjects (searching both oldest- and newest-first).
2015-01-17test-lib: Add dummy subject to force empty subjectJesse Rosenthal
At the moment, the test-lib fills in any missing headers. This makes it impossible to test our handling of empty subjects. This will allow us to use a special dummy subject -- `@FORCE_EMPTY` -- to force the subject to remain empty.