aboutsummaryrefslogtreecommitdiff
path: root/libs/plugin_python/tests/runner/CMakeLists.txt
diff options
context:
space:
mode:
authorSulfurNitride <SulfurNitride@users.noreply.github.com>2026-02-11 02:37:39 -0600
committerSulfurNitride <SulfurNitride@users.noreply.github.com>2026-02-11 02:37:39 -0600
commit7ee008e150bc5bcf76082d726f719ee0fdfda982 (patch)
tree27fb39be241fdb5ac2734c574de678977d1856d0 /libs/plugin_python/tests/runner/CMakeLists.txt
Fluorine Manager: full Linux port of Mod Organizer 2
Complete native Linux port with FUSE-based virtual filesystem, Proton/umu-run integration, and Flatpak packaging. Key features: - FUSE VFS replacing Windows USVFS (in-process + standalone helper for Flatpak) - Proton/GE-Proton/umu-run launcher with env var forwarding - Flatpak support (sandbox-aware VFS, NXM handler, umu-run) - Wine prefix management UI - Case-insensitive path resolution for Linux filesystems - QSettings-safe INI handling (avoids Bethesda INI corruption) - Portable instance support with auto-generated launcher scripts Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'libs/plugin_python/tests/runner/CMakeLists.txt')
-rw-r--r--libs/plugin_python/tests/runner/CMakeLists.txt65
1 files changed, 65 insertions, 0 deletions
diff --git a/libs/plugin_python/tests/runner/CMakeLists.txt b/libs/plugin_python/tests/runner/CMakeLists.txt
new file mode 100644
index 0000000..ea17438
--- /dev/null
+++ b/libs/plugin_python/tests/runner/CMakeLists.txt
@@ -0,0 +1,65 @@
+cmake_minimum_required(VERSION 3.22)
+
+# setting-up the tests for the runner is a bit complex because we need a tons of
+# things
+
+# first we configure the tests as with other tests
+add_executable(runner-tests EXCLUDE_FROM_ALL)
+mo2_default_source_group()
+mo2_target_sources(runner-tests
+ FOLDER src
+ PRIVATE
+ test_diagnose.cpp
+ test_filemapper.cpp
+ test_game.cpp
+ test_installer.cpp
+ test_iplugin.cpp
+ test_lifetime.cpp
+)
+mo2_target_sources(runner-tests
+ FOLDER src/mocks
+ PRIVATE
+ ../mocks/DummyFileTree.h
+ ../mocks/MockOrganizer.h
+)
+mo2_target_sources(runner-tests
+ FOLDER src/plugins
+ PRIVATE
+ plugins/dummy-diagnose.py
+ plugins/dummy-filemapper.py
+ plugins/dummy-game.py
+ plugins/dummy-installer.py
+ plugins/dummy-iplugin.py
+)
+mo2_configure_tests(runner-tests NO_SOURCES WARNINGS 4)
+
+set_target_properties(runner-tests PROPERTIES FOLDER tests/runner)
+
+# link to runner
+target_link_libraries(runner-tests PUBLIC runner)
+
+# linking to Python - this is not required to get proper linking but required so that
+# CMake generator variables will lookup appropriate DLLs for Python and update PATH
+# accordingly thanks to mo2_configure_tests
+target_link_libraries(runner-tests PUBLIC Python::Python)
+
+# add mocks
+target_include_directories(runner-tests
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../mocks)
+
+set(PYLIB_DIR ${CMAKE_CURRENT_BINARY_DIR}/pylibs)
+mo2_python_pip_install(runner-tests
+ DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/pylibs
+ PACKAGES
+ pytest
+ PyQt${MO2_QT_VERSION_MAJOR}==${MO2_PYQT_VERSION}
+ PyQt${MO2_QT_VERSION_MAJOR}-Qt${MO2_QT_VERSION_MAJOR}==${MO2_QT_VERSION})
+
+add_dependencies(runner-tests mobase)
+
+set(PYTHONPATH "${PYLIB_DIR}\\;$<TARGET_FILE_DIR:mobase>\\;${Python_DLL_DIR}\\;${Python_LIB_DIR}")
+
+set_tests_properties(${runner-tests_gtests}
+ PROPERTIES
+ ENVIRONMENT "PLUGIN_DIR=${CMAKE_CURRENT_SOURCE_DIR}/plugins;PYTHONPATH=${PYTHONPATH}"
+)