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