From 20ec7479df4ae5427aa0009cad1e25f15706aebe Mon Sep 17 00:00:00 2001 From: parker Date: Thu, 19 Jun 2025 00:21:40 +0100 Subject: [PATCH] feat: add catch2 tests --- CMakeLists.txt | 15 ++++++++++++--- tests/main-tests.cpp | 6 ++++++ 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 tests/main-tests.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index a40e204..fad36dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,20 @@ 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) qt_standard_project_setup() -qt_add_executable(test + +qt_add_executable(${AppExec} 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) diff --git a/tests/main-tests.cpp b/tests/main-tests.cpp new file mode 100644 index 0000000..124c2de --- /dev/null +++ b/tests/main-tests.cpp @@ -0,0 +1,6 @@ +#include + +TEST_CASE("foo") +{ + REQUIRE(1==1); +}