Skip to content

Commit

Permalink
Update test/CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Nov 15, 2023
1 parent 7f9ca04 commit 3209276
Showing 1 changed file with 8 additions and 31 deletions.
39 changes: 8 additions & 31 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,36 +1,13 @@
#
# Copyright (c) 2019 Vinnie Falco ([email protected])
# Copyright (c) 2021 Richard Hodges ([email protected])
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Official repository: https://github.com/boostorg/json
#
# Copyright 2018, 2019 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt

file(GLOB_RECURSE BOOST_PROPERTY_TREE_TESTS_FILES CONFIGURE_DEPENDS Jamfile.v2 *.cpp *.hpp)
list(FILTER BOOST_PROPERTY_TREE_TESTS_FILES EXCLUDE REGEX "^${CMAKE_CURRENT_SOURCE_DIR}/cmake_install_test/.*$")
include(BoostTestJamfile OPTIONAL RESULT_VARIABLE HAVE_BOOST_TEST)

source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX "" FILES ${BOOST_PROPERTY_TREE_TESTS_FILES})
if(HAVE_BOOST_TEST)

if(NOT TARGET tests)
add_custom_target(tests)
endif()
boost_test_jamfile(FILE Jamfile.v2 LINK_LIBRARIES Boost::property_tree Boost::format Boost::foreach)

macro(PTREE_TEST name)
#message(STATUS "ptree_test ${PROJECT_NAME}-${name} SRCS ${ARGN}")
add_executable("${PROJECT_NAME}-${name}" ${ARGN})
target_include_directories("${PROJECT_NAME}-${name}" PRIVATE .)
target_link_libraries("${PROJECT_NAME}-${name}" PRIVATE Boost::property_tree Boost::serialization)
add_dependencies(tests "${PROJECT_NAME}-${name}")
add_test(NAME "${PROJECT_NAME}-${name}" COMMAND "${PROJECT_NAME}-${name}")
endmacro()
boost_test(TYPE run SOURCES test_property_tree.cpp LINK_LIBRARIES Boost::property_tree Boost::serialization)

PTREE_TEST(test-multi test_multi_module1.cpp test_multi_module2.cpp)
PTREE_TEST(test-property-tree test_property_tree.cpp test_property_tree.hpp)
PTREE_TEST(test-info-parser test_info_parser.cpp)
PTREE_TEST(test-rapidxml test_rapidxml.cpp)
PTREE_TEST(test-json-parser test_json_parser.cpp)
PTREE_TEST(test-json-parser2 test_json_parser2.cpp)
PTREE_TEST(test-ini-parser test_ini_parser.cpp)
PTREE_TEST(test-xml-parser-rapidxml test_xml_parser_rapidxml.cpp)
endif()

0 comments on commit 3209276

Please sign in to comment.