feat: add catch2 tests

This commit is contained in:
parker
2025-06-19 00:21:40 +01:00
parent b56d4db1a8
commit 20ec7479df
2 changed files with 18 additions and 3 deletions

View File

@@ -1,11 +1,20 @@
cmake_minimum_required(VERSION 3.10) cmake_minimum_required(VERSION 3.10)
project(node) project(enzo_project)
set(AppExec enzo_gui)
set(TestExec tests)
find_package(Qt6 REQUIRED COMPONENTS Core Widgets) find_package(Qt6 REQUIRED COMPONENTS Core Widgets)
qt_standard_project_setup() qt_standard_project_setup()
qt_add_executable(test
qt_add_executable(${AppExec}
src/main.cpp src/main.cpp
) )
target_link_libraries(test PRIVATE Qt6::Core Qt6::Widgets) target_link_libraries(${AppExec} PRIVATE Qt6::Core Qt6::Widgets)
# tests
add_executable(${TestExec} tests/main-tests.cpp)
find_package(Catch2 3 REQUIRED)
target_link_libraries(${TestExec} PRIVATE Catch2::Catch2WithMain)

6
tests/main-tests.cpp Normal file
View File

@@ -0,0 +1,6 @@
#include <catch2/catch_test_macros.hpp>
TEST_CASE("foo")
{
REQUIRE(1==1);
}