From 9c357d87d3e976fa5ef0d5b4373886b06d524f2a Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Sun, 19 May 2019 17:47:19 +0200 Subject: [PATCH 1/2] Move nymeatestbase into a nymea-testlib to speed up building --- debian/nymea-tests.install.in | 1 + nymea.pro | 2 +- tests/auto/auto.pro | 2 ++ tests/auto/autotests.pri | 7 ++----- tests/{auto => testlib}/nymeatestbase.cpp | 0 tests/{auto => testlib}/nymeatestbase.h | 0 tests/testlib/testlib.pro | 19 +++++++++++++++++++ tests/tests.pro | 4 +++- 8 files changed, 28 insertions(+), 7 deletions(-) rename tests/{auto => testlib}/nymeatestbase.cpp (100%) rename tests/{auto => testlib}/nymeatestbase.h (100%) create mode 100644 tests/testlib/testlib.pro diff --git a/debian/nymea-tests.install.in b/debian/nymea-tests.install.in index 7b9977c6..0a702348 100644 --- a/debian/nymea-tests.install.in +++ b/debian/nymea-tests.install.in @@ -1,2 +1,3 @@ usr/tests/* usr/lib/@DEB_HOST_MULTIARCH@/nymea/tests usr/lib/@DEB_HOST_MULTIARCH@/nymea/plugins/libnymea_devicepluginmock.so +usr/lib/@DEB_HOST_MULTIARCH@/libnymea-testlib.so* diff --git a/nymea.pro b/nymea.pro index 3713aa3e..28f934e0 100644 --- a/nymea.pro +++ b/nymea.pro @@ -44,7 +44,7 @@ INSTALLS += translations QMAKE_EXTRA_TARGETS += lupdate lrelease test.depends = licensecheck lrelease -test.commands = LD_LIBRARY_PATH=$$top_builddir/libnymea-core:$$top_builddir/libnymea make check +test.commands = LD_LIBRARY_PATH=$$top_builddir/libnymea-core:$$top_builddir/libnymea:$$top_builddir/tests/testlib make check QMAKE_EXTRA_TARGETS += test # Show doc files in project tree diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index e4bd38e8..df2d8ec4 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -1,4 +1,5 @@ TEMPLATE = subdirs + SUBDIRS = versioning \ devices \ jsonrpc \ @@ -25,3 +26,4 @@ SUBDIRS = versioning \ usermanager \ mqttbroker \ tags \ + diff --git a/tests/auto/autotests.pri b/tests/auto/autotests.pri index 118764ad..cf2a22d4 100644 --- a/tests/auto/autotests.pri +++ b/tests/auto/autotests.pri @@ -3,16 +3,13 @@ CONFIG += testcase INCLUDEPATH += $$top_srcdir/libnymea \ $$top_srcdir/libnymea-core \ - $$top_srcdir/tests/auto/ + $$top_srcdir/tests/testlib/ LIBS += -L$$top_builddir/libnymea/ -lnymea \ -L$$top_builddir/libnymea-core/ -lnymea-core \ + -L$$top_builddir/tests/testlib/ -lnymea-testlib \ -L$$top_builddir/plugins/mock/ \ -lssl -lcrypto -lavahi-common -lavahi-client -lnymea-remoteproxyclient -SOURCES += ../nymeatestbase.cpp \ - -HEADERS += ../nymeatestbase.h \ - target.path = /usr/tests INSTALLS += target diff --git a/tests/auto/nymeatestbase.cpp b/tests/testlib/nymeatestbase.cpp similarity index 100% rename from tests/auto/nymeatestbase.cpp rename to tests/testlib/nymeatestbase.cpp diff --git a/tests/auto/nymeatestbase.h b/tests/testlib/nymeatestbase.h similarity index 100% rename from tests/auto/nymeatestbase.h rename to tests/testlib/nymeatestbase.h diff --git a/tests/testlib/testlib.pro b/tests/testlib/testlib.pro new file mode 100644 index 00000000..72189702 --- /dev/null +++ b/tests/testlib/testlib.pro @@ -0,0 +1,19 @@ +TEMPLATE = lib +TARGET = nymea-testlib + +include(../../nymea.pri) + +QT += testlib network sql + +INCLUDEPATH += $$top_srcdir/libnymea \ + $$top_srcdir/libnymea-core + +LIBS += -L$$top_builddir/libnymea/ -lnymea \ + -L$$top_builddir/libnymea-core/ -lnymea-core \ + -lssl -lcrypto -lavahi-common -lavahi-client -lnymea-remoteproxyclient + +HEADERS += nymeatestbase.h +SOURCES += nymeatestbase.cpp + +target.path = $$[QT_INSTALL_LIBS] +INSTALLS += target diff --git a/tests/tests.pro b/tests/tests.pro index 06c1e4b4..db50a6ec 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -1,3 +1,5 @@ TEMPLATE = subdirs -SUBDIRS = auto tools/simplepushbuttonhandler +SUBDIRS = testlib auto tools/simplepushbuttonhandler + +auto.depends += testlib From 5898c2eae5b56d3bfd80a03be53f0f4c2d91b179 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Thu, 23 May 2019 04:28:28 +0200 Subject: [PATCH 2/2] drop avahi linker flags --- tests/testlib/testlib.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testlib/testlib.pro b/tests/testlib/testlib.pro index 72189702..8c03d502 100644 --- a/tests/testlib/testlib.pro +++ b/tests/testlib/testlib.pro @@ -10,7 +10,7 @@ INCLUDEPATH += $$top_srcdir/libnymea \ LIBS += -L$$top_builddir/libnymea/ -lnymea \ -L$$top_builddir/libnymea-core/ -lnymea-core \ - -lssl -lcrypto -lavahi-common -lavahi-client -lnymea-remoteproxyclient + -lssl -lcrypto -lnymea-remoteproxyclient HEADERS += nymeatestbase.h SOURCES += nymeatestbase.cpp