Initialize catch-2 based unit tests

This commit is contained in:
Wunkolo 2024-03-11 12:47:59 -07:00
parent 929019e76b
commit 4b6266e3f2
No known key found for this signature in database
2 changed files with 27 additions and 0 deletions

View file

@ -33,6 +33,7 @@ option(GPU_DEBUG_INFO "Enable additional GPU debugging info" OFF)
option(ENABLE_OPENGL "Enable OpenGL rendering backend" ON)
option(ENABLE_VULKAN "Enable Vulkan rendering backend" ON)
option(ENABLE_LTO "Enable link-time optimization" OFF)
option(ENABLE_TESTS "Compile unit-tests" OFF)
option(ENABLE_USER_BUILD "Make a user-facing build. These builds have various assertions disabled, LTO, and more" OFF)
option(ENABLE_HTTP_SERVER "Enable HTTP server. Used for Discord bot support" OFF)
option(ENABLE_DISCORD_RPC "Compile with Discord RPC support (disabled by default)" ON)
@ -520,3 +521,19 @@ endif()
if(ENABLE_LTO OR ENABLE_USER_BUILD)
set_target_properties(Alber PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
if(ENABLE_TESTS)
enable_testing()
find_package(Catch2 3 REQUIRED)
add_executable(AlberTests
tests/dynapica.cpp
)
target_link_libraries(
AlberTests
PRIVATE
Catch2::Catch2WithMain
AlberCore
)
add_test(AlberTests AlberTests)
endif()

10
tests/dynapica.cpp Normal file
View file

@ -0,0 +1,10 @@
#include <PICA/dynapica/shader_rec.hpp>
#include <catch2/catch_approx.hpp>
#include <catch2/catch_test_macros.hpp>
#include "PICA/shader.hpp"
#if defined(PANDA3DS_SHADER_JIT_SUPPORTED)
TEST_CASE("Test", "[shader][dynapica]") {}
#endif