File: upstream_Use-dbus-run-session-to-run-D-Bus-tests-instead-of-d.patch

package info (click to toggle)
qcoro 0.12.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,700 kB
  • sloc: cpp: 8,573; python: 32; xml: 26; makefile: 23; sh: 15
file content (37 lines) | stat: -rw-r--r-- 1,557 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From de4b2568ef9391db98d678ffab9f3e6313ddb1d3 Mon Sep 17 00:00:00 2001
From: Pino Toscano <toscano.pino@tiscali.it>
Date: Sun, 23 Nov 2025 10:45:27 +0100
Subject: [PATCH] Use dbus-run-session to run D-Bus tests instead of
 dbus-launch

dbus-run-session spawns a session that gets terminated automatically
after the execution of the command. It is a simpler way compared to
dbus-launch, which relies on the X11 tolaunching (which would explain
why it is not used on macOS, as the comment says).

Hence, use dbus-run-session instead of dbus-launch to run each D-Bus
test. Keep the existing macOS behaviour as-is for now, adding a comment
to test using dbus-run-session in the future.
---
 tests/CMakeLists.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 676993c..debe1f9 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -64,9 +64,10 @@ function(qcoro_add_dbus_test _name)
     target_compile_definitions(test-${_name} PRIVATE TESTDBUSSERVER_EXECUTABLE=\"$<TARGET_FILE:testdbusserver>\")
     if (APPLE)
         # On MacOS dbus-launch doesn't work, so we rely on the session dbus running
+        # TODO: check whether dbus-run-session works
         add_test(NAME test-${_name} COMMAND test-${_name})
     else()
-        add_test(NAME test-${_name} COMMAND dbus-launch $<TARGET_FILE:test-${_name}>)
+        add_test(NAME test-${_name} COMMAND dbus-run-session $<TARGET_FILE:test-${_name}>)
     endif()
     _enable_supressions(${_name})
 endfunction()
-- 
2.51.0