Skip to content

Commit

Permalink
replace boost test with catch2
Browse files Browse the repository at this point in the history
  • Loading branch information
mhekkel committed Mar 6, 2024
1 parent b3c1815 commit 24b51ab
Show file tree
Hide file tree
Showing 2 changed files with 129 additions and 104 deletions.
12 changes: 9 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
find_package(Boost REQUIRED)
find_package(Catch2 REQUIRED)

add_executable(mcfp-unit-test ${CMAKE_CURRENT_SOURCE_DIR}/unit-test.cpp)

target_link_libraries(mcfp-unit-test mcfp::mcfp Boost::boost)
target_link_libraries(mcfp-unit-test mcfp::mcfp)

if(${Catch2_VERSION} VERSION_GREATER_EQUAL 3.0.0)
target_compile_definitions(mcfp-unit-test PUBLIC CATCH22=0)
else()
target_compile_definitions(mcfp-unit-test PUBLIC CATCH22=1)
endif()

if(MSVC)
# Specify unwind semantics so that MSVC knowns how to handle exceptions
target_compile_options(mcfp-unit-test PRIVATE /EHsc)
endif()

add_test(NAME mcfp-unit-test
COMMAND $<TARGET_FILE:mcfp-unit-test> -- ${CMAKE_CURRENT_SOURCE_DIR})
COMMAND $<TARGET_FILE:mcfp-unit-test> --data-dir ${CMAKE_CURRENT_SOURCE_DIR})
Loading

0 comments on commit 24b51ab

Please sign in to comment.