This commit is contained in:
Gerard Gascón 2025-06-08 00:21:41 +02:00
commit 2f3a28e89c
10 changed files with 150 additions and 0 deletions

7
test/CMakeLists.txt Normal file
View file

@ -0,0 +1,7 @@
find_package(Catch2 3 REQUIRED)
add_executable(test test.cpp)
target_link_libraries(test PRIVATE Catch2::Catch2WithMain)
target_link_libraries(test PRIVATE src)

1
test/Catch2 Submodule

@ -0,0 +1 @@
Subproject commit 3013cb897b5706e8532507cb2b6ac33e1fc35d93

10
test/test.cpp Normal file
View file

@ -0,0 +1,10 @@
#include <catch2/catch_test_macros.hpp>
#include "library.h"
TEST_CASE("This test should pass") {
REQUIRE(hello() == 0);
}
TEST_CASE("This test should fail") {
REQUIRE(hello() == 1);
}