Add nymea-mqtt-tests package and add an option to not build the tests

This commit is contained in:
Simon Stürz 2024-01-26 15:57:36 +01:00
parent 2c7f874dd1
commit 166823ab65
6 changed files with 30 additions and 4 deletions

8
debian/control vendored
View File

@ -44,3 +44,11 @@ Depends:
${shlibs:Depends},
Description: nymea-mqtt command line client
nymeas mqtt implementation. This package contains a command line mqtt client.
Package: nymea-mqtt-tests
Architecture: any
Depends:
${misc:Depends},
${shlibs:Depends},
Description: nymea-mqtt tests
nymeas mqtt implementation. This package contains the tests for the library.

1
debian/nymea-mqtt-tests.install vendored Normal file
View File

@ -0,0 +1 @@
/usr/share/tests/nymea-mqtt/*

View File

@ -1,7 +1,13 @@
TEMPLATE = subdirs
SUBDIRS += libnymea-mqtt server client tests
SUBDIRS += libnymea-mqtt server client
server.depends = libnymea-mqtt
client.depends = libnymea-mqtt
tests.depends = libnymea-mqtt
!disabletests {
SUBDIRS += tests
tests.depends = libnymea-mqtt
} else {
message("Build without tests")
}

View File

@ -8,7 +8,6 @@ TEMPLATE = app
include(../../nymea-mqtt.pri)
INCLUDEPATH += $$top_srcdir/libnymea-mqtt/
HEADERS += $${top_srcdir}/tests/common/mqtttests.h
@ -16,3 +15,7 @@ HEADERS += $${top_srcdir}/tests/common/mqtttests.h
SOURCES += $${top_srcdir}/tests/common/mqtttests.cpp
LIBS += -L$$top_builddir/libnymea-mqtt/ -lnymea-mqtt
target.path = $$[QT_INSTALL_PREFIX]/bin
INSTALLS += target

View File

@ -1,4 +1,8 @@
TARGET = nymeamqttteststcp
include(../common/common.pri)
SOURCES += test_tcp.cpp
target.path = $$[QT_INSTALL_PREFIX]/share/tests/nymea-mqtt/
INSTALLS += target

View File

@ -1,4 +1,8 @@
include(../common/common.pri)
TARGET = nymeamqtttestswebsocket
SOURCES += test_websocket.cpp
target.path = $$[QT_INSTALL_PREFIX]/share/tests/nymea-mqtt/
INSTALLS += target