anvil-editor: init at 0.4
[NixPkgs.git] / pkgs / development / libraries / libqtdbustest / less-pedantic-process-finding.patch
blobdc8bcd7763f92d5648e358de8bba060a2fab5e53
1 diff '--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"));
13 @@ -58,15 +58,14 @@
14 pgrep.waitForFinished();
15 pgrep.waitForReadyRead();
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"));
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();
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"));
43 TEST_F(TestDBusTestRunner, SetsEnvironmentVariables) {
44 diff '--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 @@
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");
56 @@ -58,14 +58,13 @@
57 pgrep.waitForFinished();
58 pgrep.waitForReadyRead();
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"));
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");
74 diff '--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();
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"));
87 } // namespace