Skip to content

Commit

Permalink
Move include
Browse files Browse the repository at this point in the history
  • Loading branch information
thbeu committed Mar 11, 2024
1 parent 5dd5f57 commit 3df250b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 23 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,12 @@ if(BUILD_TESTING)
${BASH_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tests/test3.sh ${PROJECT_SOURCE_DIR}/tests/expect3.out
)
declare_test_executable(test3 "dbfadd;dbfcreate;dbfdump;shpadd;shpcreate;shpdump")

include(CTest)

add_subdirectory(tests)
endif()

include(cmake/contrib.cmake)

add_subdirectory(cmake)
add_subdirectory(tests)
40 changes: 18 additions & 22 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
project(${CMAKE_PROJECT_NAME}Tests CXX)

include(CTest)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

if(BUILD_TESTING)
# Set up Catch2
include(FetchContent)
# Set up Catch2
include(FetchContent)

FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.5.3
)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.5.3
)

FetchContent_MakeAvailable(Catch2)
FetchContent_MakeAvailable(Catch2)

foreach(executable dbf_test)
add_executable(${executable} ${PROJECT_SOURCE_DIR}/${executable}.cc)
target_link_libraries(${executable} PRIVATE ${PACKAGE} Catch2::Catch2WithMain)
add_test(
NAME ${executable}
COMMAND ${executable}
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
)
set_target_properties(${executable} PROPERTIES FOLDER "tests")
endforeach()
endif()
foreach(executable dbf_test)
add_executable(${executable} ${PROJECT_SOURCE_DIR}/${executable}.cc)
target_link_libraries(${executable} PRIVATE ${PACKAGE} Catch2::Catch2WithMain)
add_test(
NAME ${executable}
COMMAND ${executable}
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
)
set_target_properties(${executable} PROPERTIES FOLDER "tests")
endforeach()

0 comments on commit 3df250b

Please sign in to comment.