From e9c8103b759c2ef5beafb514e8275760de5fddd5 Mon Sep 17 00:00:00 2001 From: Mathew Benson Date: Sun, 5 Apr 2026 23:51:14 +0300 Subject: [PATCH] Enable CMake's CTest Functionality and Update FMT - Enable the testing machinery and enumerate the tests using CMake - This enables testing using the CTest Command - CMakeLists.txt Cleanup - Change the fmt lib base branch which changed from master to main --- CMakeLists.txt | 11 ++++++++--- ZEngine/tests/CMakeLists.txt | 5 +++++ dependencies.cmake | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ef3e8f0..6a28b597 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,11 +40,16 @@ list( APPEND CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib ) # if (NOT LAUNCHER_ONLY) - ## Setup Dependencies - include(dependencies.cmake) + # Enable CMake's CTest Functionality + # + include(CTest) - ## Compile Shaders + # Setup Dependencies + # + include(dependencies.cmake) + # Compile Shaders + # add_subdirectory (Resources) # Core engine lib is here diff --git a/ZEngine/tests/CMakeLists.txt b/ZEngine/tests/CMakeLists.txt index b9449a38..6e1b3a12 100644 --- a/ZEngine/tests/CMakeLists.txt +++ b/ZEngine/tests/CMakeLists.txt @@ -17,3 +17,8 @@ set_target_properties(ZEngineTests PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREF install(TARGETS ZEngineTests RUNTIME DESTINATION tests) + +if(BUILD_TESTING) + include(GoogleTest) + gtest_discover_tests(ZEngineTests) +endif() diff --git a/dependencies.cmake b/dependencies.cmake index 1ba957ef..bc7b778a 100644 --- a/dependencies.cmake +++ b/dependencies.cmake @@ -4,6 +4,7 @@ FetchContent_Declare( fmt GIT_REPOSITORY https://github.com/fmtlib/fmt.git GIT_SHALLOW TRUE + GIT_TAG main ) FetchContent_Declare(