From 6d682afe2420910e05918a4ec0b5d7ad12dd2fa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hatvani=20Tam=C3=A1s?= Date: Wed, 4 Mar 2026 20:10:19 +0100 Subject: [PATCH] added catch2 testing framework as submodule --- .gitmodules | 3 +++ CMakeLists.txt | 11 +++++++++++ SakuraVNE/test/test.cpp | 1 + libs/catch2 | 1 + 4 files changed, 16 insertions(+) create mode 100644 SakuraVNE/test/test.cpp create mode 160000 libs/catch2 diff --git a/.gitmodules b/.gitmodules index 8942f2a..9ed2ad8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -15,3 +15,6 @@ path = libs/sdl3 url = https://github.com/libsdl-org/SDL.git branch = main +[submodule "libs/catch2"] + path = libs/catch2 + url = https://github.com/catchorg/Catch2.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 88e6d0a..0884798 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,17 @@ add_subdirectory(libs/spdlog) add_subdirectory(libs/imgui) add_subdirectory(libs/imgui-node-editor) +# 4. Catch2 +# Testing framework +add_subdirectory(libs/catch2) +# These tests can use the Catch2-provided main +add_executable(tests SakuraVNE/test/test.cpp) +target_link_libraries(tests PRIVATE Catch2::Catch2WithMain) + +# These tests need their own main +# add_executable(custom-main-tests test.cpp test-main.cpp) +# target_link_libraries(custom-main-tests PRIVATE Catch2::Catch2) + # ------------------------------------------------------------------------------ # SakuraVNE Executable Target # ------------------------------------------------------------------------------ diff --git a/SakuraVNE/test/test.cpp b/SakuraVNE/test/test.cpp new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/SakuraVNE/test/test.cpp @@ -0,0 +1 @@ + diff --git a/libs/catch2 b/libs/catch2 new file mode 160000 index 0000000..50e9dbf --- /dev/null +++ b/libs/catch2 @@ -0,0 +1 @@ +Subproject commit 50e9dbfc4e17d5a26a53584c3fc66facf4197192