Tests do not run with "meson test"; fail when run explicitly
$ meson test
No tests defined.
I did see however that there were tests present, so I made the following patch to enable them:
diff --git a/tests/meson.build b/tests/meson.build
index 3efc1a3..8077e48 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -22,7 +22,7 @@ test_progs = [
]
foreach tprog: test_progs
- executable('test-' + tprog, ['test-' + tprog + '.c'],
+ test('test-' + tprog, executable('test-' + tprog, ['test-' + tprog + '.c'],
dependencies: [libnotify_dep, tests_deps],
- )
+ ))
endforeach
But most of the tests fail with a cryptic "failed to send notification". Wondering what is required in order to execute these tests and why they are not enabled in Gitlab CI?
1/20 test-xy OK 0.12s
2/20 test-markup OK 0.15s
3/20 test-error OK 0.16s
4/20 test-rtl OK 0.15s
5/20 test-server-info OK 0.19s
6/20 test-urgency FAIL 0.14s exit status 1
>>> MALLOC_PERTURB_=177 /var/tmp/portage/x11-libs/libnotify-0.8.1/work/libnotify-0.8.1-.ppc64/tests/test-urgency
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stderr:
failed to send notification
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
7/20 test-action-icons FAIL 0.19s exit status 1
>>> MALLOC_PERTURB_=228 /var/tmp/portage/x11-libs/libnotify-0.8.1/work/libnotify-0.8.1-.ppc64/tests/test-action-icons
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stderr:
failed to send notification
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
8/20 test-size-changes FAIL 0.16s exit status 1
>>> MALLOC_PERTURB_=5 /var/tmp/portage/x11-libs/libnotify-0.8.1/work/libnotify-0.8.1-.ppc64/tests/test-size-changes
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stderr:
failed to send notification
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
9/20 test-basic FAIL 0.19s exit status 1
>>> MALLOC_PERTURB_=219 /var/tmp/portage/x11-libs/libnotify-0.8.1/work/libnotify-0.8.1-.ppc64/tests/test-basic
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stderr:
failed to send notification
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
10/20 test-image FAIL 0.24s exit status 1
>>> MALLOC_PERTURB_=224 /var/tmp/portage/x11-libs/libnotify-0.8.1/work/libnotify-0.8.1-.ppc64/tests/test-image
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stdout:
sending file:///var/tmp/portage/x11-libs/libnotify-0.8.1/work/libnotify-0.8.1-.ppc64/dewdop_leaf.jpg
stderr:
(process:109): Gtk-WARNING **: 17:06:24.384: Locale not supported by C library.
Using the fallback 'C' locale.
failed to send notification
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
11/20 test-replace FAIL 3.19s exit status 1
>>> MALLOC_PERTURB_=34 /var/tmp/portage/x11-libs/libnotify-0.8.1/work/libnotify-0.8.1-.ppc64/tests/test-replace
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stderr:
failed to send notification: GDBus.Error:org.freedesktop.Notifications.MaxNotificationsExceeded: Exceeded maximum number of notifications
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
12/20 test-replace-widget TIMEOUT 30.08s killed by signal 15 SIGTERM
>>> MALLOC_PERTURB_=180 /var/tmp/portage/x11-libs/libnotify-0.8.1/work/libnotify-0.8.1-.ppc64/tests/test-replace-widget
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stderr:
(process:81): Gtk-WARNING **: 17:06:24.365: Locale not supported by C library.
Using the fallback 'C' locale.
(test-replace-widget:81): GLib-GObject-WARNING **: 17:06:24.484: ../glib-2.72.3/gobject/gsignal.c:2613: signal 'expose-event' is invalid for instance '0x154839180' of type 'GtkButton'――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
13/20 test-default-action TIMEOUT 30.08s killed by signal 15 SIGTERM
>>> MALLOC_PERTURB_=206 /var/tmp/portage/x11-libs/libnotify-0.8.1/work/libnotify-0.8.1-.ppc64/tests/test-default-action
14/20 test-persistence TIMEOUT 30.06s killed by signal 15 SIGTERM
>>> MALLOC_PERTURB_=211 /var/tmp/portage/x11-libs/libnotify-0.8.1/work/libnotify-0.8.1-.ppc64/tests/test-persistence
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stderr:
(process:125): Gtk-WARNING **: 17:06:24.396: Locale not supported by C library.
Using the fallback 'C' locale.
libnotify-Message: 17:06:24.534: Server supports persistence; status icon not needed
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
15/20 test-removal TIMEOUT 30.06s killed by signal 15 SIGTERM
>>> MALLOC_PERTURB_=24 /var/tmp/portage/x11-libs/libnotify-0.8.1/work/libnotify-0.8.1-.ppc64/tests/test-removal
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stderr:
(process:130): Gtk-WARNING **: 17:06:24.399: Locale not supported by C library.
Using the fallback 'C' locale.
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
16/20 test-xy-stress TIMEOUT 30.03s killed by signal 15 SIGTERM
>>> MALLOC_PERTURB_=101 /var/tmp/portage/x11-libs/libnotify-0.8.1/work/libnotify-0.8.1-.ppc64/tests/test-xy-stress
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stderr:
failed to send notification
failed to send notification
failed to send notification
failed to send notification
failed to send notification
failed to send notification
failed to send notification
failed to send notification
failed to send notification
failed to send notification
failed to send notification
failed to send notification
failed to send notification
failed to send notification
failed to send notification
failed to send notification
failed to send notification
failed to send notification
failed to send notification
failed to send notification
failed to send notification
failed to send notification
failed to send notification
failed to send notification
failed to send notification
failed to send notification
failed to send notification
failed to send notification
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
17/20 test-transient TIMEOUT 30.05s killed by signal 15 SIGTERM
>>> MALLOC_PERTURB_=56 /var/tmp/portage/x11-libs/libnotify-0.8.1/work/libnotify-0.8.1-.ppc64/tests/test-transient
18/20 test-resident TIMEOUT 30.06s killed by signal 15 SIGTERM
>>> MALLOC_PERTURB_=213 /var/tmp/portage/x11-libs/libnotify-0.8.1/work/libnotify-0.8.1-.ppc64/tests/test-resident
19/20 test-multi-actions TIMEOUT 30.10s killed by signal 15 SIGTERM
>>> MALLOC_PERTURB_=201 /var/tmp/portage/x11-libs/libnotify-0.8.1/work/libnotify-0.8.1-.ppc64/tests/test-multi-actions
20/20 test-xy-actions TIMEOUT 30.05s killed by signal 15 SIGTERM
>>> MALLOC_PERTURB_=243 /var/tmp/portage/x11-libs/libnotify-0.8.1/work/libnotify-0.8.1-.ppc64/tests/test-xy-actions
Summary of Failures:
6/20 test-urgency FAIL 0.14s exit status 1
7/20 test-action-icons FAIL 0.19s exit status 1
8/20 test-size-changes FAIL 0.16s exit status 1
9/20 test-basic FAIL 0.19s exit status 1
10/20 test-image FAIL 0.24s exit status 1
11/20 test-replace FAIL 3.19s exit status 1
12/20 test-replace-widget TIMEOUT 30.08s killed by signal 15 SIGTERM
13/20 test-default-action TIMEOUT 30.08s killed by signal 15 SIGTERM
14/20 test-persistence TIMEOUT 30.06s killed by signal 15 SIGTERM
15/20 test-removal TIMEOUT 30.06s killed by signal 15 SIGTERM
16/20 test-xy-stress TIMEOUT 30.03s killed by signal 15 SIGTERM
17/20 test-transient TIMEOUT 30.05s killed by signal 15 SIGTERM
18/20 test-resident TIMEOUT 30.06s killed by signal 15 SIGTERM
19/20 test-multi-actions TIMEOUT 30.10s killed by signal 15 SIGTERM
20/20 test-xy-actions TIMEOUT 30.05s killed by signal 15 SIGTERM
Ok: 5
Expected Fail: 0
Fail: 6
Unexpected Pass: 0
Skipped: 0
Timeout: 9