5378f321f4
utils: add set_thread_name
...
With HAVE_PTHREAD_SETNAME_NP
2026-08-20 15:04:25 -07:00
8c706a77db
mu-init: automatic export labels with --reinit
...
When re-initializing the store, automatically write the labels to a file in mu's
cache, so user can later import them.
2025-08-16 16:20:33 +03:00
34d3bf2e28
tests: only build when needed
...
Build the tests lazily, i.e., not before `meson test`. This helps with
build-times.
2025-08-15 21:01:05 +03:00
8d3b65c5d8
utils: refactor count_nl from mu-cmd-find
...
And update users.
Please enter the commit message for your changes. Lines starting
2025-07-27 19:39:23 +03:00
33958cd0f7
fmt: prefer system package if found
...
mu embeds a "vendored" subset of the libfmt package under thirdparty; but it's
better to use the system-package if the user has one.
So, use the system package if found or user -Duse-embedded-fmt=true is
specified.
2025-07-24 19:55:27 +03:00
7f274fe518
mu-test: fix logging verbosity
...
We were logging _everything since the g_log_set_handler was only set for the
default domain, not "mu". Let's fix this.
2025-06-16 10:57:36 +03:00
eb75141d0a
mu_utils: add to_string_char
...
Like to_string_gchar, but for malloc/free strings.
2025-06-14 13:14:03 +03:00
452969355c
mu-test: add valgrind check
...
Make it a bit easier to skip some tests when running under valgrind.
2025-05-24 19:18:10 +03:00
a2a1838da4
mu-server: cleanup find prop handling
...
Rework the overly long find-handler.
Improve parsing of options, and return better return properties (for use
in mu4e).
2025-04-12 15:07:28 +07:00
507ea8e18e
mu-sexp: don't require > c++17
2025-03-23 20:22:56 +02:00
44ba631a34
mu-find: implement format=json2
...
Implement a new experimental json2 format for mu-find, which gets rid of
the ":" prefixes for fields, i.e., "subject" instead of ":subject".
Document it as well.
2025-03-23 19:47:09 +02:00
4cda859eb8
mu-sexp: tighten definition of plistp
...
In a plist, we also require the first of each two element pairs to start
with ':'
Fixes #2830 .
2025-03-23 19:47:09 +02:00
c91e4ef515
mu-sexp: fix c++23 warning for suffix operator
...
Space between operator"" and _xxx is deprecated.
2025-03-23 19:47:09 +02:00
dee7e5951c
utils-file: add unit-test for expand_file
2024-12-09 19:41:58 +02:00
0e0d4a0cb6
mu-sexp: add -unix output for json tstamps
...
The json output (for mu-find etc.) just showed the converted sexp
output, including the clumsy emacs-style tstamps (for changed/date).
Add unix timestamps as well, which are easier to work with outside
emacs.
This handles #2770 .
2024-12-07 12:14:55 +02:00
646ad2e840
lib/utils: include fmt/xchar.h
...
Needed for 'join'
2024-12-06 20:14:11 +02:00
29dc1cea0c
Fix typos.
2024-09-22 17:27:18 +00:00
075394b35f
lib: use time_t_max for empty datetime
...
In Mu::parse_date_time, when provided with an empty string, return
time_t_max instead of G_MAXINT64. For systems with a 64-bit time_t, there
is no difference. With a 32-bit time_t it caused a test to fail:
not ok /utils/date-basic - ERROR:../mu-1.12.4/lib/utils/tests/test-utils.cc:92
void test_date_basic(): assertion failed
(parse_date_time(std::get<0>(test), std::get<1>(test)).value_or(-1)
== std::get<2>(test)): (18446744073709551615 == 2147483647)
This edge case probably only affected the test, as when other parts of
the application call parse_date_time (e.g. mu-server.cc and
mu-query-processor.cc), they check if the input string is empty first.
2024-08-26 14:46:54 +00:00
23941735df
logging: rework a bit, maybe support syslog
...
Seems journal logging fails on NetBSD (no surprise), but has some
unwanted/not-fully-understood side-effects.
In any case, outside Linux there's no use in even trying to use
journald; so we don't do that anymore.
Add conditional support for syslog (requires glib 2.80).
2024-05-07 09:27:50 +03:00
a0d60d23b0
compat: include sys/wait.h where needed
...
netbsd needs this explicitly, other systems let us get away without it.
2024-04-21 22:08:10 +03:00
29ce96923a
test-mu-utils: update parse_date_time tests
...
We're using ::time_t now.
2024-04-14 11:30:20 +03:00
a6ec43a740
mu-utils: update casting from int64_t -> time_t
...
Esp. for systems with 32-bit time_t.
2024-04-13 20:06:39 +03:00
4a03a30d04
utils: build test-utils when tests are not disabled
...
Fixes #2685
2024-04-08 18:29:57 +03:00
5186264852
utils: only build mu-tests-utils when tests are enabled
...
This fixes a compilation failure.
Fixes #2684 .
2024-04-06 10:36:18 +03:00
45b4f60348
mu-utils: Fix build with musl
...
In musl, `stdout` is a macro that expands to `(stdout)`, and
`::(stdout)` is not valid C++.
../mu-1.12.2/lib/utils/mu-utils.hh:268:32: error: expected
id-expression before '(' token
268 | ::stdout);
| ^~~~~~
Nothing in the Mu namespace is named stdout, so it is safe to drop
the `::`.
Bug: https://bugs.gentoo.org/928361
2024-04-01 11:23:39 +00:00
9fd0d2be12
clang: fix some compiler warnings
...
From CI.
2024-03-15 19:47:30 +02:00
915335fd76
tests: check setlocale return value
...
It might fail while nl_langinfo does not.
2024-02-25 17:11:29 +02:00
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
b4c768e6d0
mu-init: guess maildir when --maildir is missing
...
Re-instate the guessing that's in the manpage. Add unit tests.
Update documentation.
Fixes #2616 .
2024-01-01 10:33:03 +02:00
25776da557
mu-result: small tweaks
2023-12-13 21:48:43 +02:00
fcd89039eb
expand_path: better handle paths with spaces
...
I.e., work around surprising behavior of wordexp
Fixes #2566 .
2023-10-07 00:18:56 +03:00
ee18c02762
maildir: improve unit tests
...
And get some more info from run_command.
2023-09-24 21:33:18 +03:00
4a0eba8ddf
improve unit tests
2023-09-24 20:21:57 +03:00
e16e1f78ce
command-handler: more unit tests
2023-09-24 17:29:56 +03:00
fa22fc28d9
error: more unit tests
2023-09-24 17:29:56 +03:00
abb0fb4fd5
utils/add: improve unit test coverage
2023-09-24 17:29:56 +03:00
11003000e8
mu: log warning when exiting with error
2023-09-23 09:26:37 +03:00
04e3a2f9a8
mu-utils: improve tests
2023-09-21 23:41:15 +03:00
6ce94ce914
mu-utils: add to_string_view
2023-09-21 23:41:15 +03:00
24add72126
mu-file-utils: add run_command0
...
To ensure command ran and had exit-code=0 in one go.
2023-09-19 22:26:45 +03:00
472f69beb2
utils-file: default args for canonicalize_filename / determine_dtype
...
Make a little easier to use
2023-09-19 22:26:30 +03:00
7cbab21099
utils: add utf8_wordbreak
...
Determine if a string has wordbreaks in a mostly Xapian-compatible way.
We need this to determine what strings should be considered "phrases".
2023-09-17 18:11:10 +03:00
3123f3e983
mu-error: allow for adding end-user hints
2023-09-16 11:12:16 +03:00
0a12b70d7b
utils-file: improve mu_play
...
implement in terms of run_command
2023-09-13 23:03:51 +03:00
9dcbe1d96c
lib: unit tests: improve / better coverage
2023-09-13 23:02:53 +03:00
7c16d080d2
Merge pull request #2552 from dme/devel/misc
...
mu: Fix "expected command" server error report
2023-09-12 22:28:30 +03:00
a8440bb258
mu: Fix "expected command" server error report
2023-09-12 08:37:10 +01:00
af9eb36ca0
unit-tests: modernize
...
Use TempDir, join_paths etc.
2023-09-11 23:51:37 +03:00
85ad35bd8e
utils/unbroken: avoid pre-C++20 compiler warning
2023-09-10 10:15:33 +03:00
c8568eecd4
utils/file: add basename/dirname helpers and use them
2023-09-10 10:15:28 +03:00