summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2012-01-05emacs: fix notmuch-show-indent-messages-width customization variable nameJameson Graef Rollins
The name was originally notmuch-indent-messages-width, which is inconsistent with our variable naming convention.
2011-12-22test: add test for `notmuch-hello-refresh-hook'Dmitry Kurochkin
Test that `notmuch-hello-refresh-hook' is called once when `notmuch-hello' is called and twice when calling `notmuch-hello-update' after that. The tests are very similar to tests for `notmuch-hello-mode-hook'.
2011-12-22test: add general Emacs hook counterDmitry Kurochkin
Replace `notmuch-hello-mode-hook-counter' with general `hook-counter' and `add-hook-counter' functions to allow counting calls for any hook.
2011-12-20emacs: do not call `notmuch-hello-mode' on updateDmitry Kurochkin
`notmuch-hello' should call `notmuch-hello-mode' function only when run for the first time. But before the change, `notmuch-hello' used `kill-all-local-variables' to remove editable widgets fields. This caused the major mode to be reset, and `notmuch-hello-mode' to be called every time. The patch manually deletes all editable widget fields and removes `kill-all-local-variables' call.
2011-12-20test: add broken test for `notmuch-hello-mode-hook' called during updateDmitry Kurochkin
Test that `notmuch-hello-mode-hook' is not called during `notmuch-hello' buffer updates. The test is currently broken.
2011-12-20test: add test for `notmuch-hello-mode-hook'Dmitry Kurochkin
Test that `notmuch-hello-mode-hook' is called once when `notmuch-hello' function is called.
2011-12-20test: add `notmuch-hello-mode-hook-counter'Dmitry Kurochkin
Add `notmuch-hello-mode-hook-counter' hook to count how many times `notmuch-hello-mode-hook' was called. The counter function increments `notmuch-hello-mode-hook-counter' variable value if it is bount, otherwise it does nothing.
2011-12-18test: optionally print subtest numberDavid Bremner
The idea is that $test_count could be used in tests to label intermediate files. The output enabled by this patch (and --debug) helps figure out which OUTPUT.nn file belongs to which test in case several subtests write to OUTPUT.$test_count
2011-12-17Fix build with binutils-2.22Thomas Jost
binutils-2.22 changes the behaviour of ld by defaulting to --no-copy-dt-needed-entries, which means that required objects/libs are not "indirectly" linked through intermediate objects/libs anymore. As a consequence, when using binutils-2.22, building symbol-test fails with the following error: /usr/bin/ld: test/symbol-test.o: undefined reference to symbol 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()@@GLIBCXX_3.4' /usr/bin/ld: note: 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()@@GLIBCXX_3.4' is defined in DSO /usr/lib/libstdc++.so.6 so try adding it to the linker command line /usr/lib/libstdc++.so.6: could not read symbols: Invalid operation An easy fix is to link using CXX instead of CC.
2011-12-15Revert "test: add emacs test for hiding a message following an HTML part"David Bremner
This reverts commit c6a3a768fef9f59f483af04f4418d350efc27968. This test is unreliable, showing BROKEN in some environments and FIXED in others. The confusion seems to outweigh the benefits, for now. Conflicts: test/emacs
2011-12-12test: add arg-test to .gitignoreDavid Bremner
This should have been done when the binary was added, oops.
2011-12-11test: add tests for hooksJani Nikula
Signed-off-by: Jani Nikula <jani@nikula.org>
2011-12-11test: use python2 instead of python if availableThomas Jost
Some distros (Arch Linux) ship Python as python2 and Python 3 as python. Checking for python2 is necessary for the Python tests to work on these platforms.
2011-12-11test: add a function to run Python testsThomas Jost
The new test_python() function makes writing Python tests a little easier: - it sets the environment variables as needed - it redirects stdout to the OUTPUT file (like test_emacs()). This commit also declares python as an external prereq. The stdout redirection is required to avoid trouble when running commands like "python 'script' | sort > OUTPUT": in such a case, any error due to a missing external prereq would be "swallowed" by sort, resulting to a failed test instead of a skipped one.
2011-12-11test: cleanup gdb external dependency in atomicity testsDmitry Kurochkin
Change atomicity tests to use the new external binary dependencies. This simplifies the code and makes output consistent.
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-07test: date_relative in notmuch search json outputpazz
expect the date_relative field for thread entries in notmuch search's json output note from Commiter: we don't have to worry about the date changing because the date in question is more than 180 days old.
2011-12-07emacs: do not call notmuch show for non-inlinable partsDmitry Kurochkin
Before the change, there was a workaround to avoid notmuch show calls for parts with application/* Content-Type. But non-inlinable parts are not limited to this Content-Type (e.g. mp3 files have audio/mpeg Content-Type and are not inlinable). For such parts `notmuch-show-insert-part-*/*' handler is called which unconditionally fetches contents for all parts. The patch moves content fetching from `notmuch-show-insert-part-*/*' to `notmuch-show-mm-display-part-inline' function after MIME inlinable checks are done to avoid useless notmuch show calls. The application/* hack is no longer needed and removed.
2011-12-07test: check that Emacs UI does not call notmuch for non-inlinable partsDmitry Kurochkin
The patch adds two new test cases: * Do not call notmuch for non-inlinable application/mpeg parts * Do not call notmuch for non-inlinable audio/mpeg parts The application/mpeg test passes thanks to a workaround for application/* Content-Types. The audio/mpeg is currently broken.
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-07test/symbol-hiding: compare exported symbols with existing oneDavid Bremner
We assume that any symbol starting with notmuch_ in lib/*.o should be exported, and that only those symbols should be exported.
2011-12-07test/symbol-hiding: add some whitespace between testsDavid Bremner
This is in preparation for adding a third test to this file
2011-12-06Merge branch 'release'David Bremner
Conflicts: NEWS Conflicts resolved by inserting the 0.10.2 stanza before 0.11
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-12-05test/python: set LD_LIBRARY_PATH and PYTHONPATH to use local notmuchdebian/0.10.2-10.10.2David Bremner
Possibly this should be factored out into some kind of "run_python" function.
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-30test: fix error messages for missing binary dependenciesDmitry Kurochkin
The fake missing binary functions check if the binary has already be added to the diagnostic message to avoid duplicates. Unfortunately, this check was buggy because the message string does not have the trailing space.
2011-11-30test: fix spurious output from missing external binaries functionsDmitry Kurochkin
The grep(1) command used in the fake binary functions was missing the quiet option.
2011-11-30test: add missing escape backslash in test_declare_external_prereq()Dmitry Kurochkin
2011-11-30test: fix test_require_external_prereq()Dmitry Kurochkin
test_missing_external_prereq_${binary}_ variable indicates that the binary is missing. It must be set in test_declare_external_prereq() outside of the fake $binary() function.
2011-11-27test: fix "Stashing in notmuch-search" test when emacs is not availableDmitry Kurochkin
If emacs is not available, test_expect_equal would be called with only one argument. The patch fixes this by quoting the (possibly empty) $(cat OUTPUT) argument.
2011-11-27test: check if emacs is available in the beginning of test_emacsDmitry Kurochkin
Unfortunately, this is needed to avoid the emacs waiting loop.
2011-11-27test: add function to explicitly check for external dependenciesDmitry Kurochkin
Useful when binary is called indirectly (e.g. from emacs).
2011-11-27test: declare external dependencies for the testsDmitry Kurochkin
That are: dtach(1), emacs(1), emacsclient(1), gdb(1) and gpg(1).
2011-11-27test: skip all subtests if external dependencies are missing during initDmitry Kurochkin
Some tests (e.g. crypto) do a common initialization required for all subtests. The patch adds a check for missing external dependencies during this initialization. If any prerequisites are missing, all subtests are skipped. The check is run on the first call of test_reset_state_ function, so no changes for the tests are needed.
2011-11-27test: fix "skipping test" verbose outputDmitry Kurochkin
2011-11-27test: add support for external executable dependenciesDmitry Kurochkin
There is existing support for general prerequisites in the test suite. But it is not very convenient to use: every test case has to keep track for it's dependencies and they have to be explicitly listed. The patch aims to add better support for a particular type of external dependencies: external executables. The main idea is to replace missing external binaries with shell functions that have the same name. These functions always fail and keep track of missing dependencies for a subtest. The result reporting functions later can check that an external binaries are missing and correctly report SKIP result instead of FAIL. The primary benefit is that the test cases do not need to declare their dependencies or be changed in any way.
2011-11-27test: add test state reset to test_expect_* functions that did not have itDmitry Kurochkin
2011-11-27test: set EMACS_SERVER variable only after dtach(1) was successfully startedDmitry Kurochkin
Otherwise, we can set the EMACS_SERVER and return with an error. And subsequent calls to test_emacs would assume that emacs server is running.
2011-11-27test: move subtest variables reset into a dedicated functionDmitry Kurochkin
Currently, there is only one such variable test_subtest_known_broken_. But more will be added in the future.
2011-11-27Build symbol-test with make instead of hardcoding in symbol-hiding.Amadeusz Żołnowski
If symbol-test is built in symbol-hiding with hardcoded g++ invokation, it's not so easy to pass $(srcdir) which is required to find notmuch.h when srcdir and builddir are separate directories.
2011-11-26Merge branch 'release'David Bremner
2011-11-26build system: clean up object files in ./test and ./utilDavid Bremner
2011-11-26Whitespaces cleanup.Amadeusz Żołnowski
2011-11-26Fix warnings for test/symbol-test.cc.Amadeusz Żołnowski
2011-11-26test: cleanup basic testsDmitry Kurochkin
Basic test 'Ensure that all available tests will be run by notmuch-test' compares all tests that are run with listing of test/ directory. There is a growing list of exceptions for files and directories which located in the test/ directory but are not tests. Moreover some (probably buggy) tests do create files in the the test/ directory which may be left behind in case of failure. This makes the basic test fail. The patch changes the test to look only for regular executable files. This makes the exception list much smaller. And since no tests should create executables in the test/ directory (if there are, they should be fixed), the basic test should not be affected by failed or interrupted tests.
2011-11-26test: fix sed error in basic testsDmitry Kurochkin
The error is easy to miss, because the test passes and stderr is not printed. But if you run basic tests in verbose mode (./basic --verbose), you get: sed: can't read notmuch-test: No such file or directory The issue is that sed command is given two files: notmuch-test and $TEST_DIRECTORY/notmuch-test. And there is no notmuch-test file in the current directory (test/tmp.basic/). The patch just removes the non-existing file from the sed command.
2011-11-26test: remove executable permissions from test-lib.shDmitry Kurochkin
It is not supposed to be run, only sourced.
2011-11-25emacs: test notmuch show with fourfold message indentationGregor Zattler
Previous behaviour was to indent messages in a thread according to depth by one space per level. This commit tests if setting notmuch-indent-messages-width to `4' provides a message thread with four spaces of indentation thread depth.
2011-11-25emacs: test: notmuch show without indentationGregor Zattler
Previous behaviour was to indent messages in a thread according to depth by one space per level. In id:1311028119-50637-1-git-send-email-fgeller@gmail.com Felix Geller proposed a patch in order to turn indentation off. This commit tests if instead setting notmuch-indent-messages-width to `0' does turn off indentation.