Commit graph

11 commits

Author SHA1 Message Date
Tomi Ollila
a755c9d6a9 test: renamed test scripts to format T\d\d\d-name.sh
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.
2014-01-13 14:16:46 -04:00
Austin Clements
7eaf698e23 test: Remove extraneous Emacs error handling test
We now check error handling more carefully in the last test in
test/emacs and we're about to add more error handling tests.  (This
was also a strange place for this test, since it had nothing to do
with large search buffers.)
2013-06-01 08:53:19 -03:00
Austin Clements
19e5b2d912 emacs: Use unified error handling in search
This slightly changes the output of an existing test since we now
report non-zero exits with a pop-up buffer instead of at the end of
the search results.
2012-12-16 17:17:41 -04:00
Tomi Ollila
3bd8494da0 test: always source test-lib.sh as ./test-lib.sh
There are currently 45 TESTS scripts. 36 of those load
test-lib.sh using '. ./test-lib.sh' and 9 '. test-lib.sh'.

In latter case test-lib.sh is first searched from directories
in PATH (posix) and then from current directory (bash feature).

Changed the 9 files to execute '. ./test-lib.sh'. The test-lib.sh
should never be loaded from directory in PATH.
2012-11-24 22:07:46 -04:00
Pieter Praet
80771e3c76 test/emacs-large-search-buffer: correct typo (EXPEXTED -> EXPECTED)
introduced in commit 3b24b396
2012-01-23 07:38:32 -04:00
Dmitry Kurochkin
3b24b396c4 test: save buffer content to file instead of printing it in Emacs tests
Before the change, the common Emacs test scheme was to print
buffer content to stdout and redirect it to a file or capture it
in a shell variable.  This does not work if we switch to using
emacsclient(1) for running the tests, because you can not print
to the stdout in this case. (Actually, you can print to stdout
from Emacs server, but you can not capture the output on
emacsclient(1)).

The patch introduces new Emacs test auxiliary functions:
`test-output' and `test-visible-output'.  These functions are
used to save buffer content to a file directly from Emacs.  For
most tests the changes are trivial, because Emacs stdout output
was redirected to a file anyway.  But some tests captured the
output in a shell variable and compare it with the expected
output using test_expect_equal.  These tests are changed to use
files and test_expect_equal_file instead.

Note: even if we do not switch Emacs tests to emacsclient(1), the
patch makes tests cleaner and is an improvement.
2011-06-28 15:06:47 -07:00
Dmitry Kurochkin
a0ebd5c5e4 test: use princ' instead of message' calls in emacs tests
The patch replaces all (message (buffer-string)) calls in emacs
tests with (princ (buffer-string)).  This avoids accidentally
interpreting '%' as format specifiers and makes code simpler
because we do not need to capture stderr.

Also, the patch works around an Emacs (23.3+1-1 on current Debian
Unstable) segfault in "Ensure that emacs doesn't drop results"
test.  Note: the segfault does not happen on every test run.
Though, it seems to be consistently reproducible if the test uses
300 messages instead of 30.  Hopefully, it is the crash described
in Emacs bug #8545 [1] which is already fixed.

[1] http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8545
2011-05-27 16:07:29 -07:00
Carl Worth
33cf04c6a5 Update some more recent tests to use /usr/bin/env to find bash
The recentl-applied patch had grown stale, so update the tests that had
been created since it was originally written.
2011-05-27 14:08:04 -07:00
Carl Worth
708c4f46ca emacs: Don't drop error messages from "notmuch search"
With the previous commit, unexpected output before or between search results
would be displayed. However, trailing junk from the "notmuch search" output
would still be silently swallowed.

The most common case for an error message from "notmuch search" would be
an invalid command-line, and in that case, there would be no search results
and the trailing error message would get swallowed.

We fix the process sentinel to check for leftover data and add it to the
final buffer. We also add a test case to ensure this works.
2011-03-10 16:53:46 -08:00
Carl Worth
44d3c57e2a emacs: Display any unexpected output from notmuch search
Rather than silently swallowing unexpected output, the emacs interface will now
display it. This will allow error messages to actually arrive at the emacs
interface (though not in an especially pretty way). This also allows for easier
investigation of the inadvertent swallowing of search results that span page
boundaries (as demonstrated by the recent added emacs-large-search-buffer test).

The page-boundary bug has been present since a commit from 2009-11-24:
93af7b5745

Many thanks to Thomas Schwinge for tracking that bug down and
contributing the test for it.
2011-03-10 15:18:40 -08:00
Carl Worth
4e414e2a5a Rename/rewrite the new emacs-forgetfulness test (to emacs-large-search-buffer)
The new name is more descriptive of the bug being tested. Also, the test
is rewritten slightly so that it's much more plain to see how the bug
manifests itself, (that messages are droped from the emacs result at
regular intervals). Primarily, this is by collapsing the large blobs
used to inflate the message subjects.
2011-03-10 13:22:04 -08:00