From e9f6716aa89a1cb4be3b813a0af4589837bfdc54 Mon Sep 17 00:00:00 2001 From: Mathieu Champlon Date: Sun, 29 Sep 2024 20:42:36 +0200 Subject: [PATCH 01/23] Bump version to 2.0.0 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ddc100..be50c29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ # See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt cmake_minimum_required(VERSION 3.8) -project(turtle VERSION 1.3.2 LANGUAGES CXX) +project(turtle VERSION 2.0.0 LANGUAGES CXX) if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) set(IS_ROOT_PROJECT ON) From d675a05d9530b5f9e5a825ca4d16e68102b87772 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Sat, 5 Apr 2025 18:27:25 +0200 Subject: [PATCH 02/23] Require CMake 3.16 With CMake 4 compatibility with CMake 3.5 was dropped and 3.10 deprecated. Use a reasonably new lower bound based on Ubuntu 20 --- CMakeLists.txt | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index be50c29..d65ba4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,8 @@ -# Copyright 2019 Alexander Grund +# Copyright 2019-2025 Alexander Grund # 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 -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.16..3.20) project(turtle VERSION 2.0.0 LANGUAGES CXX) if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) @@ -67,14 +67,7 @@ if(TURTLE_INSTALL) INSTALL_DESTINATION ${configInstallDestination} ) - if(NOT CMAKE_VERSION VERSION_LESS 3.14) - write_basic_package_version_file(${versionFile} COMPATIBILITY SameMajorVersion ARCH_INDEPENDENT) - else() - set(OLD_CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P}) - set(CMAKE_SIZEOF_VOID_P "") - write_basic_package_version_file(${versionFile} COMPATIBILITY SameMajorVersion) - set(CMAKE_SIZEOF_VOID_P ${OLD_CMAKE_SIZEOF_VOID_P}) - endif() + write_basic_package_version_file(${versionFile} COMPATIBILITY SameMajorVersion ARCH_INDEPENDENT) install(FILES ${configFile} ${versionFile} DESTINATION ${configInstallDestination}) From 26583bebf32160787f71c5216d75f6561b3f8522 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Sat, 5 Apr 2025 18:38:43 +0200 Subject: [PATCH 03/23] GHA: Fix doc build Use Boost 1.87 to include fix for libxslt 1.1.35: https://github.com/boostorg/boostbook/issues/14 --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2666c20..a0b79ae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -# Copyright 2020 Alexander Grund +# Copyright 2020-2025 Alexander Grund # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) @@ -14,7 +14,7 @@ jobs: name: Create Release runs-on: ubuntu-latest env: - BOOST_VERSION: 1.71.0 + BOOST_VERSION: 1.87.0 BOOST_ROOT: ${{github.workspace}}/dependencies/boost steps: - uses: actions/checkout@v4 From cd6f5ea70dfe7a7571954f122c3cfb9693414e80 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Mon, 21 Apr 2025 10:59:56 +0200 Subject: [PATCH 04/23] Fix GHA CI Move Ubuntu 20.04 tests to containers as that runner image has been removed. --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f84ed28..fc62ba3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ jobs: matrix: include: # Linux, gcc - - { compiler: gcc-7, cxxstd: '14,17', boostBranch: boost-1.86.0, os: ubuntu-20.04 } + - { compiler: gcc-7, cxxstd: '14,17', boostBranch: boost-1.86.0, os: ubuntu-latest, container: 'ubuntu:20.04' } - { compiler: gcc-10, cxxstd: '14,17,20', boostBranch: boost-1.86.0, os: ubuntu-22.04 } - { compiler: gcc-12, cxxstd: '14,17,20', boostBranch: master, os: ubuntu-22.04 } - { compiler: gcc-14, cxxstd: '14,17,20', boostBranch: boost-1.86.0, os: ubuntu-24.04 } @@ -54,7 +54,7 @@ jobs: - { compiler: clang-18, cxxstd: '14,17,20', boostBranch: master, os: ubuntu-24.04 } - { name: Collect coverage, coverage: yes, - compiler: gcc-8, cxxstd: '14', boostBranch: boost-1.86.0, os: ubuntu-20.04 } + compiler: gcc-8, cxxstd: '14', boostBranch: boost-1.86.0, os: ubuntu-latest, container: 'ubuntu:20.04' } timeout-minutes: 120 runs-on: ${{matrix.os}} @@ -83,7 +83,7 @@ jobs: # Checking out Boost and all its submodules takes ages... - name: Cache Boost - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: boost-root key: boost-${{matrix.boostBranch}} From 20dafe08a62a8bbcdbb35779ddd7a4a1ddfb6678 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Sun, 20 Apr 2025 18:32:46 +0200 Subject: [PATCH 05/23] Remove some detail macros and rename parameters for readability --- include/turtle/constraint.hpp | 2 + include/turtle/detail/mock_impl.hpp | 73 +++++++++++++++-------------- include/turtle/mock.hpp | 45 +++++++++++------- 3 files changed, 66 insertions(+), 54 deletions(-) diff --git a/include/turtle/constraint.hpp b/include/turtle/constraint.hpp index 8dddb22..2eb7cf5 100644 --- a/include/turtle/constraint.hpp +++ b/include/turtle/constraint.hpp @@ -1,6 +1,7 @@ // http://turtle.sourceforge.net // // Copyright Mathieu Champlon 2008 +// Copyright 2020-2025 Alexander Grund // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at @@ -17,6 +18,7 @@ #include #include #include +#include #include #include #include diff --git a/include/turtle/detail/mock_impl.hpp b/include/turtle/detail/mock_impl.hpp index 211e81c..59fe4e0 100644 --- a/include/turtle/detail/mock_impl.hpp +++ b/include/turtle/detail/mock_impl.hpp @@ -1,6 +1,7 @@ // http://turtle.sourceforge.net // // Copyright Mathieu Champlon 2008 +// Copyright 2022-2025 Alexander Grund // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at @@ -14,7 +15,7 @@ #include "signature.hpp" #include "signature_traits.hpp" #include "type_name.hpp" -#include +#include #include #include @@ -49,47 +50,47 @@ namespace mock { namespace detail { return t##_mock_; \ } -#define MOCK_PARAM(S) mock::detail::parameter_t < S -#define MOCK_DECL_PARAM(z, n, d) BOOST_PP_COMMA_IF(n) d, n > p##n -#define MOCK_DECL_PARAMS(n, S) BOOST_PP_REPEAT(n, MOCK_DECL_PARAM, MOCK_PARAM(S)) -#define MOCK_DECL(M, n, S, c) mock::detail::result_type_t M(MOCK_DECL_PARAMS(n, S)) c +#define MOCK_PARAM(S, n) mock::detail::parameter_t -#define MOCK_FORWARD_PARAM(z, n, d) BOOST_PP_COMMA_IF(n) d, n >> (p##n) -#define MOCK_FORWARD_PARAMS(n, S) BOOST_PP_REPEAT(n, MOCK_FORWARD_PARAM, std::forward < MOCK_PARAM(S)) -#define MOCK_METHOD_AUX(M, n, S, t, c) \ - static_assert(n == mock::detail::function_arity_t::value, "Arity mismatch"); \ - MOCK_DECL(M, n, S, c) { return MOCK_ANONYMOUS_HELPER(t)(MOCK_FORWARD_PARAMS(n, S)); } +#define MOCK_DECL_PARAM(z, n, S) MOCK_PARAM(S, n) p##n +#define MOCK_DECL_PARAMS(n, S) BOOST_PP_ENUM(n, MOCK_DECL_PARAM, S) +#define MOCK_DECL(name, arity, signature, qualifier) \ + mock::detail::result_type_t name(MOCK_DECL_PARAMS(arity, signature)) qualifier -#define MOCK_METHOD_EXT(M, n, S, t) \ - MOCK_METHOD_AUX(M, n, S, t, ) \ - MOCK_METHOD_AUX(M, n, S, t, const) \ - MOCK_METHOD_HELPER(S, t) -#define MOCK_CONST_METHOD_EXT(M, n, S, t) \ - MOCK_METHOD_AUX(M, n, S, t, const) \ - MOCK_METHOD_HELPER(S, t) -#define MOCK_NON_CONST_METHOD_EXT(M, n, S, t) \ - MOCK_METHOD_AUX(M, n, S, t, ) \ - MOCK_METHOD_HELPER(S, t) - -#define MOCK_FUNCTION_HELPER(S, t, s) \ - s mock::detail::function& t##_mock(mock::detail::context& context, boost::unit_test::const_string instance) \ - { \ - static mock::detail::function f; \ - return f(context, instance); \ +#define MOCK_FORWARD_PARAM(z, n, S) std::forward(p##n) +#define MOCK_FORWARD_PARAMS(n, S) BOOST_PP_ENUM(n, MOCK_FORWARD_PARAM, S) +#define MOCK_METHOD_AUX(name, arity, signature, identifier, qualifier) \ + MOCK_DECL(name, arity, signature, qualifier) \ + { \ + return MOCK_ANONYMOUS_HELPER(identifier)(MOCK_FORWARD_PARAMS(arity, signature)); \ } -#define MOCK_CONSTRUCTOR_AUX(T, n, A, t) \ - T(MOCK_DECL_PARAMS(n, void A)) { MOCK_HELPER(t)(MOCK_FORWARD_PARAMS(n, void A)); } \ - MOCK_FUNCTION_HELPER(void A, t, static) +#define MOCK_METHOD_EXT(name, arity, signature, identifier) \ + MOCK_METHOD_AUX(name, arity, signature, identifier, ) \ + MOCK_METHOD_AUX(name, arity, signature, identifier, const) \ + MOCK_METHOD_HELPER(signature, identifier) +#define MOCK_CONST_METHOD_EXT(name, arity, signature, identifier) \ + MOCK_METHOD_AUX(name, arity, signature, identifier, const) \ + MOCK_METHOD_HELPER(signature, identifier) +#define MOCK_NON_CONST_METHOD_EXT(name, arity, signature, identifier) \ + MOCK_METHOD_AUX(name, arity, signature, identifier, ) \ + MOCK_METHOD_HELPER(signature, identifier) -#define MOCK_FUNCTION_AUX(F, n, S, t, s) \ - MOCK_FUNCTION_HELPER(S, t, s) \ - static_assert(n == mock::detail::function_arity_t::value, "Arity mismatch"); \ - s MOCK_DECL(F, n, S, ) { return MOCK_HELPER(t)(MOCK_FORWARD_PARAMS(n, S)); } +#define MOCK_FUNCTION_HELPER(signature, identifier, prefix) \ + prefix mock::detail::function& identifier##_mock(mock::detail::context& context, \ + boost::unit_test::const_string instance) \ + { \ + static mock::detail::function f; \ + return f(context, instance); \ + } -#define MOCK_VARIADIC_ELEM_0(e0, ...) e0 -#define MOCK_VARIADIC_ELEM_1(e0, e1, ...) e1 -#define MOCK_VARIADIC_ELEM_2(e0, e1, e2, ...) e2 +#define MOCK_FUNCTION_AUX(name, arity, signature, identifier, prefix) \ + MOCK_FUNCTION_HELPER(signature, identifier, prefix) \ + static_assert(arity == mock::detail::function_arity_t::value, "Arity mismatch"); \ + prefix MOCK_DECL(name, arity, signature, ) \ + { \ + return MOCK_HELPER(identifier)(MOCK_FORWARD_PARAMS(arity, signature)); \ + } #define MOCK_REPLACED_MACRO_ERROR(oldName, newName) static_assert(false, #oldName " has been replaced by " #newName) // Replaced macros diff --git a/include/turtle/mock.hpp b/include/turtle/mock.hpp index 9e78a4f..31d5dc8 100644 --- a/include/turtle/mock.hpp +++ b/include/turtle/mock.hpp @@ -1,6 +1,7 @@ // http://turtle.sourceforge.net // // Copyright Mathieu Champlon 2008 +// Copyright 2022-2025 Alexander Grund // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at @@ -15,6 +16,7 @@ #include "object.hpp" #include "reset.hpp" #include "verify.hpp" +#include /// MOCK_CLASS( name ) /// Define a class @@ -51,7 +53,12 @@ /// MOCK_CONSTRUCTOR( [calling convention] name, arity, parameters, identifier ) /// As constructors do not have a return type, the usual signature gets restricted here to just the parameters. -#define MOCK_CONSTRUCTOR(T, arity, parameters, identifier) MOCK_CONSTRUCTOR_AUX(T, arity, parameters, identifier) +#define MOCK_CONSTRUCTOR(T, arity, parameters, identifier) \ + T(MOCK_DECL_PARAMS(arity, void parameters)) \ + { \ + MOCK_HELPER(identifier)(MOCK_FORWARD_PARAMS(arity, void parameters)); \ + } \ + MOCK_FUNCTION_HELPER(void parameters, identifier, static) /// MOCK_DESTRUCTOR( [calling convention] ~name, identifier ) #define MOCK_DESTRUCTOR(T, identifier) \ @@ -69,39 +76,41 @@ /// generates both const and non-const methods /// The 'signature' can be omitted if it can be uniquely identified from the base class /// if 'identifier' is omitted it will default to 'name' -#define MOCK_METHOD(M, ...) \ - MOCK_METHOD_EXT(M, \ - MOCK_VARIADIC_ELEM_0(__VA_ARGS__, ), \ - MOCK_VARIADIC_ELEM_1(__VA_ARGS__, MOCK_SIGNATURE(M), ), \ - MOCK_VARIADIC_ELEM_2(__VA_ARGS__, M, M, )) +#define MOCK_METHOD(M, ...) \ + MOCK_METHOD_EXT(M, \ + BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__, ), \ + BOOST_PP_VARIADIC_ELEM(1, __VA_ARGS__, MOCK_SIGNATURE(M), ), \ + BOOST_PP_VARIADIC_ELEM(2, __VA_ARGS__, M, M, )) /// MOCK_CONST_METHOD( [calling convention] name, arity[, signature[, identifier]] ) /// generates only the const version of the method /// The 'signature' can be omitted if it can be uniquely identified from the base class /// if 'identifier' is omitted it will default to 'name' -#define MOCK_CONST_METHOD(M, ...) \ - MOCK_CONST_METHOD_EXT(M, \ - MOCK_VARIADIC_ELEM_0(__VA_ARGS__, ), \ - MOCK_VARIADIC_ELEM_1(__VA_ARGS__, MOCK_SIGNATURE(M), ), \ - MOCK_VARIADIC_ELEM_2(__VA_ARGS__, M, M, )) +#define MOCK_CONST_METHOD(M, ...) \ + MOCK_CONST_METHOD_EXT(M, \ + BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__, ), \ + BOOST_PP_VARIADIC_ELEM(1, __VA_ARGS__, MOCK_SIGNATURE(M), ), \ + BOOST_PP_VARIADIC_ELEM(2, __VA_ARGS__, M, M, )) /// MOCK_NON_CONST_METHOD( [calling convention] name, arity[, signature[, identifier]] ) /// generates only the non-const version of the method /// The 'signature' can be omitted if it can be uniquely identified from the base class /// if 'identifier' is omitted it will default to 'name' -#define MOCK_NON_CONST_METHOD(M, ...) \ - MOCK_NON_CONST_METHOD_EXT(M, \ - MOCK_VARIADIC_ELEM_0(__VA_ARGS__, ), \ - MOCK_VARIADIC_ELEM_1(__VA_ARGS__, MOCK_SIGNATURE(M), ), \ - MOCK_VARIADIC_ELEM_2(__VA_ARGS__, M, M, )) +#define MOCK_NON_CONST_METHOD(M, ...) \ + MOCK_NON_CONST_METHOD_EXT(M, \ + BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__, ), \ + BOOST_PP_VARIADIC_ELEM(1, __VA_ARGS__, MOCK_SIGNATURE(M), ), \ + BOOST_PP_VARIADIC_ELEM(2, __VA_ARGS__, M, M, )) /// MOCK_FUNCTION( [calling convention] name, arity, signature[, identifier] ) /// if 'identifier' is omitted it will default to 'name' #define MOCK_FUNCTION(F, arity, ...) \ - MOCK_FUNCTION_AUX(F, arity, MOCK_VARIADIC_ELEM_0(__VA_ARGS__, ), MOCK_VARIADIC_ELEM_1(__VA_ARGS__, F, ), inline) + MOCK_FUNCTION_AUX( \ + F, arity, BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__, ), BOOST_PP_VARIADIC_ELEM(1, __VA_ARGS__, F, ), inline) /// MOCK_STATIC_METHOD( [calling convention] name, arity, signature[, identifier] ) /// if 'identifier' is omitted it will default to 'name' #define MOCK_STATIC_METHOD(F, arity, ...) \ - MOCK_FUNCTION_AUX(F, arity, MOCK_VARIADIC_ELEM_0(__VA_ARGS__, ), MOCK_VARIADIC_ELEM_1(__VA_ARGS__, F, ), static) + MOCK_FUNCTION_AUX( \ + F, arity, BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__, ), BOOST_PP_VARIADIC_ELEM(1, __VA_ARGS__, F, ), static) /// MOCK_EXPECT( identifier ) /// Begin setting up expectation for the identifier From d7c80fbf28a2667f4f200463ae6048de7993f18c Mon Sep 17 00:00:00 2001 From: Flamefire Date: Sun, 27 Apr 2025 17:45:14 +0200 Subject: [PATCH 06/23] GHA: Fix ownership of repo in container Avoid: > fatal: detected dubious ownership in repository at '/__w/turtle/turtle' by adding that path to the git `safe.path`. This is caused by the command(s) running inside the container but the folder being created outside the container so the owner inside the container is not what is expected by git. --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc62ba3..9c8331f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,6 +75,7 @@ jobs: apt-get -o Acquire::Retries=$NET_RETRY_COUNT update apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y g++ git cmake git config --global pack.threads 0 + git config --global --add safe.directory "$GITHUB_WORKSPACE" # Avoid ownership issues of repo in container - uses: actions/checkout@v4 with: From 3555de3c89e8139de7cfc0c37760c3cf1de722b4 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Tue, 29 Apr 2025 13:27:02 +0200 Subject: [PATCH 07/23] Appveyor: Update Boost version for VS 2019 --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index faa42f7..e2d967d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -29,7 +29,7 @@ environment: BOOST: 1_65_1 CMAKE: true - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - BOOST: 1_77_0 + BOOST: 1_83_0 CMAKE: true install: From 2e2a6525babca91aea04f790f5f4960d0e78af01 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Tue, 29 Apr 2025 18:05:41 +0200 Subject: [PATCH 08/23] Appveyor: Add VS 2022 builds --- appveyor.yml | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index e2d967d..3e0efb4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,8 +2,8 @@ # 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) # -# Copyright Mathieu Champlon 2015. -# Copyright Alexander Grund 2020. +# Copyright 2015 Mathieu Champlon +# Copyright 2020-2025 Alexander Grund skip_branch_with_pr: true @@ -19,18 +19,30 @@ environment: - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 BOOST: 1_65_1 TOOLSET: msvc-14.1 - CXX_STANDARD: 14 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - BOOST: 1_67_0 + BOOST: 1_69_0 TOOLSET: msvc-14.1 - CXX_STANDARD: 14 - # CXX_STANDARD: 17 + CXX_STANDARD: 14,17 + + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 + BOOST: 1_83_0 + TOOLSET: msvc-14.3 + CXX_STANDARD: 14,17,20 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 + BOOST: 1_86_0 + TOOLSET: msvc-14.3 + CXX_STANDARD: 14,17,20 + + # CMake builds - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 BOOST: 1_65_1 CMAKE: true - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 BOOST: 1_83_0 CMAKE: true + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 + BOOST: 1_86_0 + CMAKE: true install: - appveyor-retry powershell Invoke-WebRequest http://www.oasis-open.org/docbook/xml/4.2/docbook-xml-4.2.zip -OutFile docbook-xml.zip @@ -55,7 +67,7 @@ build_script: - cd %BOOST_ROOT% - call bootstrap.bat - cd %APPVEYOR_BUILD_FOLDER% - - if NOT "%CXX_STANDARD%"=="" set CXX_FLAGS=cxxflags=/std:c++%CXX_STANDARD% + - if NOT "%CXX_STANDARD%"=="" set CXX_FLAGS=cxxstd=%CXX_STANDARD% - set BUILD_ARGS=address-model=32,64 variant=debug,release - call scripts\build.bat --toolset=%TOOLSET% %CXX_FLAGS% -j3 From f18da714f26bd9f8cc2490dd48395952ca35fd05 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Wed, 30 Apr 2025 09:27:07 +0200 Subject: [PATCH 09/23] Make inspect target explicit --- scripts/build.sh | 4 ++++ test/Jamfile.jam | 10 ++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 3261c23..2b69951 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,6 +1,7 @@ #!/bin/sh # Copyright (C) 2015 Mathieu Champlon +# Copyright (C) 2025 Alexander Grund # # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) @@ -18,3 +19,6 @@ scripts/build_doc.sh "$@" cd "$BOOST_ROOT" ./b2 "$PROJECT_DIR/doc//mock_examples" -q "$@" + +cd "$BOOST_ROOT" +./b2 "$PROJECT_DIR/test//inspect" -q "$@" diff --git a/test/Jamfile.jam b/test/Jamfile.jam index 4575a0e..4cbca98 100644 --- a/test/Jamfile.jam +++ b/test/Jamfile.jam @@ -1,4 +1,5 @@ -# Copyright Mathieu Champlon 2012 +# Copyright 2012 Mathieu Champlon +# Copyright 2025 Alexander Grund # # Distributed under the Boost Software License version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at @@ -15,11 +16,8 @@ project path-constant parent : .. ; -alias mock_inspect : - [ run /boost/tools/inspect//inspect/release - : $(parent) -text -brief : : : inspect - ] -; +run /boost/tools/inspect//inspect/release : $(parent) -text -brief : : always_show_run_output : inspect ; +explicit inspect ; rule run-test ( name ) { From c34cbb56ab45c3f82e6062b4d7d483bb9e0c8116 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Wed, 30 Apr 2025 12:32:02 +0200 Subject: [PATCH 10/23] Add MOCK_CXX_VERSION macro --- include/turtle/config.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/turtle/config.hpp b/include/turtle/config.hpp index 111d09d..8e42051 100644 --- a/include/turtle/config.hpp +++ b/include/turtle/config.hpp @@ -1,6 +1,7 @@ // http://turtle.sourceforge.net // // Copyright Mathieu Champlon 2009 +// Copyright 2020-2025 Alexander Grund // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at @@ -30,4 +31,17 @@ # endif #endif +#if BOOST_VERSION >= 107700 +# define MOCK_CXX_VERSION BOOST_CXX_VERSION +#elif defined(_MSC_VER) +# ifdef _MSVC_LANG +# define MOCK_CXX_VERSION _MSVC_LANG +# elif defined(_HAS_CXX17) +# define MOCK_CXX_VERSION 201703L +# endif +#endif +#ifndef MOCK_CXX_VERSION +# define MOCK_CXX_VERSION __cplusplus +#endif + #endif // MOCK_CONFIG_HPP_INCLUDED From 78a4fbe129d571849a68c59b2843b86a5afd91d3 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Wed, 30 Apr 2025 12:36:56 +0200 Subject: [PATCH 11/23] Fix test in C++17 and up --- test/detail/test_is_functor.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/detail/test_is_functor.cpp b/test/detail/test_is_functor.cpp index 1a50e29..0a2f5b2 100644 --- a/test/detail/test_is_functor.cpp +++ b/test/detail/test_is_functor.cpp @@ -67,6 +67,8 @@ BOOST_AUTO_TEST_CASE(function_pointer_is_functor) is_not_functor(&f2); } +// ptr_fun, bin1st is removed in C++17 +#if MOCK_CXX_VERSION < 201703L BOOST_AUTO_TEST_CASE(std_ptr_fun_is_functor) { is_functor(std::ptr_fun(&f1)); @@ -77,6 +79,7 @@ BOOST_AUTO_TEST_CASE(std_bind_first_is_functor) { is_functor(std::bind1st(std::ptr_fun(&f2), "")); } +#endif BOOST_AUTO_TEST_CASE(bind_is_functor) { From a334c4fb3b0221f871b44d664fafcd9dff64edfa Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Wed, 30 Apr 2025 15:40:17 +0200 Subject: [PATCH 12/23] Split appveyor jobs to fit time limit --- appveyor.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 3e0efb4..e36753b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,6 +12,10 @@ branches: - main environment: + global: + ADDRESS_MODEL: 32,64 + VARIANT: debug,release + matrix: - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 BOOST: 1_65_1 @@ -23,15 +27,24 @@ environment: BOOST: 1_69_0 TOOLSET: msvc-14.1 CXX_STANDARD: 14,17 - + ADDRESS_MODEL: 64 + VARIANT: debug - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 BOOST: 1_83_0 TOOLSET: msvc-14.3 CXX_STANDARD: 14,17,20 + ADDRESS_MODEL: 64 + VARIANT: debug - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 BOOST: 1_86_0 TOOLSET: msvc-14.3 - CXX_STANDARD: 14,17,20 + CXX_STANDARD: 14,17 + ADDRESS_MODEL: 64 + VARIANT: debug + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 + BOOST: 1_86_0 + TOOLSET: msvc-14.3 + CXX_STANDARD: 20 # CMake builds - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 @@ -68,7 +81,7 @@ build_script: - call bootstrap.bat - cd %APPVEYOR_BUILD_FOLDER% - if NOT "%CXX_STANDARD%"=="" set CXX_FLAGS=cxxstd=%CXX_STANDARD% - - set BUILD_ARGS=address-model=32,64 variant=debug,release + - set BUILD_ARGS=address-model=%ADDRESS_MODEL% variant=%VARIANT% - call scripts\build.bat --toolset=%TOOLSET% %CXX_FLAGS% -j3 for: From 1d2fb3f3dfd4b3c30a11996d748a1db67f106dc2 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Sun, 1 Jun 2025 12:51:43 +0200 Subject: [PATCH 13/23] GHA: Add Windows builds --- .github/workflows/ci.yml | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c8331f..67c73b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# Copyright 2022 Alexander Grund +# Copyright 2022-2025 Alexander Grund # # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) @@ -32,7 +32,7 @@ jobs: with: clangFormatVersion: 10 - posix: + Build: defaults: run: shell: bash @@ -53,6 +53,11 @@ jobs: - { compiler: clang-18, cxxstd: '14,17,20', boostBranch: boost-1.86.0, os: ubuntu-24.04 } - { compiler: clang-18, cxxstd: '14,17,20', boostBranch: master, os: ubuntu-24.04 } + # Windows + - { toolset: msvc-14.2, os: windows-2019, cxxstd: 14, generator: 'Visual Studio 16 2019' } + - { toolset: gcc, os: windows-2019, cxxstd: 17, generator: 'Visual Studio 16 2019' } + - { toolset: msvc-14.3, os: windows-2022, cxxstd: 20, generator: 'Visual Studio 17 2022' } + - { name: Collect coverage, coverage: yes, compiler: gcc-8, cxxstd: '14', boostBranch: boost-1.86.0, os: ubuntu-latest, container: 'ubuntu:20.04' } @@ -99,6 +104,8 @@ jobs: - name: Install packages and setup env run: | + B2_TOOLSET=${{matrix.toolset}} + if [[ ! "${{matrix.os}}" == "windows-"* ]]; then sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT update CXX=${{matrix.compiler}} CXX="${CXX/gcc-/g++-}" @@ -108,19 +115,23 @@ jobs: CXX="ccache ${CXX/clang-/clang++-}" echo "CXX=$CXX" >> $GITHUB_ENV echo "CC=${{matrix.compiler}}" >> $GITHUB_ENV - if [[ "$CXX" =~ clang ]]; then - B2_TOOLSET=clang - else - B2_TOOLSET=gcc + if [[ -z $B2_TOOLSET ]]; then + if [[ "$CXX" =~ clang ]]; then + B2_TOOLSET=clang + else + B2_TOOLSET=gcc + fi fi - echo "B2_TOOLSET=$B2_TOOLSET" >> $GITHUB_ENV - echo "using $B2_TOOLSET : : $CXX ;" > ~/user-config.jam - # Move the Boost root to a sibling folder - mv boost-root .. - echo "BOOST_ROOT=${{github.workspace}}/../boost-root" >> $GITHUB_ENV + [[ -z $CXX ]] || echo "using $B2_TOOLSET : : $CXX ;" > ~/user-config.jam + fi + echo "B2_TOOLSET=$B2_TOOLSET" >> $GITHUB_ENV + # Move the Boost root to a sibling folder + mv boost-root .. + echo "BOOST_ROOT=${{github.workspace}}/../boost-root" >> $GITHUB_ENV - name: Cache ccache uses: hendrikmuhs/ccache-action@v1 + if: startsWith(matrix.os, 'ubuntu') with: key: ${{matrix.os}}-${{matrix.compiler}}-${{matrix.boostBranch}} @@ -165,7 +176,12 @@ jobs: run: | mkdir build && cd build CXX_STANDARD="${{matrix.cxxstd}}" - cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-std=c++${CXX_STANDARD##*,}" -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_VERBOSE_MAKEFILE=ON + if [[ "${{matrix.os}}" == "windows-"* ]]; then + compiler_launcher_arg= + else + compiler_launcher_arg=-DCMAKE_CXX_COMPILER_LAUNCHER=ccache + fi + cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD="${CXX_STANDARD##*,}" $compiler_launcher_arg -DCMAKE_VERBOSE_MAKEFILE=ON cmake --build . --config Debug -- -j3 ctest --output-on-failure --build-config Debug -j3 From 29c7e2d067c8a4b53dab47a823373acaa714fe5e Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Sun, 1 Jun 2025 14:05:03 +0200 Subject: [PATCH 14/23] GHA: Separate out doc and inspect builds Don't run doc build on Windows due to missing dependencies. Use separate steps for different builds to easier differentiate them. --- .github/workflows/ci.yml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67c73b5..04a50c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -125,6 +125,13 @@ jobs: [[ -z $CXX ]] || echo "using $B2_TOOLSET : : $CXX ;" > ~/user-config.jam fi echo "B2_TOOLSET=$B2_TOOLSET" >> $GITHUB_ENV + + B2_FLAGS+=" --toolset=$B2_TOOLSET cxxstd=${{matrix.cxxstd}}" + if [[ "${{matrix.coverage}}" == "yes" ]]; then + B2_FLAGS+=" cxxflags=--coverage linkflags=--coverage" + fi + echo "B2_FLAGS=$B2_FLAGS" >> $GITHUB_ENV + # Move the Boost root to a sibling folder mv boost-root .. echo "BOOST_ROOT=${{github.workspace}}/../boost-root" >> $GITHUB_ENV @@ -141,11 +148,17 @@ jobs: - name: Boost build run: | - B2_FLAGS="cxxstd=${{matrix.cxxstd}}" - if [[ "${{matrix.coverage}}" == "yes" ]]; then - B2_FLAGS="$B2_FLAGS cxxflags=--coverage linkflags=--coverage" - fi - scripts/build.sh --toolset=$B2_TOOLSET $B2_FLAGS -j3 + ./b2 "$GITHUB_WORKSPACE/test" -q $B2_FLAGS -j3 + ./b2 "$GITHUB_WORKSPACE/doc//mock_examples" -q $B2_FLAGS "$@" + working-directory: ${{env.BOOST_ROOT}} + + - name: Run inspect check + run: ./b2 "$GITHUB_WORKSPACE/test//inspect" -q $B2_FLAGS + working-directory: ${{env.BOOST_ROOT}} + + - name: Build doc + if: startsWith(matrix.os, 'ubuntu') + run: scripts/build_doc.sh $B2_FLAGS -j3 - name: Collect coverage if: matrix.coverage From 0d4a9f1e33cf8804e5a5d99bb962a026bfedc885 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Sun, 1 Jun 2025 14:26:16 +0200 Subject: [PATCH 15/23] Remove std::bind1st test for C++17 --- doc/example/reference.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/example/reference.cpp b/doc/example/reference.cpp index 2b19a4e..33d71b5 100644 --- a/doc/example/reference.cpp +++ b/doc/example/reference.cpp @@ -544,6 +544,7 @@ bool custom_constraint(int expected, int actual) return expected == actual; } +#if MOCK_CXX_VERSION < 201703L BOOST_AUTO_TEST_CASE(demonstrates_adding_a_custom_constraint_with_a_standard_library_functor) { mock_class c; @@ -551,6 +552,7 @@ BOOST_AUTO_TEST_CASE(demonstrates_adding_a_custom_constraint_with_a_standard_lib std::bind1st(std::ptr_fun(&custom_constraint), 42)); // std::ptr_fun creates an std::unary_function c.method(42); } +#endif //] } // namespace constraints_example_3 From 6683b829c3fdcf56534975553b1913b35bc2af25 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Sun, 1 Jun 2025 14:55:30 +0200 Subject: [PATCH 16/23] CI: Add Boost debug output to CMake search --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04a50c1..a9c1b5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -194,7 +194,7 @@ jobs: else compiler_launcher_arg=-DCMAKE_CXX_COMPILER_LAUNCHER=ccache fi - cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD="${CXX_STANDARD##*,}" $compiler_launcher_arg -DCMAKE_VERBOSE_MAKEFILE=ON + cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD="${CXX_STANDARD##*,}" $compiler_launcher_arg -DCMAKE_VERBOSE_MAKEFILE=ON -DBoost_DEBUG=ON -DBoost_VERBOSE=ON cmake --build . --config Debug -- -j3 ctest --output-on-failure --build-config Debug -j3 From 66bfbe115cb9ada3d14265490e3cf71510337981 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Mon, 9 Jun 2025 12:09:05 +0200 Subject: [PATCH 17/23] Set stage dir as boost root --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9c1b5a..762b8e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -194,7 +194,7 @@ jobs: else compiler_launcher_arg=-DCMAKE_CXX_COMPILER_LAUNCHER=ccache fi - cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD="${CXX_STANDARD##*,}" $compiler_launcher_arg -DCMAKE_VERBOSE_MAKEFILE=ON -DBoost_DEBUG=ON -DBoost_VERBOSE=ON + cmake .. -DCMAKE_BUILD_TYPE=Debug -DBoost_ROOT="$BOOST_ROOT/stage" -DCMAKE_CXX_STANDARD="${CXX_STANDARD##*,}" $compiler_launcher_arg -DCMAKE_VERBOSE_MAKEFILE=ON -DBoost_DEBUG=ON -DBoost_VERBOSE=ON cmake --build . --config Debug -- -j3 ctest --output-on-failure --build-config Debug -j3 From 3980cc97e138236814964dd12cd242f9ce29b3ff Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Mon, 9 Jun 2025 14:17:49 +0200 Subject: [PATCH 18/23] Fix CMake parallel flag for MSVC --- .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 762b8e6..c283a79 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -195,8 +195,8 @@ jobs: compiler_launcher_arg=-DCMAKE_CXX_COMPILER_LAUNCHER=ccache fi cmake .. -DCMAKE_BUILD_TYPE=Debug -DBoost_ROOT="$BOOST_ROOT/stage" -DCMAKE_CXX_STANDARD="${CXX_STANDARD##*,}" $compiler_launcher_arg -DCMAKE_VERBOSE_MAKEFILE=ON -DBoost_DEBUG=ON -DBoost_VERBOSE=ON - cmake --build . --config Debug -- -j3 - ctest --output-on-failure --build-config Debug -j3 + cmake --build . --config Debug --parallel 3 + ctest --output-on-failure --build-config Debug --parallel 3 - name: Cleanup Boost folder to reduce cache usage if: ${{ always() }} From d8809dca2ae7d96177cf2717cd125bfaa2d371ec Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Mon, 9 Jun 2025 12:19:12 +0200 Subject: [PATCH 19/23] Improve check for std::uncaught_exceptions GCC 8 on MinGW still warns about that. Check the version of the feature macro and add parens to ensure correct evaluation. --- include/turtle/config.hpp | 5 +++-- include/turtle/detail/function_impl.hpp | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/turtle/config.hpp b/include/turtle/config.hpp index 8e42051..9395005 100644 --- a/include/turtle/config.hpp +++ b/include/turtle/config.hpp @@ -25,8 +25,9 @@ # endif #endif -#if defined(__cpp_lib_uncaught_exceptions) || defined(_MSC_VER) && (_MSC_VER >= 1900) -# ifndef MOCK_NO_UNCAUGHT_EXCEPTIONS +#ifndef MOCK_NO_UNCAUGHT_EXCEPTIONS +# if(defined(__cpp_lib_uncaught_exceptions) && __cpp_lib_uncaught_exceptions >= 201411) || \ + (defined(_MSC_VER) && _MSC_VER >= 1900) # define MOCK_UNCAUGHT_EXCEPTIONS # endif #endif diff --git a/include/turtle/detail/function_impl.hpp b/include/turtle/detail/function_impl.hpp index e3524a2..c11f386 100644 --- a/include/turtle/detail/function_impl.hpp +++ b/include/turtle/detail/function_impl.hpp @@ -1,6 +1,7 @@ // http://turtle.sourceforge.net // -// Copyright Mathieu Champlon 2012 +// Copyright 2012 Mathieu Champlon +// Copyright 2025 Alexander Grund // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at @@ -80,7 +81,7 @@ namespace mock { namespace detail { typedef safe_error> error_type; public: - function_impl() : context_(0), valid_(true), exceptions_(exceptions()), mutex_(std::make_shared()) {} + function_impl() : exceptions_(exceptions()), mutex_(std::make_shared()) {} virtual ~function_impl() { if(valid_ && exceptions_ >= exceptions()) @@ -314,8 +315,8 @@ namespace mock { namespace detail { }; std::list expectations_; - context* context_; - mutable bool valid_; + context* context_ = nullptr; + mutable bool valid_ = true; const int exceptions_; const std::shared_ptr mutex_; }; From 2f02e9c8706f10023ad5b8d5bec887ea4c058ef7 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Mon, 9 Jun 2025 20:13:46 +0200 Subject: [PATCH 20/23] Use MinGW generator for GCC on Windows --- .github/workflows/ci.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c283a79..06769cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,7 +55,7 @@ jobs: # Windows - { toolset: msvc-14.2, os: windows-2019, cxxstd: 14, generator: 'Visual Studio 16 2019' } - - { toolset: gcc, os: windows-2019, cxxstd: 17, generator: 'Visual Studio 16 2019' } + - { toolset: gcc, os: windows-2019, cxxstd: 17, generator: 'MinGW Makefiles' } - { toolset: msvc-14.3, os: windows-2022, cxxstd: 20, generator: 'Visual Studio 17 2022' } - { name: Collect coverage, coverage: yes, @@ -190,13 +190,17 @@ jobs: mkdir build && cd build CXX_STANDARD="${{matrix.cxxstd}}" if [[ "${{matrix.os}}" == "windows-"* ]]; then - compiler_launcher_arg= + extra_args=() else - compiler_launcher_arg=-DCMAKE_CXX_COMPILER_LAUNCHER=ccache + extra_args=(-DCMAKE_CXX_COMPILER_LAUNCHER=ccache) fi - cmake .. -DCMAKE_BUILD_TYPE=Debug -DBoost_ROOT="$BOOST_ROOT/stage" -DCMAKE_CXX_STANDARD="${CXX_STANDARD##*,}" $compiler_launcher_arg -DCMAKE_VERBOSE_MAKEFILE=ON -DBoost_DEBUG=ON -DBoost_VERBOSE=ON + if [[ -n "${{matrix.generator}}" ]]; then + extra_args+=(-G "${{matrix.generator}}") + fi + echo "Using extra args: ${extra_args[*]}" + cmake .. -DCMAKE_BUILD_TYPE=Debug -DBoost_ROOT="$BOOST_ROOT/stage" -DCMAKE_CXX_STANDARD="${CXX_STANDARD##*,}" "${extra_args[@]}" -DCMAKE_VERBOSE_MAKEFILE=ON -DBoost_DEBUG=ON -DBoost_VERBOSE=ON cmake --build . --config Debug --parallel 3 - ctest --output-on-failure --build-config Debug --parallel 3 + ctest --output-on-failure --build-config Debug - name: Cleanup Boost folder to reduce cache usage if: ${{ always() }} From 68e66eefb44befe6d75b77e5fbf15195a0be626d Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Mon, 9 Jun 2025 14:17:35 +0200 Subject: [PATCH 21/23] Workaround file-too-big error on MinGW CI --- .github/workflows/ci.yml | 3 +++ test/Jamfile.jam | 18 +++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 06769cd..818356f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -197,6 +197,9 @@ jobs: if [[ -n "${{matrix.generator}}" ]]; then extra_args+=(-G "${{matrix.generator}}") fi + if [[ "${{matrix.generator}}" == "MinGW"* ]]; then + extra_args+=(-DCMAKE_CXX_FLAGS="-Wa,-mbig-obj") + fi echo "Using extra args: ${extra_args[*]}" cmake .. -DCMAKE_BUILD_TYPE=Debug -DBoost_ROOT="$BOOST_ROOT/stage" -DCMAKE_CXX_STANDARD="${CXX_STANDARD##*,}" "${extra_args[@]}" -DCMAKE_VERBOSE_MAKEFILE=ON -DBoost_DEBUG=ON -DBoost_VERBOSE=ON cmake --build . --config Debug --parallel 3 diff --git a/test/Jamfile.jam b/test/Jamfile.jam index 4cbca98..31a4292 100644 --- a/test/Jamfile.jam +++ b/test/Jamfile.jam @@ -19,16 +19,24 @@ path-constant parent : .. ; run /boost/tools/inspect//inspect/release : $(parent) -text -brief : : always_show_run_output : inspect ; explicit inspect ; -rule run-test ( name ) +rule run-test ( name : options * ) { - run $(name) defined_1.cpp defined_2.cpp undefined.cpp /boost//unit_test_framework : : : : $(name)_ ; - run $(name) undefined.cpp /boost//unit_test_framework : : : MOCK_USE_CONVERSIONS : $(name)_use_conversions ; - run $(name) undefined.cpp /boost//unit_test_framework /boost//thread : : : MOCK_THREAD_SAFE BOOST_THREAD_USES_MOVE multi : $(name)_thread_safe ; + run $(name) defined_1.cpp defined_2.cpp undefined.cpp /boost//unit_test_framework : : : $(options) : $(name)_ ; + run $(name) undefined.cpp /boost//unit_test_framework : : : $(options) MOCK_USE_CONVERSIONS : $(name)_use_conversions ; + run $(name) undefined.cpp /boost//unit_test_framework /boost//thread : : : $(options) MOCK_THREAD_SAFE BOOST_THREAD_USES_MOVE multi : $(name)_thread_safe ; } rule run-tests { - for name in [ glob test_*.cpp detail/test_*.cpp ] { run-test $(name) ; } + for name in [ glob test_*.cpp ] { run-test $(name) ; } + # Avoid object file getting to big on MinGW + run-test detail/test_function.cpp : + gcc,windows:on + gcc,windows:space ; + run-test detail/test_invocation.cpp ; + run-test detail/test_is_functor.cpp ; + run-test detail/test_signature.cpp ; + run-test detail/test_type_name.cpp ; } alias mock_tests : [ run-tests ] ; From f974db3b08cabb42c522426ee731752084938874 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Fri, 13 Jun 2025 15:40:37 +0200 Subject: [PATCH 22/23] Increase verbosity of Boost tests in Appveyor --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index e36753b..c02348d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -82,6 +82,7 @@ build_script: - cd %APPVEYOR_BUILD_FOLDER% - if NOT "%CXX_STANDARD%"=="" set CXX_FLAGS=cxxstd=%CXX_STANDARD% - set BUILD_ARGS=address-model=%ADDRESS_MODEL% variant=%VARIANT% + - set BOOST_TEST_LOG_LEVEL=all - call scripts\build.bat --toolset=%TOOLSET% %CXX_FLAGS% -j3 for: From bfd964961ea5006a8547e3653e9fa260ca2b470e Mon Sep 17 00:00:00 2001 From: Farmer_Markus <145863173+Farmer-Markus@users.noreply.github.com> Date: Fri, 15 Aug 2025 19:38:06 +0200 Subject: [PATCH 23/23] Added boost source build support --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d65ba4e..c232f78 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,11 @@ option(TURTLE_INSTALL "Enable to add install target" ${IS_ROOT_PROJECT}) if(WIN32 AND NOT DEFINED Boost_USE_STATIC_LIBS) set(Boost_USE_STATIC_LIBS ON) endif() -find_package(Boost 1.58 REQUIRED) + +# Allows boost to be build by parent project +if(NOT TARGET Boost::boost) + find_package(Boost 1.58 REQUIRED) +endif() set(MOCK_VERSION "\"${PROJECT_VERSION}\"") set(_turtleVersionFile ${CMAKE_CURRENT_BINARY_DIR}/include/turtle/version.hpp)