Skip to content

Commit

Permalink
Move test_include_paths configuration to the test folder
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
AhmedFatthy1040 committed Dec 9, 2024
1 parent 5c40221 commit bdb66eb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
13 changes: 0 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -408,19 +408,6 @@ endif()
if(XEUS_CPP_BUILD_TESTS)
enable_testing()
add_subdirectory(test)

# Find doctest package
find_package(doctest REQUIRED)

# Test for non-standard include paths
add_executable(test_include_paths test/test_include_paths.cpp)
target_link_libraries(test_include_paths PRIVATE doctest::doctest)
target_include_directories(test_include_paths PRIVATE
${CMAKE_SOURCE_DIR}/test/custom_includes
${DOCTEST_INCLUDE_DIR}
)
target_compile_definitions(test_include_paths PRIVATE DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN)
add_test(NAME test_include_paths COMMAND test_include_paths)
endif()

# Installation
Expand Down
10 changes: 10 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ target_include_directories(test_xeus_cpp PRIVATE ${XEUS_CPP_INCLUDE_DIR})

add_custom_target(xtest COMMAND test_xeus_cpp DEPENDS test_xeus_cpp)

# Test for non-standard include paths
add_executable(test_include_paths test_include_paths.cpp)
target_link_libraries(test_include_paths PRIVATE doctest::doctest)
target_include_directories(test_include_paths PRIVATE
${CMAKE_SOURCE_DIR}/test/custom_includes
${DOCTEST_INCLUDE_DIR}
)
target_compile_definitions(test_include_paths PRIVATE DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN)
add_test(NAME test_include_paths COMMAND test_include_paths)

set(XEUS_SEARCH_PATH $<JOIN:$<TARGET_PROPERTY:xeus-cpp,INCLUDE_DIRECTORIES>,:>)

if (NOT EMSCRIPTEN)
Expand Down

0 comments on commit bdb66eb

Please sign in to comment.