Commit graph

13 commits

Author SHA1 Message Date
David Bremner
903fe63986 notmuch-restore: check for extra arguments.
We consider it an error to pass more than one file to restore, since
extra ones are ignored.
2011-10-23 10:27:57 -03:00
David Bremner
a77d9adcac notmuch-restore: implement --accumulate option
Modify command line argument handling to take a --accumulate flag.
Test for extra arguments beyond the input file.

The --accumulate switch causes the union of the existing and new tags to be
applied, instead of replacing each message's tags as they are read in from the
dump file.

Based on a patch by Thomas Schwinge:

      id:"1317317857-29636-1-git-send-email-thomas@schwinge.name"
2011-10-23 10:27:57 -03:00
David Bremner
42c80dfd07 test/dump-restore: add tests for restore --accumulate
Flesh out what ``notmuch restore --accumulate'' is supposed to do.
Its tests are currently XFAILed; the functionality will be added in
future patch(es).

Based on a patch by Thomas Schwinge:

      id:"1317317811-29540-1-git-send-email-thomas@schwinge.name"
2011-10-23 10:27:57 -03:00
David Bremner
8a65353b4f test/dump-restore: Fix quoting on grep
Thanks to Thomas Schwinge for noticing yet another place where quoting
matters. Since the shell translates \. to ., the regex passed to grep
is too generous without the quotes.

The use of [.] is the suggestion of Tomi Ollila.
2011-10-23 10:27:57 -03:00
David Bremner
c457951344 test/dump-restore: expand test suite for dump-restore, make more robust
Several new tests are added, and existing use of test_begin_subtest is
replaced by test_expect_success to catch failing commands in cases where
we execute more than one command.

Based on changes in

      id:"1317317811-29540-1-git-send-email-thomas@schwinge.name"
2011-10-22 19:43:02 -03:00
David Bremner
53b397acfc notmuch-dump: deprecate use of output file argument.
We print an intentionally non-specific message on stderr, since it
isn't clear if there will be some global output file argument to
replace.

We update the test suite atomically, since it relies on having the
same text in two files.
2011-10-16 19:59:53 -03:00
David Bremner
09beff1def notmuch-dump: treat any remaining arguments after the filename as search terms
The main motivation here is allow the fast dumping of tag data for
messages having certain tags.  In practice it seems too slow to pipe
dump to grep.

All dump-restore tests should be working now, so we update test/dump-restore
accordingly
2011-10-16 19:59:53 -03:00
David Bremner
532829d463 test: add tests for command line arguments to notmuch-dump
The plan is to add the possibility of search terms after the file name,
and the use of -- to stop looking for an output file name.
2011-10-16 19:59:53 -03:00
David Bremner
adb1dc6792 test: update dump-restore to use redirection instead of filename args
The idea here is that we want to deprecate the use of arguments to
dump and restore to specify paths, since in particular we want to use
the non-option arguments to dump to form a query.
2011-10-12 18:01:12 -03:00
Joel Borggrén-Franck
3fa843216c test: change "#!/bin/bash" to "#!/usr/bin/env bash" enhances portability
Change #!/bin/bash at start of tests to "#!/usr/bin/env bash". That way
systems running on bash < 4 can prepend bash >= 4 to path before
running the tests.
2011-05-27 14:03:28 -07:00
Carl Worth
5497b01c27 test: Fix the search and dump-restore tests to operator on non-empty mail store.
We do this with a new add_email_corpus function that establishes a
mail store with 50 messages from the notmuch mailing list.
2010-09-20 16:40:35 -07:00
Carl Worth
ba9f9efc9a test: Remove useless NOTMUCH variable (in favor of simply "notmuch")
When the NOTMUCH variable was originally invented it was used as an
explicit path to the notmuch binary being tested. Today, the test
suite sets the PATH variable instead, so the NOTMUCH variable always
has a value of simply "notmuch".

We simplifying that by using the constant value rather than the
continual variable reference.
2010-09-20 16:15:08 -07:00
Carl Worth
7263aa9ec3 test: Rename all tests to get rid of the ugly numbers in file names.
The numbers were meaningless, and they made it hard to find a file of interest.

Instead, we get the ordering we want by adding an explicit list of
tests to run to the notmuch-test script.
2010-09-17 16:01:42 -07:00
Renamed from test/t0006-dump-restore.sh (Browse further)