1diff '--color=auto' -ur '--color=never' a/tests/libqtdbustest/TestDBusTestRunner.cpp b/tests/libqtdbustest/TestDBusTestRunner.cpp
2--- a/tests/libqtdbustest/TestDBusTestRunner.cpp 2023-01-20 21:36:16.948292559 +0100
3+++ b/tests/libqtdbustest/TestDBusTestRunner.cpp 2023-01-20 21:55:40.554530221 +0100
4@@ -44,7 +44,7 @@
5 TEST_F(TestDBusTestRunner, StartsSessionService) {
6 QSharedPointer<QProcessDBusService> process(
7 new QProcessDBusService("test.session.name",
8- QDBusConnection::SessionBus, "/usr/bin/python3",
9+ QDBusConnection::SessionBus, "python3",
10 QStringList() << "-m" << "dbusmock" << "test.session.name"
11 << "/test/object" << "test.Interface"));
12
13@@ -58,15 +58,14 @@
14 pgrep.waitForFinished();
15 pgrep.waitForReadyRead();
16
17- EXPECT_EQ(
18- "/usr/bin/python3 -m dbusmock test.session.name /test/object test.Interface",
19- QString::fromUtf8(pgrep.readAll().trimmed()).toStdString());
20+ EXPECT_TRUE(
21+ pgrep.readAll().contains("python3 -m dbusmock test.session.name /test/object test.Interface"));
22 }
23
24 TEST_F(TestDBusTestRunner, StartsSystemService) {
25 QSharedPointer<QProcessDBusService> process(
26 new QProcessDBusService("test.system.name",
27- QDBusConnection::SystemBus, "/usr/bin/python3",
28+ QDBusConnection::SystemBus, "python3",
29 QStringList() << "-m" << "dbusmock" << "-s"
30 << "test.system.name" << "/test/object"
31 << "test.Interface"));
32@@ -81,9 +80,8 @@
33 pgrep.waitForFinished();
34 pgrep.waitForReadyRead();
35
36- EXPECT_EQ(
37- "/usr/bin/python3 -m dbusmock -s test.system.name /test/object test.Interface",
38- QString::fromUtf8(pgrep.readAll().trimmed()).toStdString());
39+ EXPECT_TRUE(
40+ pgrep.readAll().contains("python3 -m dbusmock -s test.system.name /test/object test.Interface"));
41 }
42
43 TEST_F(TestDBusTestRunner, SetsEnvironmentVariables) {
44diff '--color=auto' -ur '--color=never' a/tests/libqtdbustest/TestQProcessDBusService.cpp b/tests/libqtdbustest/TestQProcessDBusService.cpp
45--- a/tests/libqtdbustest/TestQProcessDBusService.cpp 2023-01-20 21:36:16.948292559 +0100
46+++ b/tests/libqtdbustest/TestQProcessDBusService.cpp 2023-01-20 21:54:34.633384937 +0100
47@@ -45,7 +45,7 @@
48
49 TEST_F(TestQProcessDBusService, WaitsForServiceAppeared) {
50 QProcessDBusService process("test.name", QDBusConnection::SessionBus,
51- "/usr/bin/python3",
52+ "python3",
53 QStringList() << "-m" << "dbusmock" << "test.name" << "/test/object"
54 << "test.Interface");
55
56@@ -58,14 +58,13 @@
57 pgrep.waitForFinished();
58 pgrep.waitForReadyRead();
59
60- EXPECT_EQ(
61- "/usr/bin/python3 -m dbusmock test.name /test/object test.Interface",
62- QString::fromUtf8(pgrep.readAll().trimmed()).toStdString());
63+ EXPECT_TRUE(
64+ pgrep.readAll().contains("python3 -m dbusmock test.name /test/object test.Interface"));
65 }
66
67 TEST_F(TestQProcessDBusService, ThrowsErrorForFailToStart) {
68 QProcessDBusService process("test.name", QDBusConnection::SessionBus,
69- "/usr/bin/python3",
70+ "python3",
71 QStringList() << "-m" << "dbusmock" << "not.test.name"
72 << "/test/object" << "test.Interface");
73
74diff '--color=auto' -ur '--color=never' a/tests/libqtdbustest/TestSuicidalProcess.cpp b/tests/libqtdbustest/TestSuicidalProcess.cpp
75--- a/tests/libqtdbustest/TestSuicidalProcess.cpp 2023-01-20 21:36:16.948292559 +0100
76+++ b/tests/libqtdbustest/TestSuicidalProcess.cpp 2023-01-20 21:55:07.219951081 +0100
77@@ -51,9 +51,7 @@
78 pgrep.waitForFinished();
79 pgrep.waitForReadyRead();
80
81- EXPECT_TRUE(QString::fromUtf8(pgrep.readAll().trimmed())
82- .toStdString()
83- .find("sleep 5") != std::string::npos);
84+ EXPECT_TRUE(pgrep.readAll().contains("sleep 5"));
85 }
86
87 } // namespace