diff --git a/debian/control b/debian/control index fc354e5..da7db16 100644 --- a/debian/control +++ b/debian/control @@ -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. diff --git a/debian/nymea-mqtt-tests.install b/debian/nymea-mqtt-tests.install new file mode 100644 index 0000000..90f6179 --- /dev/null +++ b/debian/nymea-mqtt-tests.install @@ -0,0 +1 @@ +/usr/share/tests/nymea-mqtt/* diff --git a/nymea-mqtt.pro b/nymea-mqtt.pro index 01c1be8..b861247 100644 --- a/nymea-mqtt.pro +++ b/nymea-mqtt.pro @@ -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") +} + diff --git a/tests/common/common.pri b/tests/common/common.pri index 0a123fe..09eb5a5 100644 --- a/tests/common/common.pri +++ b/tests/common/common.pri @@ -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 + diff --git a/tests/tcp/tcp.pro b/tests/tcp/tcp.pro index 84fc9c8..599f22e 100644 --- a/tests/tcp/tcp.pro +++ b/tests/tcp/tcp.pro @@ -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 diff --git a/tests/websocket/websocket.pro b/tests/websocket/websocket.pro index 89c7c9d..9e8fef8 100644 --- a/tests/websocket/websocket.pro +++ b/tests/websocket/websocket.pro @@ -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