test: cover flatpak parsing and plugin discovery

Unit-test the flatpak parsers (search rows, installed/update columns)
and the plugin manager end-to-end: built-in registration, runtime
discovery of the sample plugin, enable/disable persistence, reload and
install-hint exposure.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
BlackAngelTV committed 2026-08-29 13:34:50 +02:00
1 parent bc737d356e
commit 71eb962b00
3 files changed
+197

No files matched your search

+21
View File
@@ -48,6 +48,27 @@ add_executable(pacman-manager-test tests/pacman-manager.test.cpp src/pacman-mana
target_include_directories(pacman-manager-test PRIVATE include)
add_test(NAME pacman-manager-test COMMAND pacman-manager-test)
add_executable(flatpak-manager-test tests/flatpak-manager.test.cpp src/flatpak-manager.cpp)
target_include_directories(flatpak-manager-test PRIVATE include)
add_test(NAME flatpak-manager-test COMMAND flatpak-manager-test)
# Plugin manager test: needs Qt (QSettings/QLibrary) and the example plugin
# built next to the test binary, so it is only enabled with the plugin option.
if(FWS_BUILD_EXAMPLE_PLUGIN)
add_executable(plugin-manager-test tests/plugin-manager.test.cpp
src/plugin-manager.cpp src/pacman-manager.cpp src/flatpak-manager.cpp)
target_include_directories(plugin-manager-test PRIVATE include)
target_link_libraries(plugin-manager-test PRIVATE Qt6::Core)
add_dependencies(plugin-manager-test example-provider-plugin)
add_custom_command(TARGET plugin-manager-test POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory
$<TARGET_FILE_DIR:plugin-manager-test>/plugins
COMMAND ${CMAKE_COMMAND} -E copy
$<TARGET_FILE:example-provider-plugin>
$<TARGET_FILE_DIR:plugin-manager-test>/plugins/)
add_test(NAME plugin-manager-test COMMAND plugin-manager-test)
endif()
# Optional example external provider plugin. Demonstrates the plugin mechanism:
# the produced library is copied next to the executable and discovered at
# runtime by PluginManager (see the Providers page).