From e4e7f74061b1a9c24205ca4b8c4c145ea7ba1f8e Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Mon, 7 Apr 2025 22:21:13 +0800 Subject: [PATCH 1/8] cmake: fix build warnings on windows (#444) --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 817bd0c3b1..bd7af42838 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,10 @@ function(boost_test_add_library name) # PRIVATE BOOST_TEST_SOURCE ) + if(WIN32) + target_compile_definitions(boost_${name} PRIVATE _CRT_SECURE_NO_WARNINGS) + endif() + if(BUILD_SHARED_LIBS) target_compile_definitions(boost_${name} PUBLIC BOOST_TEST_DYN_LINK) else() From a5e435df965c0541d17274c9d7d7a63ac01156ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Ferdinand=20Rivera=20Morell?= Date: Mon, 7 Apr 2025 09:21:41 -0500 Subject: [PATCH 2/8] Add support for modular build structure. (#426) * Make the library modular usable. * Switch to library requirements instead of source. As source puts extra source in install targets. * Remove uses of BOOST_ROOT in Jamfiles. * Add missing NO_LIB usage requirements. * Add missing import-search for cconfig/predef checks. * Add requires-b2 check to top-level build file. * Bump B2 require to 5.2 * Change all references to . * Update copyright dates. * Move inter-lib dependencies to a project variable and into the build targets. * Add included target to mirror build//* targets. * Add missing import-search. * Change Boost Test build refs to work with both old and modular test lib targets. * Update build deps. * Update UBSAN CI run --------- Co-authored-by: Matt Borland --- .github/workflows/ci.yml | 8 +- Jamfile.v2 | 9 --- build.jam | 60 +++++++++++++++ build/Jamfile.v2 | 12 ++- doc/Jamfile.v2 | 106 ++++++++++++++------------- example/Jamfile.v2 | 12 +-- test/Jamfile.v2 | 37 +++++----- tools/console_test_runner/Jamfile.v2 | 22 +++--- 8 files changed, 161 insertions(+), 105 deletions(-) delete mode 100644 Jamfile.v2 create mode 100644 build.jam diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92efb3a048..056a62cda6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,13 +110,13 @@ jobs: install: - g++-12-multilib - name: UBSAN - toolset: gcc-12 - cxxstd: "17" + toolset: gcc-13 + cxxstd: "11" address_model: 64 ubsan: 1 - os: ubuntu-22.04 + os: ubuntu-24.04 install: - - g++-12-multilib + - g++-13-multilib # Linux, clang - toolset: clang diff --git a/Jamfile.v2 b/Jamfile.v2 deleted file mode 100644 index cc332e119a..0000000000 --- a/Jamfile.v2 +++ /dev/null @@ -1,9 +0,0 @@ -# (C) Copyright Juergen Hunold 2006-2010. -# Use, modification, and distribution are subject to 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) -# -# See http://www.boost.org/libs/test for the library home page. - -build-project example ; -build-project test ; diff --git a/build.jam b/build.jam new file mode 100644 index 0000000000..dd6db1f895 --- /dev/null +++ b/build.jam @@ -0,0 +1,60 @@ +# Copyright René Ferdinand Rivera Morell 2023-2024 +# 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) + +require-b2 5.2 ; + +constant boost_dependencies : + /boost/algorithm//boost_algorithm + /boost/assert//boost_assert + /boost/bind//boost_bind + /boost/config//boost_config + /boost/core//boost_core + /boost/detail//boost_detail + /boost/exception//boost_exception + /boost/function//boost_function + /boost/io//boost_io + /boost/iterator//boost_iterator + /boost/mpl//boost_mpl + /boost/numeric_conversion//boost_numeric_conversion + /boost/optional//boost_optional + /boost/preprocessor//boost_preprocessor + /boost/smart_ptr//boost_smart_ptr + /boost/static_assert//boost_static_assert + /boost/type_traits//boost_type_traits + /boost/utility//boost_utility ; + +project /boost/test + : common-requirements + include + ; + +explicit + [ alias boost_test : : : : $(boost_dependencies) ] + [ alias boost_prg_exec_monitor : build//boost_prg_exec_monitor ] + [ alias boost_test_exec_monitor : build//boost_test_exec_monitor ] + [ alias boost_unit_test_framework : build//boost_unit_test_framework ] + [ alias prg_exec_monitor : boost_prg_exec_monitor ] + [ alias test_exec_monitor : boost_test_exec_monitor ] + [ alias unit_test_framework : boost_unit_test_framework ] + [ alias boost_included_prg_exec_monitor : : : : $(boost_dependencies) ] + [ alias boost_included_test_exec_monitor : : : : $(boost_dependencies) ] + [ alias boost_included_unit_test_framework : : : : $(boost_dependencies) ] + [ alias included : : : : $(boost_dependencies) ] + [ alias included_prg_exec_monitor : boost_included_prg_exec_monitor ] + [ alias included_test_exec_monitor : boost_included_test_exec_monitor ] + [ alias included_unit_test_framework : boost_included_unit_test_framework ] + [ alias all : example test + boost_prg_exec_monitor + boost_test_exec_monitor + boost_unit_test_framework ] + ; + +call-if : boost-library test + : install + boost_prg_exec_monitor + boost_test_exec_monitor + boost_unit_test_framework + ; + diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 80ba99f689..5838c6bcab 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -6,12 +6,14 @@ import os ; -import ../../predef/tools/check/predef +import-search /boost/predef/tools/check ; +import predef : check : predef-check ; -project boost/test +project : source-location ../src + : common-requirements $(boost_dependencies) : requirements shared:BOOST_TEST_DYN_LINK=1 borland:-w-8080 cygwin:_POSIX_C_SOURCE=200112L @@ -26,7 +28,7 @@ project boost/test # on : usage-requirements - BOOST_TEST_NO_AUTO_LINK=1 + BOOST_TEST_NO_LIB=1 # Disable Warning about boost::noncopyable not being exported shared,msvc:-wd4275 ; @@ -113,7 +115,3 @@ lib boost_unit_test_framework alias minimal ; alias included ; - -boost-install boost_prg_exec_monitor - boost_test_exec_monitor - boost_unit_test_framework ; diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index e864d5b181..43690e8b5d 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -14,80 +14,82 @@ using boostbook ; import doxygen ; +path-constant TEST_ROOT : .. ; + doxygen doxygen_reference_generated_doc : - $(BOOST_ROOT)/libs/test/include/boost/test/debug_config.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/detail/global_typedef.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/debug.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/execution_monitor.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/framework.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/tools/assertion_result.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/unit_test.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/tree/observer.hpp + $(TEST_ROOT)/include/boost/test/debug_config.hpp + $(TEST_ROOT)/include/boost/test/detail/global_typedef.hpp + $(TEST_ROOT)/include/boost/test/debug.hpp + $(TEST_ROOT)/include/boost/test/execution_monitor.hpp + $(TEST_ROOT)/include/boost/test/framework.hpp + $(TEST_ROOT)/include/boost/test/tools/assertion_result.hpp + $(TEST_ROOT)/include/boost/test/unit_test.hpp + $(TEST_ROOT)/include/boost/test/tree/observer.hpp # logs and formatters - $(BOOST_ROOT)/libs/test/include/boost/test/unit_test_log.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/output/xml_log_formatter.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/output/plain_report_formatter.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/output/compiler_log_formatter.hpp + $(TEST_ROOT)/include/boost/test/unit_test_log.hpp + $(TEST_ROOT)/include/boost/test/output/xml_log_formatter.hpp + $(TEST_ROOT)/include/boost/test/output/plain_report_formatter.hpp + $(TEST_ROOT)/include/boost/test/output/compiler_log_formatter.hpp # reports - $(BOOST_ROOT)/libs/test/include/boost/test/output/xml_report_formatter.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/unit_test_log_formatter.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/results_reporter.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/results_collector.hpp + $(TEST_ROOT)/include/boost/test/output/xml_report_formatter.hpp + $(TEST_ROOT)/include/boost/test/unit_test_log_formatter.hpp + $(TEST_ROOT)/include/boost/test/results_reporter.hpp + $(TEST_ROOT)/include/boost/test/results_collector.hpp # progress monitor - $(BOOST_ROOT)/libs/test/include/boost/test/progress_monitor.hpp + $(TEST_ROOT)/include/boost/test/progress_monitor.hpp # test cases and suites - $(BOOST_ROOT)/libs/test/include/boost/test/tree/test_unit.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/parameterized_test.hpp + $(TEST_ROOT)/include/boost/test/tree/test_unit.hpp + $(TEST_ROOT)/include/boost/test/parameterized_test.hpp # execution monitor source files - $(BOOST_ROOT)/libs/test/include/boost/test/execution_monitor.hpp + $(TEST_ROOT)/include/boost/test/execution_monitor.hpp # output test stream - $(BOOST_ROOT)/libs/test/include/boost/test/tools/output_test_stream.hpp + $(TEST_ROOT)/include/boost/test/tools/output_test_stream.hpp # datasets - $(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/fwd.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/data/test_case.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/data/for_each_sample.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/data/size.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/delayed.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/initializer_list.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/array.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/collection.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/generate.hpp - - - $(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/grid.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/join.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/singleton.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/zip.hpp + $(TEST_ROOT)/include/boost/test/data/monomorphic/fwd.hpp + $(TEST_ROOT)/include/boost/test/data/test_case.hpp + $(TEST_ROOT)/include/boost/test/data/for_each_sample.hpp + $(TEST_ROOT)/include/boost/test/data/size.hpp + $(TEST_ROOT)/include/boost/test/data/monomorphic/delayed.hpp + $(TEST_ROOT)/include/boost/test/data/monomorphic/initializer_list.hpp + $(TEST_ROOT)/include/boost/test/data/monomorphic/array.hpp + $(TEST_ROOT)/include/boost/test/data/monomorphic/collection.hpp + $(TEST_ROOT)/include/boost/test/data/monomorphic/generate.hpp + + + $(TEST_ROOT)/include/boost/test/data/monomorphic/grid.hpp + $(TEST_ROOT)/include/boost/test/data/monomorphic/join.hpp + $(TEST_ROOT)/include/boost/test/data/monomorphic/singleton.hpp + $(TEST_ROOT)/include/boost/test/data/monomorphic/zip.hpp # datasets generators - $(BOOST_ROOT)/libs/test/include/boost/test/data/config.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/generators.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/generators/keywords.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/generators/random.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/generators/xrange.hpp + $(TEST_ROOT)/include/boost/test/data/config.hpp + $(TEST_ROOT)/include/boost/test/data/monomorphic/generators.hpp + $(TEST_ROOT)/include/boost/test/data/monomorphic/generators/keywords.hpp + $(TEST_ROOT)/include/boost/test/data/monomorphic/generators/random.hpp + $(TEST_ROOT)/include/boost/test/data/monomorphic/generators/xrange.hpp # utils - $(BOOST_ROOT)/libs/test/include/boost/test/utils/algorithm.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/utils/named_params.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/tools/floating_point_comparison.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/utils/is_forward_iterable.hpp + $(TEST_ROOT)/include/boost/test/utils/algorithm.hpp + $(TEST_ROOT)/include/boost/test/utils/named_params.hpp + $(TEST_ROOT)/include/boost/test/tools/floating_point_comparison.hpp + $(TEST_ROOT)/include/boost/test/utils/is_forward_iterable.hpp # BOOST_TEST related functions - $(BOOST_ROOT)/libs/test/include/boost/test/tools/detail/bitwise_manip.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/tools/detail/lexicographic_manip.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/tools/detail/per_element_manip.hpp - $(BOOST_ROOT)/libs/test/include/boost/test/tools/detail/tolerance_manip.hpp + $(TEST_ROOT)/include/boost/test/tools/detail/bitwise_manip.hpp + $(TEST_ROOT)/include/boost/test/tools/detail/lexicographic_manip.hpp + $(TEST_ROOT)/include/boost/test/tools/detail/per_element_manip.hpp + $(TEST_ROOT)/include/boost/test/tools/detail/tolerance_manip.hpp # others - $(BOOST_ROOT)/libs/test/include/boost/test/unit_test_parameters.hpp + $(TEST_ROOT)/include/boost/test/unit_test_parameters.hpp : EXTRACT_ALL=YES "PREDEFINED=\"BOOST_TEST_DECL=\" \\ @@ -102,8 +104,8 @@ doxygen doxygen_reference_generated_doc MACRO_EXPANSION=YES EXPAND_ONLY_PREDEF=YES SEARCH_INCLUDES=YES - INCLUDE_PATH=$(BOOST_ROOT)/libs/test/include - EXAMPLE_PATH=$(BOOST_ROOT)/libs/test/doc/examples + INCLUDE_PATH=$(TEST_ROOT)/include + EXAMPLE_PATH=$(TEST_ROOT)/doc/examples BRIEF_MEMBER_DESC=YES REPEAT_BRIEF=YES ALWAYS_DETAILED_SEC=YES diff --git a/example/Jamfile.v2 b/example/Jamfile.v2 index 806b42e121..8e41b6e7df 100644 --- a/example/Jamfile.v2 +++ b/example/Jamfile.v2 @@ -11,7 +11,8 @@ import testing ; import os ; # requirements -import ../../config/checks/config : requires ; +import-search /boost/config/checks ; +import config : requires ; local HAS_UBSAN = "NO_UBSAN" ; # need to defined something if [ os.environ UBSAN ] @@ -22,21 +23,22 @@ if [ os.environ UBSAN ] ECHO $(HAS_UBSAN:J) ; # Project -project boost/test-examples +project : : requirements + /boost/test//boost_test clang:-Wno-c99-extensions $(HAS_UBSAN:J) ; # Define aliases for the needed libs to get shorter names alias prg_exec_monitor : # sources - /boost//prg_exec_monitor + /boost/test//boost_prg_exec_monitor ; alias unit_test_framework : # sources - /boost//unit_test_framework + /boost/test//boost_unit_test_framework ; # make aliases explicit so the libraries will only be built when requested @@ -60,7 +62,7 @@ alias boost_test_examples [ run unit_test_example_08.cpp unit_test_framework ] [ run unit_test_example_09_1.cpp unit_test_example_09_2.cpp unit_test_framework ] - [ run-fail unit_test_example_10.cpp unit_test_framework/static ] + [ run-fail unit_test_example_10.cpp unit_test_framework/static : : : /boost/lexical_cast//boost_lexical_cast ] [ run-fail unit_test_example_11.cpp unit_test_framework/static ] [ link unit_test_example_12.cpp unit_test_framework/static ] [ run unit_test_example_13.cpp ] diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 20ae7c7ea9..33c2bcdfb3 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -12,13 +12,15 @@ import property-set ; import regex ; import "class" : new ; -import ../../config/checks/config : requires ; +import config : requires ; -project boost/test-tests +project : requirements + /boost/test//boost_test ; -import ../../predef/tools/check/predef +import-search /boost/predef/tools/check ; +import predef : check require : predef-check predef-require ; @@ -102,6 +104,7 @@ rule docs-example-as-test ( test-file ) : : : $(requirements_documentation) # requirements + /boost/rational//boost_rational ] ; } @@ -141,11 +144,11 @@ test-suite "usage-variants-ts" test-suite "framework-ts" : - # [ boost.test-self-test run : framework-ts : result-report-test : : baseline-outputs/result-report-test.pattern baseline-outputs/result_report_test.pattern.default_behaviour ] - [ boost.test-self-test run : framework-ts : log-formatter-test : : baseline-outputs/log-formatter-context-test.pattern baseline-outputs/log-formatter-test.pattern baseline-outputs/log-formatter-test.pattern.junit ] # should be ordered alphabetically + # [ boost.test-self-test run : framework-ts : result-report-test : : baseline-outputs/result-report-test.pattern baseline-outputs/result_report_test.pattern.default_behaviour : : : : /boost/lexical_cast//boost_lexical_cast ] + [ boost.test-self-test run : framework-ts : log-formatter-test : : baseline-outputs/log-formatter-context-test.pattern baseline-outputs/log-formatter-test.pattern baseline-outputs/log-formatter-test.pattern.junit : : : : /boost/lexical_cast//boost_lexical_cast ] # should be ordered alphabetically [ boost.test-self-test run : framework-ts : run-by-name-or-label-test ] [ boost.test-self-test run : framework-ts : version-uses-module-name : included ] - [ boost.test-self-test run : framework-ts : test-macro-global-fixture : : baseline-outputs/global-fixtures-test.pattern ] + [ boost.test-self-test run : framework-ts : test-macro-global-fixture : : baseline-outputs/global-fixtures-test.pattern : : : : /boost/lexical_cast//boost_lexical_cast ] [ boost.test-self-test run : framework-ts : message-in-datatestcase-test : : baseline-outputs/messages-in-datasets-test.pattern : : : : $(requirements_datasets) ] [ boost.test-self-test run : framework-ts : decorators-datatestcase-test : : : : : : $(requirements_datasets) ] [ compile-fail framework-ts/master-test-suite-non-copyable-test.cpp ../build//included ] @@ -167,7 +170,7 @@ test-suite "writing-test-ts" [ boost.test-self-test run : writing-test-ts : collection-comparison-test : : : : : : $(requirements_boost_test_full_support) [ requires cxx11_unified_initialization_syntax ] ] # required by the test content [ boost.test-self-test run : writing-test-ts : dont_print_log_value-test : : : : : : $(requirements_datasets) ] [ boost.test-self-test run : writing-test-ts : fp-comparisons-test : : : : : : $(requirements_boost_test_full_support) ] - [ boost.test-self-test run : writing-test-ts : fp-multiprecision-comparison-test : : : : : : $(requirements_boost_test_full_support) [ requires cxx14_decltype_auto cxx14_generic_lambdas cxx14_return_type_deduction cxx14_variable_templates cxx14_constexpr ] ] + [ boost.test-self-test run : writing-test-ts : fp-multiprecision-comparison-test : : : : : : $(requirements_boost_test_full_support) [ requires cxx14_decltype_auto cxx14_generic_lambdas cxx14_return_type_deduction cxx14_variable_templates cxx14_constexpr ] /boost/multiprecision//boost_multiprecision ] [ boost.test-self-test run : writing-test-ts : fp-no-comparison-for-incomplete-types-test ] [ boost.test-self-test run : writing-test-ts : fp-relational-operator ] [ boost.test-self-test run : writing-test-ts : output_test_stream-test ] @@ -337,19 +340,19 @@ rule boost.test-smoke-ts-logger ( test-name-prefix : logger ? : log_or_report ? return $(to-return) ; } -exe smoke-ts-included : smoke-ts/basic-smoke-test.cpp +alias smoke-ts-included : smoke-ts/basic-smoke-test.cpp : $(requirements_datasets) ; -exe smoke-ts-included-2 : smoke-ts/basic-smoke-test2.cpp ; +alias smoke-ts-included-2 : smoke-ts/basic-smoke-test2.cpp ; -exe smoke-ts-included-3 : smoke-ts/basic-smoke-test3.cpp ; +alias smoke-ts-included-3 : smoke-ts/basic-smoke-test3.cpp ; # for template test case filtering from the command line -exe smoke-ts-included-4 : smoke-ts/basic-smoke-test4.cpp ; +alias smoke-ts-included-4 : smoke-ts/basic-smoke-test4.cpp ; -exe check-streams-on-exit : framework-ts/check-streams-on-exit.cpp ; +alias check-streams-on-exit : framework-ts/check-streams-on-exit.cpp ; -exe dataset-master-test-suite-accessible-test : test-organization-ts/dataset-master-test-suite-accessible-test.cpp +alias dataset-master-test-suite-accessible-test : test-organization-ts/dataset-master-test-suite-accessible-test.cpp : $(requirements_datasets) ; alias "smoke-ts" @@ -435,12 +438,12 @@ alias "smoke-ts" [ run smoke-ts-included-4 : \"--run_test=some_suite/test>,test>\" \"--run_test=test>\" : : : cla-template-test-case-sanity-15 ] ; -exe custom-command-line-binary-1 : ../doc/examples/runtime-configuration_1.run-fail.cpp ; -exe custom-command-line-binary-2 : ../doc/examples/runtime-configuration_2.run-fail.cpp +alias custom-command-line-binary-1 : ../doc/examples/runtime-configuration_1.run-fail.cpp ; +alias custom-command-line-binary-2 : ../doc/examples/runtime-configuration_2.run-fail.cpp : $(requirements_boost_test_full_support) ; -exe custom-command-line-binary-3 : ../doc/examples/runtime-configuration_3.run-fail.cpp +alias custom-command-line-binary-3 : ../doc/examples/runtime-configuration_3.run-fail.cpp : $(requirements_boost_test_full_support) ; -exe custom-command-line-binary-4 : ../doc/examples/runtime-configuration_4.run-fail.cpp +alias custom-command-line-binary-4 : ../doc/examples/runtime-configuration_4.run-fail.cpp : $(requirements_datasets) [ requires cxx11_trailing_result_types cxx11_auto_declarations ] $(l_gcc_c11_rvalue_full_support) ; alias "custom-command-line-ts" diff --git a/tools/console_test_runner/Jamfile.v2 b/tools/console_test_runner/Jamfile.v2 index c95e71811e..cbc6ff29e3 100644 --- a/tools/console_test_runner/Jamfile.v2 +++ b/tools/console_test_runner/Jamfile.v2 @@ -1,6 +1,6 @@ # (C) Copyright Gennadiy Rozental 2008-2014. -# Use, modification, and distribution are subject to the -# Boost Software License, Version 1.0. (See accompanying file +# Use, modification, and distribution are subject to 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) # # See http://www.boost.org/libs/test for the library home page. @@ -10,29 +10,29 @@ project libs/test/tools/console_test_runner ; alias unit_test_framework : # sources - /boost//unit_test_framework - ; + /boost/test//boost_unit_test_framework + ; alias test_runner_src : # sources src/console_test_runner.cpp - unit_test_framework - ; + unit_test_framework + ; # make aliases explicit so the libraries will only be built when requested explicit unit_test_framework ; explicit test_runner_src ; -lib dl ; +lib dl ; -lib test_runner_test : test/test_runner_test.cpp unit_test_framework ; +lib test_runner_test : test/test_runner_test.cpp unit_test_framework ; -exe console_test_runner +exe console_test_runner : test_runner_src - dl + dl ; -exe console_test_runner +exe console_test_runner : test_runner_src : windows ; From a4159f322702e28b0c3423ff99519b6f243e1739 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Wed, 16 Apr 2025 19:12:18 -0400 Subject: [PATCH 3/8] Move ubuntu 20.04 runs into containers (#446) * Move ubuntu 20.04 runs into containers * Fix syntax error --- .github/workflows/ci.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 056a62cda6..883c095381 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,19 +76,22 @@ jobs: - toolset: gcc-9 cxxstd: "17,2a" address_model: 64 - os: ubuntu-20.04 + os: ubuntu-latest + container: ubuntu:20.04 install: - g++-9-multilib - toolset: gcc-9 cxxstd: "17-gnu,2a-gnu" address_model: 64 - os: ubuntu-20.04 + os: ubuntu-latest + container: ubuntu:20.04 install: - g++-9-multilib - toolset: gcc-10 cxxstd: "17,20" address_model: 64 - os: ubuntu-20.04 + os: ubuntu-latest + container: ubuntu:20.04 install: - g++-10-multilib - toolset: gcc-11 @@ -174,13 +177,15 @@ jobs: - toolset: clang compiler: clang++-9 cxxstd: "17,2a" - os: ubuntu-20.04 + os: ubuntu-latest + container: ubuntu:20.04 install: - clang-9 - toolset: clang compiler: clang++-10 cxxstd: "17,20" - os: ubuntu-20.04 + os: ubuntu-latest + container: ubuntu:20.04 install: - clang-10 - toolset: clang @@ -531,8 +536,8 @@ jobs: fail-fast: false matrix: include: - - { os: ubuntu-20.04, build_shared: ON, build_type: Debug, generator: 'Unix Makefiles' } - - { os: ubuntu-20.04, build_shared: OFF, build_type: Debug, generator: 'Unix Makefiles' } + - { os: ubuntu-22.04, build_shared: ON, build_type: Debug, generator: 'Unix Makefiles' } + - { os: ubuntu-22.04, build_shared: OFF, build_type: Debug, generator: 'Unix Makefiles' } - { os: windows-2019, build_shared: ON, build_type: Debug, generator: 'Visual Studio 16 2019' } - { os: windows-2019, build_shared: OFF, build_type: Debug, generator: 'Visual Studio 16 2019' } From 097e97820e654ead9c477b47443a545cef5d3b12 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Thu, 17 Apr 2025 13:46:46 +0100 Subject: [PATCH 4/8] cmake: Add `BOOST_TEST_HEADERS_ONLY` configuration variable (#445) This change allows the build to be configured to install only the Boost.Test headers required for using the headers-only variant of the Unit Test Framework. The `README.md` file at https://github.com/boostorg/cmake should also be updated to mention this new Boost.Test-specific configuration variable. Co-authored-by: Cory Fields --- CMakeLists.txt | 108 +++++++++++++++++++++++++++---------------------- 1 file changed, 59 insertions(+), 49 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bd7af42838..85c5ca0410 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,64 +30,74 @@ set(_boost_test_dependencies Boost::utility ) -# Compiled targets +option(BOOST_TEST_HEADERS_ONLY "Boost.Test: Only install headers" OFF) -function(boost_test_add_library name) +set(_boost_test_libraries "") - add_library(boost_${name} ${ARGN}) - add_library(Boost::${name} ALIAS boost_${name}) +if (NOT BOOST_TEST_HEADERS_ONLY) - target_include_directories(boost_${name} PUBLIC include) - target_link_libraries(boost_${name} PUBLIC ${_boost_test_dependencies}) + # Compiled targets - target_compile_definitions(boost_${name} - PUBLIC BOOST_TEST_NO_LIB - # Source files already define BOOST_TEST_SOURCE - # PRIVATE BOOST_TEST_SOURCE - ) + function(boost_test_add_library name) - if(WIN32) - target_compile_definitions(boost_${name} PRIVATE _CRT_SECURE_NO_WARNINGS) - endif() + add_library(boost_${name} ${ARGN}) + add_library(Boost::${name} ALIAS boost_${name}) - if(BUILD_SHARED_LIBS) - target_compile_definitions(boost_${name} PUBLIC BOOST_TEST_DYN_LINK) - else() - target_compile_definitions(boost_${name} PUBLIC BOOST_TEST_STATIC_LINK) - endif() + target_include_directories(boost_${name} PUBLIC include) + target_link_libraries(boost_${name} PUBLIC ${_boost_test_dependencies}) -endfunction() + target_compile_definitions(boost_${name} + PUBLIC BOOST_TEST_NO_LIB + # Source files already define BOOST_TEST_SOURCE + # PRIVATE BOOST_TEST_SOURCE + ) -boost_test_add_library(prg_exec_monitor - src/cpp_main.cpp - src/debug.cpp - src/execution_monitor.cpp -) + if(WIN32) + target_compile_definitions(boost_${name} PRIVATE _CRT_SECURE_NO_WARNINGS) + endif() -set(SOURCES - src/compiler_log_formatter.cpp - src/debug.cpp - src/decorator.cpp - src/execution_monitor.cpp - src/framework.cpp - src/junit_log_formatter.cpp - src/plain_report_formatter.cpp - src/progress_monitor.cpp - src/results_collector.cpp - src/results_reporter.cpp - src/test_framework_init_observer.cpp - src/test_tools.cpp - src/test_tree.cpp - src/unit_test_log.cpp - src/unit_test_main.cpp - src/unit_test_monitor.cpp - src/unit_test_parameters.cpp - src/xml_log_formatter.cpp - src/xml_report_formatter.cpp -) + if(BUILD_SHARED_LIBS) + target_compile_definitions(boost_${name} PUBLIC BOOST_TEST_DYN_LINK) + else() + target_compile_definitions(boost_${name} PUBLIC BOOST_TEST_STATIC_LINK) + endif() + + endfunction() -boost_test_add_library(test_exec_monitor STATIC ${SOURCES} src/test_main.cpp) -boost_test_add_library(unit_test_framework ${SOURCES}) + boost_test_add_library(prg_exec_monitor + src/cpp_main.cpp + src/debug.cpp + src/execution_monitor.cpp + ) + + set(SOURCES + src/compiler_log_formatter.cpp + src/debug.cpp + src/decorator.cpp + src/execution_monitor.cpp + src/framework.cpp + src/junit_log_formatter.cpp + src/plain_report_formatter.cpp + src/progress_monitor.cpp + src/results_collector.cpp + src/results_reporter.cpp + src/test_framework_init_observer.cpp + src/test_tools.cpp + src/test_tree.cpp + src/unit_test_log.cpp + src/unit_test_main.cpp + src/unit_test_monitor.cpp + src/unit_test_parameters.cpp + src/xml_log_formatter.cpp + src/xml_report_formatter.cpp + ) + + boost_test_add_library(test_exec_monitor STATIC ${SOURCES} src/test_main.cpp) + boost_test_add_library(unit_test_framework ${SOURCES}) + + set(_boost_test_libraries boost_prg_exec_monitor boost_test_exec_monitor boost_unit_test_framework) + +endif() # Header-only targets @@ -111,7 +121,7 @@ if(BOOST_SUPERPROJECT_VERSION AND NOT CMAKE_VERSION VERSION_LESS 3.13) boost_install( TARGETS - boost_prg_exec_monitor boost_test_exec_monitor boost_unit_test_framework + ${_boost_test_libraries} boost_included_prg_exec_monitor boost_included_test_exec_monitor boost_included_unit_test_framework VERSION ${BOOST_SUPERPROJECT_VERSION} HEADER_DIRECTORY include From a401792a2db951201d30de02b66e670b4db7996d Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Mon, 25 Aug 2025 18:28:18 +0200 Subject: [PATCH 5/8] Update Link to regression test matrix in README (#455) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 19ff83c455..fd191d35b0 100644 --- a/README.md +++ b/README.md @@ -53,5 +53,5 @@ Boost.Test uses mostly the facility provided by our wonderful Boost testers (col Branch | Deps | Docs | Tests | Github Actions | :-------------: | ---- | ---- | ----- | -------------- | -[`master`](https://github.com/boostorg/test/tree/master) | [![Deps](https://img.shields.io/badge/deps-master-brightgreen.svg)](https://pdimov.github.io/boostdep-report/master/test.html) | [![Documentation](https://img.shields.io/badge/docs-master-brightgreen.svg)](http://www.boost.org/doc/libs/master/doc/html/test.html) | [![Enter the Matrix](https://img.shields.io/badge/matrix-master-brightgreen.svg)](http://www.boost.org/development/tests/master/developer/test.html) | [![Build Status](https://github.com/boostorg/test/workflows/CI/badge.svg?branch=master)](https://github.com/boostorg/test/actions) -[`develop`](https://github.com/boostorg/test/tree/develop) | [![Deps](https://img.shields.io/badge/deps-develop-brightgreen.svg)](https://pdimov.github.io/boostdep-report/develop/test.html) | [![Documentation](https://img.shields.io/badge/docs-develop-brightgreen.svg)](http://www.boost.org/doc/libs/develop/doc/html/test.html) | [![Enter the Matrix](https://img.shields.io/badge/matrix-develop-brightgreen.svg)](http://www.boost.org/development/tests/develop/developer/test.html) | [![Build Status](https://github.com/boostorg/test/workflows/CI/badge.svg?branch=develop)](https://github.com/boostorg/test/actions) +[`master`](https://github.com/boostorg/test/tree/master) | [![Deps](https://img.shields.io/badge/deps-master-brightgreen.svg)](https://pdimov.github.io/boostdep-report/master/test.html) | [![Documentation](https://img.shields.io/badge/docs-master-brightgreen.svg)](http://www.boost.org/doc/libs/master/doc/html/test.html) | [![Enter the Matrix](https://img.shields.io/badge/matrix-master-brightgreen.svg)](https://regression.boost.io/master/developer/test.html) | [![Build Status](https://github.com/boostorg/test/workflows/CI/badge.svg?branch=master)](https://github.com/boostorg/test/actions) +[`develop`](https://github.com/boostorg/test/tree/develop) | [![Deps](https://img.shields.io/badge/deps-develop-brightgreen.svg)](https://pdimov.github.io/boostdep-report/develop/test.html) | [![Documentation](https://img.shields.io/badge/docs-develop-brightgreen.svg)](http://www.boost.org/doc/libs/develop/doc/html/test.html) | [![Enter the Matrix](https://img.shields.io/badge/matrix-develop-brightgreen.svg)](https://regression.boost.io/develop/developer/test.html) | [![Build Status](https://github.com/boostorg/test/workflows/CI/badge.svg?branch=develop)](https://github.com/boostorg/test/actions) From 98f4db50606877576e6b4eb0fe23c88becc392f6 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Thu, 2 Oct 2025 08:37:44 +0200 Subject: [PATCH 6/8] Fix required CMake version (#461) --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 85c5ca0410..e551bc6a2c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ # Distributed under the Boost Software License, Version 1.0. # https://www.boost.org/LICENSE_1_0.txt -cmake_minimum_required(VERSION 3.5...3.16) +cmake_minimum_required(VERSION 3.8...3.16) project(boost_test VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) From 8086007f410e0b30ed400872396d3aef386aff43 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Mon, 27 Oct 2025 10:11:21 +0100 Subject: [PATCH 7/8] Update and remove old windows toolchains --- .github/workflows/ci.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 883c095381..3d5a87c50a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -473,14 +473,6 @@ jobs: fail-fast: false matrix: include: - - toolset: msvc-14.0 - cxxstd: "11" - addrmd: 64 - os: windows-2019 - - toolset: msvc-14.2 - cxxstd: "14" - addrmd: 64 - os: windows-2019 - toolset: msvc-14.3 cxxstd: "20" addrmd: 64 @@ -492,7 +484,7 @@ jobs: - toolset: gcc cxxstd: "17" addrmd: 64 - os: windows-2019 + os: windows-2022 runs-on: ${{matrix.os}} @@ -538,8 +530,8 @@ jobs: include: - { os: ubuntu-22.04, build_shared: ON, build_type: Debug, generator: 'Unix Makefiles' } - { os: ubuntu-22.04, build_shared: OFF, build_type: Debug, generator: 'Unix Makefiles' } - - { os: windows-2019, build_shared: ON, build_type: Debug, generator: 'Visual Studio 16 2019' } - - { os: windows-2019, build_shared: OFF, build_type: Debug, generator: 'Visual Studio 16 2019' } + - { os: windows-2025, build_shared: ON, build_type: Debug, generator: 'Visual Studio 17 2022' } + - { os: windows-2025, build_shared: OFF, build_type: Debug, generator: 'Visual Studio 17 2022' } timeout-minutes: 120 runs-on: ${{matrix.os}} From f2eac1c85556425950c88243e3424a45f6d255ac Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Mon, 27 Oct 2025 10:11:49 +0100 Subject: [PATCH 8/8] Update macos toolchains --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d5a87c50a..24a0b1466b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -257,10 +257,10 @@ jobs: - toolset: clang cxxstd: "20" - os: macos-13 + os: macos-14 - toolset: clang cxxstd: "20" - os: macos-14 + os: macos-15 runs-on: ${{matrix.os}} container: