2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-20 02:32:13 +00:00

Allow subsetting the set of Boost libraries to test in CMake via BOOST_TEST_LIBRARIES

[SVN r52851]
This commit is contained in:
Douglas Gregor
2009-05-08 14:55:00 +00:00
parent 9a4abf83c6
commit 5d8b48b6c6
2 changed files with 17 additions and 1 deletions

View File

@@ -313,7 +313,20 @@ macro(boost_library_project LIBNAME)
if(BUILD_TESTING AND THIS_PROJECT_TESTDIRS)
# Testing is enabled globally and this project has some
# tests. So, include the tests
# tests. Check whether we should include these tests.
if (BOOST_TEST_LIBRARIES)
set(SAVED_TESTDIRS ${THIS_PROJECT_TESTDIRS})
set(THIS_PROJECT_TESTDIRS)
foreach (TESTLIB ${BOOST_TEST_LIBRARIES})
if (${TESTLIB} STREQUAL ${libname})
# We are allowed to test this library; restore the set of
# test directories for this library.
set(THIS_PROJECT_TESTDIRS ${SAVED_TESTDIRS})
endif()
endforeach ()
endif()
# Include the test directories.
foreach(SUBDIR ${THIS_PROJECT_TESTDIRS})
add_subdirectory(${SUBDIR})
endforeach()

View File

@@ -43,6 +43,9 @@ if (BUILD_TESTING)
enable_testing()
option(TEST_INSTALLED_TREE "Enable testing of an already-installed tree" OFF)
set(BOOST_TEST_LIBRARIES ""
CACHE STRING "Semicolon-separated list of Boost libraries to test")
if (TEST_INSTALLED_TREE)
include("${CMAKE_INSTALL_PREFIX}/lib/Boost${BOOST_VERSION}/boost-targets.cmake")