include(../../../sunspec.pri) QT += testlib network serialbus QT -= gui CONFIG += console testcase c++17 CONFIG -= app_bundle TEMPLATE = app TARGET = tst_sunspecplugin # Suite qui instancie reellement IntegrationPluginSunSpec, derriere un # ThingManager reel (celui de libnymea-core) et un HardwareManager double. Elle # couvre ce que la suite de logique pure ne peut pas voir : l'aiguillage de # setupThing() / postSetupThing() / thingRemoved() sur la thingClass. # # Dependances supplementaires par rapport a ../logic : libnymea1-dev et # libnymea-core (pkg-config nymea et nymea-core). CONFIG += link_pkgconfig PKGCONFIG += nymea nymea-core PLUGIN_DIR = $$PWD/../.. INCLUDEPATH += $$PLUGIN_DIR # Le plugin s'appuie sur les identifiants generes depuis son JSON. On les # fabrique ici exactement comme le fait plugin.pri pour le plugin lui-meme : # plugininfo.h (definitions, inclus par integrationpluginsunspec.cpp) et # extern-plugininfo.h (declarations, inclus par les en-tetes et par le test). JSONFILE = $$PLUGIN_DIR/integrationpluginsunspec.json OTHER_FILES += $$JSONFILE plugininfo.input = JSONFILE plugininfo.output = plugininfo.h plugininfo.commands = nymea-plugininfocompiler ${QMAKE_FILE_NAME} --output ${QMAKE_FILE_OUT} plugininfo.dependency_type = TYPE_C plugininfo.CONFIG += no_link combine QMAKE_EXTRA_COMPILERS += plugininfo extern_plugininfo.input = JSONFILE extern_plugininfo.output = extern-plugininfo.h extern_plugininfo.commands = nymea-plugininfocompiler ${QMAKE_FILE_NAME} --extern ${QMAKE_FILE_OUT} extern_plugininfo.dependency_type = TYPE_C extern_plugininfo.CONFIG += no_link combine QMAKE_EXTRA_COMPILERS += extern_plugininfo DEFINES += PLUGIN_JSON_PATH=\\\"$$JSONFILE\\\" SOURCES += \ tst_sunspecplugin.cpp \ $$PLUGIN_DIR/integrationpluginsunspec.cpp \ $$PLUGIN_DIR/froniusrules.cpp \ $$PLUGIN_DIR/solaredgebattery.cpp \ $$PLUGIN_DIR/sunspecdiscovery.cpp \ $$PLUGIN_DIR/sunspecstoragelogic.cpp \ $$PLUGIN_DIR/sunspecthing.cpp HEADERS += \ $$PLUGIN_DIR/integrationpluginsunspec.h \ $$PLUGIN_DIR/froniusrules.h \ $$PLUGIN_DIR/solaredgebattery.h \ $$PLUGIN_DIR/sunspecdiscovery.h \ $$PLUGIN_DIR/sunspecstoragelogic.h \ $$PLUGIN_DIR/sunspecthing.h