feat: add catch2 tests
This commit is contained in:
@@ -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
6
tests/main-tests.cpp
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#include <catch2/catch_test_macros.hpp>
|
||||||
|
|
||||||
|
TEST_CASE("foo")
|
||||||
|
{
|
||||||
|
REQUIRE(1==1);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user