aboutsummaryrefslogtreecommitdiff
path: root/libs/usvfs/test/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/usvfs/test/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/usvfs/test/CMakeLists.txt')
-rw-r--r--libs/usvfs/test/CMakeLists.txt74
1 files changed, 74 insertions, 0 deletions
diff --git a/libs/usvfs/test/CMakeLists.txt b/libs/usvfs/test/CMakeLists.txt
new file mode 100644
index 0000000..c34b31f
--- /dev/null
+++ b/libs/usvfs/test/CMakeLists.txt
@@ -0,0 +1,74 @@
+cmake_minimum_required(VERSION 3.16)
+
+include(CMakeParseArguments)
+
+#! usvfs_set_test_properties
+#
+# this function sets the following properties on the given executable or shared
+# library test target:
+# - OUTPUT_NAME to add arch-specific prefix
+# - OUTPUT_DIRECTORY to put the test executable or shared library in the right location
+# - FOLDER to organize the VS solution layout
+#
+# \param:FOLDER if present, specifies the subfolder to use in the solution
+#
+function(usvfs_set_test_properties TARGET)
+ cmake_parse_arguments(USVFS_TEST "" "FOLDER" "" ${ARGN})
+ if (NOT DEFINED USVFS_TEST_FOLDER)
+ set(folder "tests")
+ else()
+ set(folder "tests/${USVFS_TEST_FOLDER}")
+ endif()
+ set_target_properties(${TARGET}
+ PROPERTIES
+ FOLDER ${folder}
+ RUNTIME_OUTPUT_NAME ${TARGET}${ARCH_POSTFIX}
+ RUNTIME_OUTPUT_DIRECTORY_DEBUG ${USVFS_TEST_BINDIR}
+ RUNTIME_OUTPUT_DIRECTORY_RELEASE ${USVFS_TEST_BINDIR}
+ RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${USVFS_TEST_BINDIR}
+ )
+endfunction()
+
+#! usvfs_target_link_usvfs
+#
+# add a target link between the given target and the usvfs shared library with delay
+# loading
+#
+function(usvfs_target_link_usvfs TARGET)
+ target_link_libraries(${TARGET} PRIVATE usvfs_dll)
+ target_link_options(${TARGET} PRIVATE "/DELAYLOAD:usvfs${ARCH_POSTFIX}.dll")
+endfunction()
+
+
+file(GLOB directories LIST_DIRECTORIES true "*")
+
+# this goes through all the directories and
+#
+# 1. add them if there is a CMakeLists.txt inside
+# 2. add correspondings tests (for CTest) for BOTH x86 and x64 when possible
+#
+foreach(directory ${directories})
+ if(NOT(IS_DIRECTORY ${directory}))
+ continue()
+ endif()
+
+ if(NOT(EXISTS ${directory}/CMakeLists.txt))
+ continue()
+ endif()
+
+ add_subdirectory(${directory})
+
+ get_filename_component(dirname ${directory} NAME)
+ if((dirname STREQUAL "test_utils") OR (dirname STREQUAL "gtest_utils"))
+ continue()
+ endif()
+
+ add_test(NAME ${dirname}_x64
+ COMMAND ${USVFS_TEST_BINDIR}/${dirname}_x64.exe
+ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+ )
+ add_test(NAME ${dirname}_x86
+ COMMAND ${USVFS_TEST_BINDIR}/${dirname}_x86.exe
+ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+ )
+endforeach()