{libsForQt5,qt6Packages}.libqtdbustest: 0.4.0 -> 0.4.1 (#533998)

This commit is contained in:
Cosima Neidahl
2026-06-29 15:01:21 +00:00
committed by GitHub
2 changed files with 3 additions and 79 deletions
@@ -17,24 +17,20 @@
}:
let
withQt6 = lib.strings.versionAtLeast qtbase.version "6";
withQt6 = lib.versions.major qtbase.version == "6";
in
stdenv.mkDerivation (finalAttrs: {
pname = "libqtdbustest";
version = "0.4.0";
version = "0.4.1";
src = fetchFromGitLab {
owner = "ubports";
repo = "development/core/libqtdbustest";
rev = finalAttrs.version;
hash = "sha256-49YIkaQ2ceJxaPLkzOg+L3bwiPzoB36xU7skRh4vYQg=";
hash = "sha256-bTLGL/3iy8Wu4HnPRJj2Vn3xOlPhXFbaxgyQol8Y1JY=";
};
patches = [
# Tests are overly pedantic when looking for launched process names in `ps`, break on python wrapper vs real python
# Just check if basename + arguments match, like libqtdbusmock does
./less-pedantic-process-finding.patch
# Disable QProcess start timeout
(fetchpatch {
url = "https://salsa.debian.org/ubports-team/libqtdbustest/-/raw/debian/0.3.2-3/debian/patches/1003_no-QProcess-waitForstarted-timeout.patch";
@@ -1,72 +0,0 @@
diff '--color=auto' -ur '--color=never' a/tests/libqtdbustest/TestDBusTestRunner.cpp b/tests/libqtdbustest/TestDBusTestRunner.cpp
--- a/tests/libqtdbustest/TestDBusTestRunner.cpp 2023-01-20 21:36:16.948292559 +0100
+++ b/tests/libqtdbustest/TestDBusTestRunner.cpp 2023-01-20 21:55:40.554530221 +0100
@@ -44,7 +44,7 @@
TEST_F(TestDBusTestRunner, StartsSessionService) {
QSharedPointer<QProcessDBusService> process(
new QProcessDBusService("test.session.name",
- QDBusConnection::SessionBus, "/usr/bin/python3",
+ QDBusConnection::SessionBus, "python3",
QStringList() << "-m" << "dbusmock" << "test.session.name"
<< "/test/object" << "test.Interface"));
@@ -58,15 +58,14 @@
pgrep.waitForFinished();
pgrep.waitForReadyRead();
- EXPECT_EQ(
- "/usr/bin/python3 -m dbusmock test.session.name /test/object test.Interface",
- QString::fromUtf8(pgrep.readAll().trimmed()).toStdString());
+ EXPECT_TRUE(
+ pgrep.readAll().contains("python3 -m dbusmock test.session.name /test/object test.Interface"));
}
TEST_F(TestDBusTestRunner, StartsSystemService) {
QSharedPointer<QProcessDBusService> process(
new QProcessDBusService("test.system.name",
- QDBusConnection::SystemBus, "/usr/bin/python3",
+ QDBusConnection::SystemBus, "python3",
QStringList() << "-m" << "dbusmock" << "-s"
<< "test.system.name" << "/test/object"
<< "test.Interface"));
@@ -81,9 +80,8 @@
pgrep.waitForFinished();
pgrep.waitForReadyRead();
- EXPECT_EQ(
- "/usr/bin/python3 -m dbusmock -s test.system.name /test/object test.Interface",
- QString::fromUtf8(pgrep.readAll().trimmed()).toStdString());
+ EXPECT_TRUE(
+ pgrep.readAll().contains("python3 -m dbusmock -s test.system.name /test/object test.Interface"));
}
TEST_F(TestDBusTestRunner, SetsEnvironmentVariables) {
diff '--color=auto' -ur '--color=never' a/tests/libqtdbustest/TestQProcessDBusService.cpp b/tests/libqtdbustest/TestQProcessDBusService.cpp
--- a/tests/libqtdbustest/TestQProcessDBusService.cpp 2023-01-20 21:36:16.948292559 +0100
+++ b/tests/libqtdbustest/TestQProcessDBusService.cpp 2023-01-20 21:54:34.633384937 +0100
@@ -45,7 +45,7 @@
TEST_F(TestQProcessDBusService, WaitsForServiceAppeared) {
QProcessDBusService process("test.name", QDBusConnection::SessionBus,
- "/usr/bin/python3",
+ "python3",
QStringList() << "-m" << "dbusmock" << "test.name" << "/test/object"
<< "test.Interface");
@@ -58,14 +58,13 @@
pgrep.waitForFinished();
pgrep.waitForReadyRead();
- EXPECT_EQ(
- "/usr/bin/python3 -m dbusmock test.name /test/object test.Interface",
- QString::fromUtf8(pgrep.readAll().trimmed()).toStdString());
+ EXPECT_TRUE(
+ pgrep.readAll().contains("python3 -m dbusmock test.name /test/object test.Interface"));
}
TEST_F(TestQProcessDBusService, ThrowsErrorForFailToStart) {
QProcessDBusService process("test.name", QDBusConnection::SessionBus,
- "/usr/bin/python3",
+ "python3",
QStringList() << "-m" << "dbusmock" << "not.test.name"
<< "/test/object" << "test.Interface");