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 40ea2eec..ad164e88 100644 --- a/nymea.pro +++ b/nymea.pro @@ -45,7 +45,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..8c03d502 --- /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 -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