From 400fff6785efa8fd43fbc03e5964392e6fa6f8ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Mon, 6 Oct 2025 09:49:41 +0200 Subject: [PATCH] Rename testlib folder to libnymea-tests Fix multiple imports of QT libs by replacing "+=" with "*=" --- nymea.pro | 2 +- tests/auto/autotests.pri | 12 ++++++------ .../libnymea-tests.pro} | 12 ++++++------ tests/{testlib => libnymea-tests}/nymeatestbase.cpp | 0 tests/{testlib => libnymea-tests}/nymeatestbase.h | 0 tests/tests.pro | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) rename tests/{testlib/testlib.pro => libnymea-tests/libnymea-tests.pro} (90%) rename tests/{testlib => libnymea-tests}/nymeatestbase.cpp (100%) rename tests/{testlib => libnymea-tests}/nymeatestbase.h (100%) diff --git a/nymea.pro b/nymea.pro index 008996fa..51dcf0e9 100644 --- a/nymea.pro +++ b/nymea.pro @@ -77,7 +77,7 @@ INSTALLS += translations QMAKE_EXTRA_TARGETS += lupdate lrelease test.depends += lrelease -test.commands = LD_LIBRARY_PATH=$$top_builddir/libnymea-core:$$top_builddir/libnymea:$$top_builddir/tests/testlib make check TESTRUNNER=\"dbus-test-runner --bus-type=both --task\" +test.commands = LD_LIBRARY_PATH=$$top_builddir/libnymea-core:$$top_builddir/libnymea:$$top_builddir/tests/libnymea-tests make check TESTRUNNER=\"dbus-test-runner --bus-type=both --task\" QMAKE_EXTRA_TARGETS += test # Show doc files in project tree diff --git a/tests/auto/autotests.pri b/tests/auto/autotests.pri index fed7d80d..fb39ed81 100644 --- a/tests/auto/autotests.pri +++ b/tests/auto/autotests.pri @@ -1,6 +1,6 @@ -QT += dbus testlib network sql websockets -CONFIG += testcase -CONFIG += link_pkgconfig +QT *= dbus testlib network sql websockets +CONFIG *= testcase +CONFIG *= link_pkgconfig greaterThan(QT_MAJOR_VERSION, 5) { qtHaveModule(serialbus) { @@ -32,17 +32,17 @@ PKGCONFIG += nymea-zigbee nymea-networkmanager nymea-mqtt INCLUDEPATH += $$top_srcdir/libnymea \ $$top_srcdir/libnymea-core \ - $$top_srcdir/tests/testlib/ \ + $$top_srcdir/tests/libnymea-tests/ \ $$top_builddir LIBS += -L$$top_builddir/libnymea/ -lnymea \ -L$$top_builddir/libnymea-core/ -lnymea-core \ - -L$$top_builddir/tests/testlib/ -lnymea-tests \ + -L$$top_builddir/tests/libnymea-tests/ -lnymea-tests \ -L$$top_builddir/plugins/mock/ \ -lssl -lcrypto -lnymea-remoteproxyclient target.path = $$[QT_INSTALL_PREFIX]/share/tests/nymea/ INSTALLS += target -test.commands = LD_LIBRARY_PATH=../../../libnymea:../../../libnymea-core/:../../testlib/ make check TESTRUNNER=\"dbus-test-runner --bus-type=both --task\" +test.commands = LD_LIBRARY_PATH=../../../libnymea:../../../libnymea-core/:../../libnymea-tests/ make check TESTRUNNER=\"dbus-test-runner --bus-type=both --task\" QMAKE_EXTRA_TARGETS += test diff --git a/tests/testlib/testlib.pro b/tests/libnymea-tests/libnymea-tests.pro similarity index 90% rename from tests/testlib/testlib.pro rename to tests/libnymea-tests/libnymea-tests.pro index 4d5b0180..b1c1cb80 100644 --- a/tests/testlib/testlib.pro +++ b/tests/libnymea-tests/libnymea-tests.pro @@ -3,22 +3,22 @@ TARGET = nymea-tests include(../../nymea.pri) -QT += testlib dbus network sql websockets +QT *= dbus network sql websockets testlib -CONFIG += link_pkgconfig -PKGCONFIG += nymea-zigbee +CONFIG *= link_pkgconfig +PKGCONFIG *= nymea-zigbee greaterThan(QT_MAJOR_VERSION, 5) { qtHaveModule(serialbus) { message("Building with QtSerialBus support.") - QT += serialbus - DEFINES += WITH_QTSERIALBUS + QT *= serialbus + DEFINES *= WITH_QTSERIALBUS } else { message("QtSerialBus package not found. Building without QtSerialBus support.") } # Separate module in Qt6 - QT += concurrent + QT *= concurrent } else { packagesExist(Qt5SerialBus) { message("Building with QtSerialBus support.") diff --git a/tests/testlib/nymeatestbase.cpp b/tests/libnymea-tests/nymeatestbase.cpp similarity index 100% rename from tests/testlib/nymeatestbase.cpp rename to tests/libnymea-tests/nymeatestbase.cpp diff --git a/tests/testlib/nymeatestbase.h b/tests/libnymea-tests/nymeatestbase.h similarity index 100% rename from tests/testlib/nymeatestbase.h rename to tests/libnymea-tests/nymeatestbase.h diff --git a/tests/tests.pro b/tests/tests.pro index dbf0b265..30bab73b 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -1,4 +1,4 @@ TEMPLATE = subdirs -SUBDIRS = testlib auto tools/simplepushbuttonhandler -auto.depends += testlib +SUBDIRS = libnymea-tests auto tools/simplepushbuttonhandler +auto.depends += libnymea-tests