summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
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.
2015-01-01lib: drop the deprecation message for single-message mbox filesJani Nikula
We generally do not support mbox files, but for historical reasons we've supported single-message mbox files, with a deprecation message. We've tried dropping the support altogether, but backed out of it because we'd need to stop indexing them, while keeping support for previously indexed files. This would be more complicated than simply supporting single-message mbox files. Therefore, drop the deprecation message, and just silently accept single-message mboxes.
2014-12-07lib: Use email address instead of empty real name.Jesse Rosenthal
Currently, if a From-header is of the form: "" <address@example.com> the empty string will be treated as a valid real-name, and the entry in the search results will be empty. The new behavior here is that we treat an empty real-name field as if it were null, so that the email address will be used in the search results instead. Signed-off-by: Jesse Rosenthal <jrosenthal@jhu.edu>
2014-12-07test: Add known-broken test for empty author nameJesse Rosenthal
We test for whether a quoted empty email address "" <address@example.com> will show up as the address, instead of the empty string. This is marked as known-broken, since the current behavior is to use the empty string. This is a new test file, since handling of unusual email addresses doesn't seem to fit well in any of our existing tests. Signed-off-by: Jesse Rosenthal <jrosenthal@jhu.edu>
2014-11-09cli: notmuch address option defaults updateTomi Ollila
When no --output option were given, change default to display senders only. When only --count option is given, display senders (in contrary to not displaying anything). Document that --count with --sort=**order** is not supported option combination. Clean up some whitespace in the documentation. One test updated to have --output=count without sender nor recipient output option.
2014-11-05cli: address: Add --output=countMichal Sojka
This output prints how many times was each address encountered during search.
2014-11-05cli: address: Do not output duplicate addressesMichal Sojka
This filters out duplicate addresses from address command output. It also also adds tests for the address command. The code here is an extended version of a patch from Jani Nikula.
2014-11-02test: Make gen-threads work with python3Jesse Rosenthal
python3 doesn't allow dictionaries to be initialized with non-string keywords. This presents problems on systems in which "python" means "python3". We instead initalize the dictionary using the dict comprehension and then update it with the values from the tree. This will work with both python2 and python3.
2014-11-02test: add tests for --output=messages --duplicate=NJani Nikula
Basic smoke tests for the feature, nothing fancy.
2014-11-01cli: Add support for parsing keyword-flag argumentsJani Nikula
This allows having multiple --foo=bar --foo=baz options on the command line, with the corresponding values OR'd together. [Test added by Michal Sojka]
2014-10-31test: use LDFLAGS in test/Makefile.localJani Nikula
Apparently the test binaries are built with minimal LDFLAGS, only adding dependency specific LDFLAGS as needed. However because some of the test binaries incorporate notmuch object files, it is necessary to use the same link flags as notmuch. For example user provided CFLAGS/CXXFLAGS/LDFLAGS with -fsanitize=undefined fails to build the test binaries if the flags differ.
2014-10-28test: add simple tests for post-insert hookDavid Bremner
Most of the existing tests for pre/post-new hook don't seem to apply.
2014-10-25test: Test upgrade to ghost messages featureAustin Clements
2014-10-25lib: Enable ghost messages featureAustin Clements
This fixes the broken thread order test.
2014-10-25Merge tag '0.18.2_rc1'David Bremner
notmuch 0.18.2~rc1 release Conflicts: NEWS debian/changelog
2014-10-25test: kill '"filename": "signature.asc"' from json outputDavid Bremner
This starts to appear with emacs24.4, so we can't easily have it in our expected output.
2014-10-25test/emacs: force *Messages* buffer to be writableDavid Bremner
In emacs 24.4 the messages buffer starts being read-only, which kills these tests. This seems to be the point of the variable inihibit-read-only, which has existed at least since emacs 21.
2014-10-25test: simplify T360-symbol-hiding, use nm instead of objdumpDavid Bremner
After yet another variation in objdump output caused this test to fail (on a Debian port, no less), I decided whatever putative benefit we get from looking at the object files instead of the library isn't worth the maintenence headache. This version uses nm -P. nm -P should be portable, and fixed format. It purposely doesn't use the -D argument, since that is non-POSIX and nm on GNU/Linux seems do the right thing without it. It still won't work out of the box on e.g. Mac OS/X. I think the right thing to do there is to move some more configuration information into sh.config. (cherry picked from commit c34d6bad0f9da300eac2181e2073aee130432932)
2014-10-25test: Port atomicity test to PythonAustin Clements
Previously, this was implemented using a horrible GDB script (because there is no such thing as a non-horrible GDB script). This GDB script often broke with newer versions of GDB for mysterious reasons. Port the test script to GDB's Python API, which makes the code much cleaner and, hopefully, more stable. (cherry picked from commit cbbda62258360f035894cff9dfd66c60b0cc707f) Conflicts: test/T380-atomicity.sh
2014-10-18test: check for gdb in insert testsDavid Bremner
Commits a6cee01 and c48b12f otherwise break the build for people without gdb.
2014-10-18test/insert: check that indexing errors are accepted with --keepDavid Bremner
This is overkill for the current code path, but should provide some robustness for future changes in error handling.
2014-10-18cli/insert: require succesful message indexing for success statusJani Nikula
Add --keep option to keep any remaining stuff in index or file. We could distinguish between failures to index and failures to apply tags or maildir sync, but for simplicity just have one.
2014-10-18test/insert: add known broken tests for indexing failuresDavid Bremner
These tests are written with the assumption that we want all indexing failures to be considered as failures by notmuch insert.
2014-10-05test: Port atomicity test to PythonAustin Clements
Previously, this was implemented using a horrible GDB script (because there is no such thing as a non-horrible GDB script). This GDB script often broke with newer versions of GDB for mysterious reasons. Port the test script to GDB's Python API, which makes the code much cleaner and, hopefully, more stable.
2014-10-05configure: add debug flags by default.David Bremner
This makes development (in particular the test suite) easier. Those concerned about the extra diskspace can override the default or use strip.
2014-10-05test: check for debug symbols in notmuchDavid Bremner
In the future, tests may rely on debug symbols being present in notmuch, so we plan to switch the default flags. The main purpose of this test is to help explain the perhaps mysterious failures of other tests which rely on symbols being present.
2014-09-21emacs: Fix coding system in `notmuch-show-view-raw-message'Austin Clements
This fixes the known-broken test of viewing 8bit messages added by the previous commit.
2014-09-21test: New tests for Emacs charset handlingAustin Clements
The test of viewing 8bit messages is known-broken. The rest pass, but for very fragile reasons. The next several commits will fix the known-broken test and make our charset handling robust.
2014-09-21test/emacs: globally force the html renderer to html2textDavid Bremner
Previously we did this for a single test, but some other proposed tests ( id:1398105468-14317-3-git-send-email-amdragon@mit.edu ) show similar breakage when switching renderers.
2014-09-13test: simplify T360-symbol-hiding, use nm instead of objdumpDavid Bremner
After yet another variation in objdump output caused this test to fail (on a Debian port, no less), I decided whatever putative benefit we get from looking at the object files instead of the library isn't worth the maintenence headache. This version uses nm -P. nm -P should be portable, and fixed format. It purposely doesn't use the -D argument, since that is non-POSIX and nm on GNU/Linux seems do the right thing without it. It still won't work out of the box on e.g. Mac OS/X. I think the right thing to do there is to move some more configuration information into sh.config.
2014-09-07cli: Be more helpful when .notmuch-config does not existAustin Clements
Previously, if the user ran any subcommand that required a configuration (e.g., notmuch new) but didn't have a configuration, notmuch would give the rather un-friendly and un-actionable message Error reading configuration file .notmuch-config: No such file or directory Since this condition is expected for new users, this patch adds specific handling for the file-not-found case to give a message that is friendly and actionable.