Skip to content

Commit

Permalink
Add tests-quick and check-quick targets
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Dec 16, 2023
1 parent ff2f83e commit fd3c39d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/BoostRoot.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ if(CMAKE_SOURCE_DIR STREQUAL Boost_SOURCE_DIR)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure --no-tests=error -C $<CONFIG>)
add_dependencies(check tests)

if(NOT TARGET tests-quick)
add_custom_target(tests-quick)
endif()

add_custom_target(check-quick COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure --no-tests=error -C $<CONFIG> -R quick)
add_dependencies(check-quick tests-quick)

# link=static|shared
option(BUILD_SHARED_LIBS "Build shared libraries")

Expand Down
20 changes: 20 additions & 0 deletions include/BoostTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ function(boost_test)
add_custom_target(tests)
endif()

if(NOT TARGET tests-quick)
add_custom_target(tests-quick)
endif()

if(__TYPE STREQUAL "compile")

add_library(${__NAME} STATIC EXCLUDE_FROM_ALL ${BOOST_TEST_SOURCES})
Expand All @@ -161,6 +165,10 @@ function(boost_test)

add_dependencies(tests ${__NAME})

if("${__NAME}" MATCHES "quick")
add_dependencies(tests-quick ${__NAME})
endif()

elseif(__TYPE STREQUAL "compile-fail")

add_library(${__NAME} STATIC EXCLUDE_FROM_ALL ${BOOST_TEST_SOURCES})
Expand All @@ -183,6 +191,10 @@ function(boost_test)

add_dependencies(tests ${__NAME})

if("${__NAME}" MATCHES "quick")
add_dependencies(tests-quick ${__NAME})
endif()

elseif(__TYPE STREQUAL "link-fail")

add_library(compile-${__NAME} OBJECT EXCLUDE_FROM_ALL ${BOOST_TEST_SOURCES})
Expand All @@ -193,6 +205,10 @@ function(boost_test)

add_dependencies(tests compile-${__NAME})

if("${__NAME}" MATCHES "quick")
add_dependencies(tests-quick compile-${__NAME})
endif()

add_executable(${__NAME} EXCLUDE_FROM_ALL $<TARGET_OBJECTS:compile-${__NAME}>)
target_link_libraries(${__NAME} ${BOOST_TEST_LINK_LIBRARIES})
target_compile_definitions(${__NAME} PRIVATE ${BOOST_TEST_COMPILE_DEFINITIONS})
Expand All @@ -212,6 +228,10 @@ function(boost_test)

add_dependencies(tests ${__NAME})

if("${__NAME}" MATCHES "quick")
add_dependencies(tests-quick ${__NAME})
endif()

add_test(NAME ${__TYPE}-${__NAME} COMMAND ${__NAME} ${__ARGUMENTS})

if(__TYPE STREQUAL "run-fail")
Expand Down

0 comments on commit fd3c39d

Please sign in to comment.