Skip to content

Commit bdb66eb

Browse files
Move test_include_paths configuration to the test folder
- Relocated the test_include_paths executable setup from the root CMakeLists.txt to the test folder's CMakeLists.txt. - Included the necessary doctest package configuration and non-standard include paths. - Ensured proper target linking and definitions for the test_include_paths target.
1 parent 5c40221 commit bdb66eb

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

CMakeLists.txt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -408,19 +408,6 @@ endif()
408408
if(XEUS_CPP_BUILD_TESTS)
409409
enable_testing()
410410
add_subdirectory(test)
411-
412-
# Find doctest package
413-
find_package(doctest REQUIRED)
414-
415-
# Test for non-standard include paths
416-
add_executable(test_include_paths test/test_include_paths.cpp)
417-
target_link_libraries(test_include_paths PRIVATE doctest::doctest)
418-
target_include_directories(test_include_paths PRIVATE
419-
${CMAKE_SOURCE_DIR}/test/custom_includes
420-
${DOCTEST_INCLUDE_DIR}
421-
)
422-
target_compile_definitions(test_include_paths PRIVATE DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN)
423-
add_test(NAME test_include_paths COMMAND test_include_paths)
424411
endif()
425412

426413
# Installation

test/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@ target_include_directories(test_xeus_cpp PRIVATE ${XEUS_CPP_INCLUDE_DIR})
6868

6969
add_custom_target(xtest COMMAND test_xeus_cpp DEPENDS test_xeus_cpp)
7070

71+
# Test for non-standard include paths
72+
add_executable(test_include_paths test_include_paths.cpp)
73+
target_link_libraries(test_include_paths PRIVATE doctest::doctest)
74+
target_include_directories(test_include_paths PRIVATE
75+
${CMAKE_SOURCE_DIR}/test/custom_includes
76+
${DOCTEST_INCLUDE_DIR}
77+
)
78+
target_compile_definitions(test_include_paths PRIVATE DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN)
79+
add_test(NAME test_include_paths COMMAND test_include_paths)
80+
7181
set(XEUS_SEARCH_PATH $<JOIN:$<TARGET_PROPERTY:xeus-cpp,INCLUDE_DIRECTORIES>,:>)
7282

7383
if (NOT EMSCRIPTEN)

0 commit comments

Comments
 (0)