From 860cea6004955c054034f2bf51e45c90a9db76ee Mon Sep 17 00:00:00 2001 From: Ian Roddis Date: Sun, 17 Oct 2021 17:25:33 -0300 Subject: [PATCH] Adding support for cmake test, breaking tests apart a bit for easier testing --- CMakeLists.txt | 1 + tests/CMakeLists.txt | 21 ++++++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c1fdd0..58f9498 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,6 +44,7 @@ set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") # which point to directories outside the build tree to the install RPATH set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) +enable_testing() add_subdirectory(daggy) add_subdirectory(tests) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 83618e0..3d54e2a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,5 +1,4 @@ -project(tests) -add_executable(tests main.cpp +add_executable(unit_tests main.cpp # unit tests unit_dag.cpp unit_dagrunner.cpp @@ -15,4 +14,20 @@ add_executable(tests main.cpp # Performance checks perf_dag.cpp ) -target_link_libraries(tests libdaggy stdc++fs Catch2::Catch2 curl) +target_link_libraries(unit_tests libdaggy stdc++fs Catch2::Catch2 curl) + +add_executable(integration_tests main.cpp + # unit tests + int_basic.cpp + ) +target_link_libraries(integration_tests libdaggy stdc++fs Catch2::Catch2 curl) + +add_executable(perf_tests main.cpp + # Performance checks + perf_dag.cpp + ) +target_link_libraries(perf_tests libdaggy stdc++fs Catch2::Catch2 curl) + +add_test(UNIT_TESTS ${CMAKE_BINARY_DIR}/tests/unit_tests) +add_test(INT_TESTS ${CMAKE_BINARY_DIR}/tests/integration_tests) +add_test(PERF_TESTS ${CMAKE_BINARY_DIR}/tests/perf_tests)