test: add dummy tests

This commit is contained in:
Michael Mandl 2023-10-20 10:59:30 +02:00
parent 75d3fc3547
commit a286c514f5
Signed by: mandlm
GPG key ID: 4AA25D647AA54CC7
3 changed files with 28 additions and 0 deletions

14
tests/CMakeLists.txt Normal file
View file

@ -0,0 +1,14 @@
FetchContent_Declare(
catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.4.0)
FetchContent_MakeAvailable(catch2)
add_executable(dummy_tests dummy.cpp)
target_compile_features(dummy_tests PRIVATE cxx_std_20)
target_link_libraries(dummy_tests PRIVATE Catch2::Catch2WithMain)
include(Catch)
catch_discover_tests(dummy_tests)

4
tests/dummy.cpp Normal file
View file

@ -0,0 +1,4 @@
#include <catch2/catch_test_macros.hpp>
TEST_CASE("dummy", "dummy tests") { REQUIRE(1 + 1 == 2); }
TEST_CASE("dummy fails", "dummy tests") { REQUIRE_FALSE(1 + 1 != 2); }