Commit Graph

171 Commits

Author SHA1 Message Date
Dirk-Jan C. Binnema bb5c36c658 tests: add some very basic CLD2_TEST
just to check if it works at all; no need to check cld2 at all.
2024-03-01 23:05:33 +02:00
Dirk-Jan C. Binnema 30b8238522 tests: move to tests/, make optional
While not recommended, sometimes it can be useful to disable building
the unit tests. This can be done now with
    meson -Dtests=disabled build
2024-01-06 18:35:22 +02:00
Dirk-Jan C. Binnema 146b80113f lib: move transaction handling to mu-xapian
Instead of handling transactions in the store, handle it in xapian-db.
Make the code a bit more natural / cleaner-out

Handle transaction automatically (with a batch-size) and add some RAII
Transaction object, which makes all database interaction transactable
for the duration. So, no more need for explicit parameters to
add_message while indexing.
2023-12-22 21:24:41 +02:00
Dirk-Jan C. Binnema de302e7609 lib/tests: add one more foo-bar regexp test 2023-10-29 17:16:05 +02:00
Dirk-Jan C. Binnema ee18c02762 maildir: improve unit tests
And get some more info from run_command.
2023-09-24 21:33:18 +03:00
Dirk-Jan C. Binnema 4a0eba8ddf improve unit tests 2023-09-24 20:21:57 +03:00
Dirk-Jan C. Binnema 2d20074b99 mu-move: add new move sub command
Add sub-command to move messages; add tests and docs.

Fixes #157
2023-09-24 17:29:08 +03:00
Dirk-Jan C. Binnema 1a3dc46866 lib: maildir/store: more tests 2023-09-23 09:28:45 +03:00
Dirk-Jan C. Binnema 5bda8c321b query: move phrasification to mu-query-parser
Do the "phrasification" for matching fields later during query parsing;
this allows for handling combination fields correctly.

Also match both the normal term and the "phrase term", so we catch more
cases. Update/extend unit tests.

This fixes the "kata-container" issue also for body test.

Fixes #2167.
2023-09-17 18:11:21 +03:00
Dirk-Jan C. Binnema 9dcbe1d96c lib: unit tests: improve / better coverage 2023-09-13 23:02:53 +03:00
Dirk-Jan C. Binnema 2f5602b938 unit tests: improve
and add a new one for the indexer
2023-09-12 21:38:57 +03:00
Dirk-Jan C. Binnema af9eb36ca0 unit-tests: modernize
Use TempDir, join_paths etc.
2023-09-11 23:51:37 +03:00
Dirk-Jan C. Binnema 53c7381929 lib: move index/ into main lib/
simplify things a bit
2023-09-10 08:55:25 +03:00
Dirk-Jan C. Binnema 3e5cec0d05 tests: update for new query parser / ngrams 2023-09-09 17:57:42 +03:00
Dirk-Jan C. Binnema a9bd6e69d3 lib: implement new query parser
Implement a new query parser; the results should be very similar to the
old one, but it adds an Sexp middle-representation, so users can see how
a query is interpreted.
2023-09-09 11:59:59 +03:00
Dirk-Jan C. Binnema 3f8381134e test: move test messages to testdata/ 2023-09-05 08:34:27 +03:00
Dirk-Jan C. Binnema 15f08488d3 remove Mu::format, use mu_format
Use the new fmt-based formatting.
2023-08-19 20:04:50 +03:00
Dirk-Jan C. Binnema 8caf504381 store: update "move" and some related APIs
Update test cases as well.
2023-08-17 22:42:25 +03:00
Dirk-Jan C. Binnema da290c21a9 benchmark: improve setup
Add some useful make targets, and separate (optimized) build.
2023-07-25 23:56:19 +03:00
Dirk-Jan C. Binnema 4c0b7db3d8 store: add 'add_document' optimization, use it
*Usually* we need Xapian's replace_document() API, but when we know a
document (message) is completely new, we can use the faster
add_document(). That is the case with the initial (re)indexing, when
start with an empty database.

Also a few smaller cleanups.
2023-07-25 23:56:19 +03:00
Dirk-Jan C. Binnema 6ad5cccc53 store/index: and unit test for circular symlink
Check that we bail out early
2023-07-18 23:18:21 +03:00
Dirk-Jan C. Binnema 4171fe14c3 store: removing trailing / for root_maildir
Other code depends on that.
2023-07-06 21:49:50 +03:00
Dirk-Jan C. Binnema 4920b56671 update to use fmt-based apis
Not complete, but a first big stab converting users of Mu::Error and
various g_warning & friends, format to the new libfmt-based APIs.
2023-07-05 23:10:13 +03:00
Dirk-Jan C. Binnema c6fff6a281 all: update for API changes (config etc.)
Use the new & improved APIs.
2023-07-02 00:06:56 +03:00
Dirk-Jan C. Binnema fd7c011195 lib: update for api changes, update tests
With the new Sexp. And expand unit tests.
2023-06-27 00:53:23 +03:00
Dirk-Jan C. Binnema abfa6f277c mu: index html text as if it were plain text
This is a bit of hack to include html text in results.

Of course, html text is not really plain text, so this is a bit of a
hack until we introduce some html parsing step.
2023-01-31 23:41:57 +02:00
Dirk-Jan C. Binnema 6979a66630 utils: get rid of mu-util.[ch]
It was getting old...
Remove the unused parts, refactor the few parts still in use.
2023-01-14 20:02:05 +02:00
Dirk-Jan C. Binnema 27ecbbdd65 many: use Mu::Regex instead of std::regex
The former is PCRE-compatible, and faster than std::regex.
2022-12-30 11:15:03 +02:00
Dirk-Jan C. Binnema d5fb15574b mu-query-match-decider: add 'Related' to flags
We were _replacing_ the flags (such as Duplicate), but we should add to
them instead.

Add a unit-test for this.
2022-12-08 19:33:15 +02:00
Dirk-Jan C. Binnema da7c3b0c9a tests: update for move_message API update 2022-12-07 18:22:29 +02:00
Dirk-Jan C. Binnema 0b516c18c2 store: add mu_move_message dup flag test
Test the new functionality
2022-12-07 18:22:29 +02:00
Dirk-Jan C. Binnema d2a3a13242 query/test: add term splitting unit test
For checking issue #2365.
2022-11-20 10:18:01 +02:00
Dirk-Jan C. Binnema a417b38624 store: update for new sexp api
And use improved cached_sexp api (automatically handled with
mu-document now)
2022-11-07 18:38:03 +02:00
Dirk-Jan C. Binnema 6064c2e88b test-mu-store-query: make move/refresh test more rigorous 2022-11-01 18:41:10 +02:00
Dirk-Jan C. Binnema 83eceaf580 test-mu-store-query: make move/refresh test more rigorous 2022-10-30 11:39:33 +02:00
Dirk-Jan C. Binnema 06be7a24e7 test-mu-store-query: add unit test for dup message
For ticket #2327. Haven't been able to reproduce though.
2022-10-26 22:35:34 +03:00
Dirk-Jan C. Binnema 5367122c08 store: support reinit
Support reinitializing, based on some current store. This is useful for
upgrading. Note that this is only the backend implementation + tests.
2022-10-02 18:24:23 +03:00
Dirk-Jan C. Binnema ca04ae4d65 test-mu-msg.cc: fix unit test
Fix typo.
2022-10-02 18:24:23 +03:00
Dirk-Jan C. Binnema bb7c8d880a message: convert mime-parts to utf-8
Ensure that non-utf8 mime-parts are converted to utf8. This fixes a
problem with messages with such parts; added unit test.

Fixes #2333.
2022-09-19 18:27:03 +03:00
Dirk-Jan C. Binnema 6fdc20aeb1 tests: add unit-tests for references with fake message-ids
For #2312.
2022-08-11 23:06:12 +03:00
Dirk-Jan C. Binnema 317fe53ff7 tests: update test helpers and users
Move test-mu-common to mu-test-utils. Use mu_test_init as a wrapper for
g_test_init. Update users.
2022-08-11 22:55:10 +03:00
Dirk-Jan C. Binnema 9aabe74df6 mu4e: add more tests for related/skipdups queries 2022-08-07 12:01:18 +03:00
Dirk-Jan C. Binnema 9fdcee8c22 test-mu-store-query: add more contact-matching tests 2022-07-14 08:10:15 +03:00
Dirk-Jan C. Binnema 97459beed9 maildir: improve testing coverage
Remove some dead/unused code. Update docs. Add test cases.
2022-06-29 22:19:26 +03:00
Dirk-Jan C. Binnema df80935c2e document: index some sub-parts as well
1. Also add 'normal' terms for some indexable fields
2. Add terms for e-mail address components

And add some tests.

This helps for some corner-case queries (see tests).

Fixes #2278
Fixes #2281
2022-06-29 08:00:43 +03:00
Dirk-Jan C. Binnema 23ac71e6a7 maildir: add tests for maildir_link / maildir_clear_links 2022-06-29 07:50:16 +03:00
Dirk-Jan C. Binnema 040d74a326 lib/test-mu-store-query: add aujourd'hui tests
We match aujourd'hui now; add a test.

Fixes #1150.
2022-06-14 23:48:59 +03:00
Dirk-Jan C. Binnema 1ec03ce07c message-file: filter out non-file flags
Only take flags from file names that are actually file-flags, not random other
things
2022-06-10 23:28:43 +03:00
Dirk-Jan C. Binnema ce28c86803 tests: add store/query test
Add some tests for storing/indexing message and then run queries on them.
2022-06-09 00:39:34 +03:00
Dirk-Jan C. Binnema 4379e66b9f bench-store-index: make a bit more realistic
```
             .',;::::;,'.                djcb@evergrey
         .';:cccccccccccc:;,.            -------------
      .;cccccccccccccccccccccc;.         OS: Fedora release 36 (Thirty Six) x86_64
    .:cccccccccccccccccccccccccc:.       Host: MS-7B09 2.0
  .;ccccccccccccc;.:dddl:.;ccccccc;.     Kernel: 5.17.11-300.fc36.x86_64
 .:ccccccccccccc;OWMKOOXMWd;ccccccc:.    Uptime: 6 hours, 16 mins
.:ccccccccccccc;KMMc;cc;xMMc:ccccccc:.   Packages: 4340 (rpm), 70 (flatpak)
,cccccccccccccc;MMM.;cc;;WW::cccccccc,   Shell: zsh 5.8.1
:cccccccccccccc;MMM.;cccccccccccccccc:   Resolution: 3840x2160
:ccccccc;oxOOOo;MMM0OOk.;cccccccccccc:   WM: sway
cccccc:0MMKxdd:;MMMkddc.;cccccccccccc;   Theme: Adwaita [GTK2]
ccccc:XM0';cccc;MMM.;cccccccccccccccc'   Icons: Adwaita [GTK2]
ccccc;MMo;ccccc;MMW.;ccccccccccccccc;    Terminal: tilix
ccccc;0MNc.ccc.xMMd:ccccccccccccccc;     CPU: AMD Ryzen Threadripper 1950X (32) @ 3.399GHz
cccccc;dNMWXXXWM0::cccccccccccccc:,      GPU: AMD ATI Radeon RX 470/480/570/570X/580/580X/590
cccccccc;.:odl:.;cccccccccccccc:,.       Memory: 7101MiB / 15881MiB
:cccccccccccccccccccccccccccc:'.
.:cccccccccccccccccccccc:;,..
  '::cccccccccccccc::;,.

```

% make benchmark
ninja -C /home/djcb/Sources/mu/build benchmark
ninja: Entering directory `/home/djcb/Sources/mu/build'
[0/1] Running benchmark suite.
1/1 bench-store-index        OK             17.40s
2022-06-07 23:06:25 +03:00