Skip to content

Commit

Permalink
Adding CTest to CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
cliffg-softwarelibre committed Apr 21, 2024
1 parent 9a7a0b3 commit 5441d0f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 10 additions & 2 deletions examples/intro_generic_programming/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,20 @@ set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
project(intro_generic_programming)

# add executable
add_executable(intro_generic_programming intro_generic_programming_test.cpp)
add_executable(intro_generic_programming_test intro_generic_programming_test.cpp)

# add dependencies
include(../../cmake/download_cpm.cmake)

CPMAddPackage("gh:catchorg/[email protected]")

# link dependencies
target_link_libraries(intro_generic_programming Catch2::Catch2WithMain)
target_link_libraries(intro_generic_programming_test Catch2::Catch2WithMain)

enable_testing()

add_test(NAME run_intro_generic_programming_test COMMAND intro_generic_programming_test)
set_tests_properties(run_intro_generic_programming_test
PROPERTIES PASS_REGULAR_EXPRESSION "All tests passed"
)

Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,5 @@ TEST_CASE ("Non type template parm intro", "[non_type_template_parm_intro]") {
delete [] my_arr3;
}



0 comments on commit 5441d0f

Please sign in to comment.