Files
FrameAssistant/tests/CMakeLists.txt
T
matzmanandClaude Opus 5.5 96df60e6bd MQTT client on libmosquitto with its own thread (iteration 2, step 2)
MqttClient is the interface the HA layer will use; MosquittoClient
implements it with one std::thread for DNS, connect, network loop and
reconnect with backoff (D45, amends D42: mosquitto_loop_start() blocks
the caller on DNS and stops silently on TLS/protocol errors).
tst_mqtt tests it against a local mosquitto: messages, retained
messages, first connect and reconnect, last will, login.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 16:09:53 +02:00

48 lines
2.2 KiB
CMake

find_package(Qt6 REQUIRED COMPONENTS Test)
# Unit tests run without SteamVR or a headset. They use the "offscreen" QPA platform;
# tests that need a GPU context QSKIP themselves when none is available.
qt_add_executable(tst_inputbridge tst_inputbridge.cpp)
target_link_libraries(tst_inputbridge PRIVATE vrdashboard_core Qt6::Test)
add_test(NAME inputbridge COMMAND tst_inputbridge)
qt_add_executable(tst_render tst_render.cpp)
target_link_libraries(tst_render PRIVATE vrdashboard_core Qt6::Test)
qt_add_qml_module(tst_render
URI RenderTest
VERSION 1.0
QML_FILES TwoTone.qml Spinner.qml)
add_test(NAME render_opengl COMMAND tst_render)
set_tests_properties(render_opengl PROPERTIES ENVIRONMENT "VRDASH_TEST_API=opengl")
add_test(NAME render_vulkan COMMAND tst_render)
set_tests_properties(render_vulkan PROPERTIES ENVIRONMENT "VRDASH_TEST_API=vulkan")
set_tests_properties(inputbridge PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=offscreen")
# Two surfaces in one app (snapshot mode): set-up, hooks, rendering per surface.
qt_add_executable(tst_surfaces tst_surfaces.cpp)
target_link_libraries(tst_surfaces PRIVATE vrdashboard_core)
qt_add_qml_module(tst_surfaces
URI SurfacesTest
VERSION 1.0
QML_FILES Red.qml Blue.qml)
add_test(NAME surfaces_opengl COMMAND tst_surfaces --graphics-api opengl)
add_test(NAME surfaces_vulkan COMMAND tst_surfaces --graphics-api vulkan)
add_test(NAME surfaces_cli_key COMMAND tst_surfaces --graphics-api opengl)
set_tests_properties(surfaces_cli_key PROPERTIES ENVIRONMENT "VRDASH_TEST_CLI_KEY=1")
add_test(NAME surfaces_prepare_fail COMMAND tst_surfaces --graphics-api opengl)
set_tests_properties(surfaces_prepare_fail PROPERTIES ENVIRONMENT "VRDASH_TEST_PREPARE_FAIL=1")
set_tests_properties(surfaces_opengl surfaces_vulkan surfaces_cli_key
PROPERTIES SKIP_RETURN_CODE 77)
# The app's settings file (docs/DESIGN.md, D34).
qt_add_executable(tst_config tst_config.cpp)
target_link_libraries(tst_config PRIVATE frameassistant_lib Qt6::Test)
add_test(NAME config COMMAND tst_config)
# MosquittoClient against a local mosquitto broker (D30 level 2); skips without one.
qt_add_executable(tst_mqtt tst_mqtt.cpp)
target_link_libraries(tst_mqtt PRIVATE frameassistant_lib Qt6::Test)
add_test(NAME mqtt COMMAND tst_mqtt)