Files
FrameAssistant/tests/CMakeLists.txt
T
matzmanandClaude Opus 5.5 4f47874a4b Platform: prepare() hook and app-specific command-line options
prepare() runs once mode and app key are known, before engine, surfaces
and SteamVR; returning false ends exec() with exit code 1 (D21). The base
constructor takes the app's own QCommandLineOptions, parses them with its
own and exposes them via isOptionSet()/optionValue() (D38).

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

38 lines
1.8 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)