aboutsummaryrefslogtreecommitdiff
path: root/libs/plugin_python/tests/python/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/python/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/python/CMakeLists.txt')
-rw-r--r--libs/plugin_python/tests/python/CMakeLists.txt75
1 files changed, 75 insertions, 0 deletions
diff --git a/libs/plugin_python/tests/python/CMakeLists.txt b/libs/plugin_python/tests/python/CMakeLists.txt
new file mode 100644
index 0000000..f473373
--- /dev/null
+++ b/libs/plugin_python/tests/python/CMakeLists.txt
@@ -0,0 +1,75 @@
+cmake_minimum_required(VERSION 3.16)
+
+# pytest
+cmake_policy(SET CMP0144 NEW)
+
+find_package(mo2-uibase CONFIG REQUIRED)
+find_package(GTest REQUIRED)
+
+set(PYLIB_DIR ${CMAKE_CURRENT_BINARY_DIR}/pylibs)
+
+set(UIBASE_PATH $<TARGET_FILE_DIR:mo2::uibase>)
+
+add_custom_target(python-tests)
+target_sources(python-tests
+ PRIVATE
+ conftest.py
+ test_argument_wrapper.py
+ test_filetree.py
+ test_functional.py
+ test_guessed_string.py
+ test_organizer.py
+ test_path_wrappers.py
+ test_qt_widgets.py
+ test_qt.py
+ test_shared_cpp_owner.py
+)
+
+add_test(NAME pytest
+ COMMAND ${CMAKE_CURRENT_BINARY_DIR}/pylibs/bin/pytest.exe ${CMAKE_CURRENT_SOURCE_DIR} -s
+)
+
+set_tests_properties(pytest
+ PROPERTIES
+ DEPENDS python-tests
+ ENVIRONMENT_MODIFICATION
+ "PYTHONPATH=set:${PYLIB_DIR}\\;$<TARGET_FILE_DIR:mobase>;\
+UIBASE_PATH=set:${UIBASE_PATH}"
+)
+
+mo2_python_pip_install(python-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(python-tests mobase)
+set_target_properties(python-tests PROPERTIES FOLDER tests/python)
+
+file(GLOB test_files CONFIGURE_DEPENDS "test_*.cpp")
+foreach (test_file ${test_files})
+ get_filename_component(target ${test_file} NAME_WLE)
+
+ string(REPLACE "test_" "" pymodule ${target})
+ pybind11_add_module(${target} EXCLUDE_FROM_ALL THIN_LTO ${test_file})
+ set_target_properties(${target}
+ PROPERTIES
+ CXX_STANDARD 23
+ OUTPUT_NAME ${pymodule}
+ FOLDER tests/python
+ LIBRARY_OUTPUT_DIRECTORY "${PYLIB_DIR}/mobase_tests")
+
+ if(DEFINED CMAKE_CONFIGURATION_TYPES)
+ foreach(config ${CMAKE_CONFIGURATION_TYPES})
+ string(TOUPPER ${config} config)
+ set_target_properties(${target} PROPERTIES
+ LIBRARY_OUTPUT_DIRECTORY_${config} "${PYLIB_DIR}/mobase_tests")
+ endforeach()
+ endif()
+
+ target_link_libraries(${target} PRIVATE
+ mo2::uibase Qt6::Core Qt6::Widgets pybind11::qt pybind11::utils GTest::gmock)
+
+ target_include_directories(${target}
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../mocks)
+ add_dependencies(python-tests ${target})
+endforeach()