The existing suite only exercises free functions and the plugin JSON, so it cannot see whether a thing class is dispatched at all. A thing class missing from the dispatch in setupThing() falls into the final Q_ASSERT_X: in a debug build the process dies, in a release build the assert is compiled out and setupThing() returns without ever calling info->finish(), leaving the pairing stuck with no message. Split the tests into two suites. The logic one keeps its former scope and its single dependency on libnymea-sunspec. The new one instantiates the plugin behind the real ThingManager of libnymea-core and a faked HardwareManager, so the dispatch of setupThing(), postSetupThing() and thingRemoved() is covered. No network access takes place: the faked monitor is never reachable, so the plugin never attempts a Modbus connection. The four new cases fail: froniusConnection is not dispatched yet. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
11 lines
351 B
Prolog
11 lines
351 B
Prolog
TEMPLATE = subdirs
|
|
|
|
# logic : logique pure du plugin, sans nymea. Ne demande que libnymea-sunspec.
|
|
# plugin : instancie reellement IntegrationPluginSunSpec derriere un
|
|
# ThingManager et un HardwareManager doubles. Demande en plus
|
|
# libnymea1-dev et libnymea-core (pkg-config nymea, nymea-core).
|
|
|
|
SUBDIRS += \
|
|
logic \
|
|
plugin
|