aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
Commit message (Collapse)AuthorAge
* test: add test for `notmuch-hello-refresh-hook'Gravatar Dmitry Kurochkin2011-12-22
| | | | | | | | 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'.
* test: add general Emacs hook counterGravatar Dmitry Kurochkin2011-12-22
| | | | | Replace `notmuch-hello-mode-hook-counter' with general `hook-counter' and `add-hook-counter' functions to allow counting calls for any hook.
* emacs: do not call `notmuch-hello-mode' on updateGravatar Dmitry Kurochkin2011-12-20
| | | | | | | | | | | `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.
* test: add broken test for `notmuch-hello-mode-hook' called during updateGravatar Dmitry Kurochkin2011-12-20
| | | | | Test that `notmuch-hello-mode-hook' is not called during `notmuch-hello' buffer updates. The test is currently broken.
* test: add test for `notmuch-hello-mode-hook'Gravatar Dmitry Kurochkin2011-12-20
| | | | | Test that `notmuch-hello-mode-hook' is called once when `notmuch-hello' function is called.
* test: add `notmuch-hello-mode-hook-counter'Gravatar Dmitry Kurochkin2011-12-20
| | | | | | | 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.
* test: optionally print subtest numberGravatar David Bremner2011-12-18
| | | | | | | 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
* Fix build with binutils-2.22Gravatar Thomas Jost2011-12-17
| | | | | | | | | | | | | | | | | | | 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.
* Revert "test: add emacs test for hiding a message following an HTML part"Gravatar David Bremner2011-12-15
| | | | | | | | | | | 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
* test: add arg-test to .gitignoreGravatar David Bremner2011-12-12
| | | | This should have been done when the binary was added, oops.
* test: add tests for hooksGravatar Jani Nikula2011-12-11
| | | | Signed-off-by: Jani Nikula <jani@nikula.org>
* test: use python2 instead of python if availableGravatar Thomas Jost2011-12-11
| | | | | | 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.
* test: add a function to run Python testsGravatar Thomas Jost2011-12-11
| | | | | | | | | | | | | 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.
* test: cleanup gdb external dependency in atomicity testsGravatar Dmitry Kurochkin2011-12-11
| | | | | Change atomicity tests to use the new external binary dependencies. This simplifies the code and makes output consistent.
* test: tests for command-line-arguments.cGravatar David Bremner2011-12-08
| | | | | This was needed because no current notmuch code exercises the NOTMUCH_OPT_STRING style arguments.
* test: date_relative in notmuch search json outputGravatar pazz2011-12-07
| | | | | | | | 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.
* emacs: do not call notmuch show for non-inlinable partsGravatar Dmitry Kurochkin2011-12-07
| | | | | | | | | | | | | | 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.
* test: check that Emacs UI does not call notmuch for non-inlinable partsGravatar Dmitry Kurochkin2011-12-07
| | | | | | | | | | 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.
* test: add functions to count how much times notmuch was calledGravatar Dmitry Kurochkin2011-12-07
| | | | | | | | | | | | | | | | 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.
* test/symbol-hiding: compare exported symbols with existing oneGravatar David Bremner2011-12-07
| | | | | We assume that any symbol starting with notmuch_ in lib/*.o should be exported, and that only those symbols should be exported.
* test/symbol-hiding: add some whitespace between testsGravatar David Bremner2011-12-07
| | | | This is in preparation for adding a third test to this file
* Merge branch 'release'Gravatar David Bremner2011-12-06
|\ | | | | | | | | | | | | Conflicts: NEWS Conflicts resolved by inserting the 0.10.2 stanza before 0.11
* | test: add test-binaries targetGravatar David Bremner2011-12-06
| | | | | | | | | | The goal here is to have a simple way of making sure all of the binaries needed to run tests are available.
| * test/python: set LD_LIBRARY_PATH and PYTHONPATH to use local notmuchGravatar David Bremner2011-12-05
| | | | | | | | | | Possibly this should be factored out into some kind of "run_python" function.
| * test: add tests for python bindingsGravatar David Bremner2011-12-05
| | | | | | | | | | | | 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.
* | test: fix error messages for missing binary dependenciesGravatar Dmitry Kurochkin2011-11-30
| | | | | | | | | | | | | | 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.
* | test: fix spurious output from missing external binaries functionsGravatar Dmitry Kurochkin2011-11-30
| | | | | | | | | | The grep(1) command used in the fake binary functions was missing the quiet option.
* | test: add missing escape backslash in test_declare_external_prereq()Gravatar Dmitry Kurochkin2011-11-30
| |
* | test: fix test_require_external_prereq()Gravatar Dmitry Kurochkin2011-11-30
| | | | | | | | | | | | 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.
* | test: fix "Stashing in notmuch-search" test when emacs is not availableGravatar Dmitry Kurochkin2011-11-27
| | | | | | | | | | | | 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.
* | test: check if emacs is available in the beginning of test_emacsGravatar Dmitry Kurochkin2011-11-27
| | | | | | | | Unfortunately, this is needed to avoid the emacs waiting loop.
* | test: add function to explicitly check for external dependenciesGravatar Dmitry Kurochkin2011-11-27
| | | | | | | | Useful when binary is called indirectly (e.g. from emacs).
* | test: declare external dependencies for the testsGravatar Dmitry Kurochkin2011-11-27
| | | | | | | | That are: dtach(1), emacs(1), emacsclient(1), gdb(1) and gpg(1).
* | test: skip all subtests if external dependencies are missing during initGravatar Dmitry Kurochkin2011-11-27
| | | | | | | | | | | | | | | | | | | | 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.
* | test: fix "skipping test" verbose outputGravatar Dmitry Kurochkin2011-11-27
| |
* | test: add support for external executable dependenciesGravatar Dmitry Kurochkin2011-11-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | test: add test state reset to test_expect_* functions that did not have itGravatar Dmitry Kurochkin2011-11-27
| |
* | test: set EMACS_SERVER variable only after dtach(1) was successfully startedGravatar Dmitry Kurochkin2011-11-27
| | | | | | | | | | 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.
* | test: move subtest variables reset into a dedicated functionGravatar Dmitry Kurochkin2011-11-27
| | | | | | | | | | Currently, there is only one such variable test_subtest_known_broken_. But more will be added in the future.
* | Build symbol-test with make instead of hardcoding in symbol-hiding.Gravatar Amadeusz Żołnowski2011-11-27
| | | | | | | | | | | | 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.
* | Merge branch 'release'Gravatar David Bremner2011-11-26
|\|
* | build system: clean up object files in ./test and ./utilGravatar David Bremner2011-11-26
| |
* | Whitespaces cleanup.Gravatar Amadeusz Żołnowski2011-11-26
| |
* | Fix warnings for test/symbol-test.cc.Gravatar Amadeusz Żołnowski2011-11-26
| |
* | test: cleanup basic testsGravatar Dmitry Kurochkin2011-11-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | test: fix sed error in basic testsGravatar Dmitry Kurochkin2011-11-26
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | test: remove executable permissions from test-lib.shGravatar Dmitry Kurochkin2011-11-26
| | | | | | | | It is not supposed to be run, only sourced.
* | emacs: test notmuch show with fourfold message indentationGravatar Gregor Zattler2011-11-25
| | | | | | | | | | | | | | 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.
* | emacs: test: notmuch show without indentationGravatar Gregor Zattler2011-11-25
| | | | | | | | | | | | | | | | | | 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.
* | emacs: test notmuch-indent-messages-width defaultGravatar Gregor Zattler2011-11-25
| | | | | | | | | | | | | | | | Previous behaviour was to indent messages in a thread according to depth by one space per level. This is still the case with notmuch-indent-messages-width default value `1'. This test succeeds if output with default value is same as in "Basic notmuch-show view in emacs".