From 943f39440fb1ed9945f47d37f2e8ef00e9e7341e Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Mon, 29 Jun 2026 12:29:37 +0200 Subject: [PATCH 01/26] Show b2 invocation --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 818356f9..29c70b76 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -148,6 +148,7 @@ jobs: - name: Boost build run: | + set -x ./b2 "$GITHUB_WORKSPACE/test" -q $B2_FLAGS -j3 ./b2 "$GITHUB_WORKSPACE/doc//mock_examples" -q $B2_FLAGS "$@" working-directory: ${{env.BOOST_ROOT}} From fdff68820276522454817addef6accb3c1f445d3 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Thu, 25 Jun 2026 12:07:59 +0200 Subject: [PATCH 02/26] Update appveyor config --- appveyor.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index c02348df..21354876 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,7 +3,7 @@ # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # # Copyright 2015 Mathieu Champlon -# Copyright 2020-2025 Alexander Grund +# Copyright 2020-2026 Alexander Grund skip_branch_with_pr: true @@ -30,31 +30,35 @@ environment: ADDRESS_MODEL: 64 VARIANT: debug - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 - BOOST: 1_83_0 + BOOST: 1_85_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 + BOOST: 1_89_0 TOOLSET: msvc-14.3 CXX_STANDARD: 14,17 ADDRESS_MODEL: 64 VARIANT: debug - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 - BOOST: 1_86_0 + BOOST: 1_89_0 TOOLSET: msvc-14.3 CXX_STANDARD: 20 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2026 + BOOST: 1_91_0 + TOOLSET: msvc-14.5 + CXX_STANDARD: 20,latest # 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 + BOOST: 1_85_0 CMAKE: true - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 - BOOST: 1_86_0 + BOOST: 1_89_0 CMAKE: true install: From 4caab62ae06cb965a65be5046a5acc35fcb5e1cb Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Tue, 23 Jun 2026 16:55:20 +0200 Subject: [PATCH 03/26] Add newer compilers to GHA CI --- .github/workflows/ci.yml | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 29c70b76..957491bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,21 +42,30 @@ jobs: matrix: include: # Linux, gcc - - { 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 } - - { compiler: gcc-14, cxxstd: '14,17,20', boostBranch: master, os: ubuntu-24.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,23,2c', boostBranch: boost-1.86.0, os: ubuntu-24.04 } + - { compiler: gcc-14, cxxstd: '14,17,20,23,2c', boostBranch: master, os: ubuntu-24.04 } + - { compiler: gcc-15, cxxstd: '14,17,20,23,2c', boostBranch: boost-1.86.0, os: ubuntu-26.04 } + - { compiler: gcc-16, cxxstd: '14,17,20,23,26', boostBranch: boost-1.86.0, os: ubuntu-26.04 } + - { compiler: gcc-16, cxxstd: '14,17,20,23,26', boostBranch: master, os: ubuntu-26.04 } # Linux, clang - - { compiler: clang-14, cxxstd: '14,17,20', boostBranch: boost-1.86.0, os: ubuntu-24.04 } - - { 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 } + - { compiler: clang-14, cxxstd: '14,17,20', boostBranch: boost-1.86.0, os: ubuntu-24.04 } + - { compiler: clang-18, cxxstd: '14,17,20,23,2c', boostBranch: boost-1.86.0, os: ubuntu-24.04 } + - { compiler: clang-18, cxxstd: '14,17,20,23,2c', boostBranch: master, os: ubuntu-24.04 } + - { compiler: clang-19, cxxstd: '14,17,20,23,2c', boostBranch: boost-1.86.0, os: ubuntu-24.04 } + - { compiler: clang-20, cxxstd: '14,17,20,23,2c', boostBranch: boost-1.86.0, os: ubuntu-24.04 } + - { compiler: clang-21, cxxstd: '14,17,20,23,2c', boostBranch: boost-1.86.0, os: ubuntu-26.04 } + - { compiler: clang-22, cxxstd: '14,17,20,23,2c', boostBranch: boost-1.86.0, os: ubuntu-26.04 } + - { compiler: clang-22, cxxstd: '14,17,20,23,2c', boostBranch: master, os: ubuntu-26.04 } # Windows - - { toolset: msvc-14.2, os: windows-2019, cxxstd: 14, 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' } + - { toolset: gcc, os: windows-2022, cxxstd: 17, generator: 'MinGW Makefiles' } + - { toolset: msvc-14.3, os: windows-2022, cxxstd: 20, generator: 'Visual Studio 17 2022' } + - { toolset: msvc-14.5, os: windows-2025-vs2026, cxxstd: 20, generator: 'Visual Studio 18 2026' } + - { toolset: msvc-14.5, os: windows-2025-vs2026, cxxstd: latest, generator: 'Visual Studio 18 2026' } - { name: Collect coverage, coverage: yes, compiler: gcc-8, cxxstd: '14', boostBranch: boost-1.86.0, os: ubuntu-latest, container: 'ubuntu:20.04' } From e88fa7db4900523a3a1b1a20631cf3401f5fb082 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Tue, 23 Jun 2026 17:44:27 +0200 Subject: [PATCH 04/26] CI: Fix C++ standard handling for CMake build --- .github/workflows/ci.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 957491bd..7ac6bd35 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -196,9 +196,10 @@ jobs: echo "LD_LIBRARY_PATH=$PWD/stage/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV - name: CMake build + env: + CXX_STD: ${{matrix.cxxstd}} run: | mkdir build && cd build - CXX_STANDARD="${{matrix.cxxstd}}" if [[ "${{matrix.os}}" == "windows-"* ]]; then extra_args=() else @@ -210,8 +211,19 @@ jobs: if [[ "${{matrix.generator}}" == "MinGW"* ]]; then extra_args+=(-DCMAKE_CXX_FLAGS="-Wa,-mbig-obj") fi + + CXX_STD=${CXX_STD##*,} # Extract last value + case "$CXX_STD" in + latest) CXX_STD="" ;; # MSVC: Use default + # Use older ones instead of aliases + 2b) CXX_STD=20 ;; + 2c) CXX_STD=23 ;; + esac + if [[ -n "$CXX_STD" ]]; then + extra_args+=(-DCMAKE_CXX_STANDARD="$CXX_STD") + 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 .. -DCMAKE_BUILD_TYPE=Debug -DBoost_ROOT="$BOOST_ROOT/stage" "${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 From 635a2c1bc4a70f754dde5d3e4c978734f699c505 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Thu, 25 Jun 2026 11:55:55 +0200 Subject: [PATCH 05/26] Silence `c2y-extensions` warning Triggered by use of `__COUNTER__` in Boost.Test --- .github/workflows/ci.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ac6bd35..00b827d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,8 +58,8 @@ jobs: - { compiler: clang-19, cxxstd: '14,17,20,23,2c', boostBranch: boost-1.86.0, os: ubuntu-24.04 } - { compiler: clang-20, cxxstd: '14,17,20,23,2c', boostBranch: boost-1.86.0, os: ubuntu-24.04 } - { compiler: clang-21, cxxstd: '14,17,20,23,2c', boostBranch: boost-1.86.0, os: ubuntu-26.04 } - - { compiler: clang-22, cxxstd: '14,17,20,23,2c', boostBranch: boost-1.86.0, os: ubuntu-26.04 } - - { compiler: clang-22, cxxstd: '14,17,20,23,2c', boostBranch: master, os: ubuntu-26.04 } + - { compiler: clang-22, cxxstd: '14,17,20,23,2c', boostBranch: boost-1.86.0, os: ubuntu-26.04, cxxflags: '-Wno-c2y-extensions' } + - { compiler: clang-22, cxxstd: '14,17,20,23,2c', boostBranch: master, os: ubuntu-26.04, cxxflags: '-Wno-c2y-extensions' } # Windows - { toolset: gcc, os: windows-2022, cxxstd: 17, generator: 'MinGW Makefiles' } @@ -73,6 +73,8 @@ jobs: timeout-minutes: 120 runs-on: ${{matrix.os}} container: ${{matrix.container}} + env: + B2_CXXFLAGS: ${{matrix.cxxflags}} steps: - name: Prepare container environment @@ -139,6 +141,9 @@ jobs: if [[ "${{matrix.coverage}}" == "yes" ]]; then B2_FLAGS+=" cxxflags=--coverage linkflags=--coverage" fi + if [[ -n $B2_CXXFLAGS ]]; then + B2_FLAGS+=" cxxflags='$B2_CXXFLAGS'" + fi echo "B2_FLAGS=$B2_FLAGS" >> $GITHUB_ENV # Move the Boost root to a sibling folder @@ -211,6 +216,9 @@ jobs: if [[ "${{matrix.generator}}" == "MinGW"* ]]; then extra_args+=(-DCMAKE_CXX_FLAGS="-Wa,-mbig-obj") fi + if [[ -n $B2_CXXFLAGS ]]; then + extra_args+=(-DCMAKE_CXX_FLAGS="$B2_CXXFLAGS") + fi CXX_STD=${CXX_STD##*,} # Extract last value case "$CXX_STD" in From 2d173be6b0e5fa4d678500d5987a8098f28dac17 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Thu, 25 Jun 2026 12:00:08 +0200 Subject: [PATCH 06/26] Pin github actions to commit for security --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00b827d3..67aeeb53 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,9 +26,9 @@ jobs: Formatting: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Formatting - uses: DoozyX/clang-format-lint-action@v0.13 + uses: DoozyX/clang-format-lint-action@bcb4eb2cb0d707ee4f3e5cc3b456eb075f12cf73 # v0.20 with: clangFormatVersion: 10 @@ -93,19 +93,19 @@ jobs: 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 + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: # For coverage builds fetch the whole history, else only 1 commit using a 'fake ternary' fetch-depth: ${{ matrix.coverage && '0' || '1' }} # Checking out Boost and all its submodules takes ages... - name: Cache Boost - uses: actions/cache@v4 + uses: actions/cache@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6.0.0 with: path: boost-root key: boost-${{matrix.boostBranch}} - name: Checkout Boost - uses: actions/checkout@v4 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: repository: boostorg/boost ref: ${{matrix.boostBranch}} @@ -151,7 +151,7 @@ jobs: echo "BOOST_ROOT=${{github.workspace}}/../boost-root" >> $GITHUB_ENV - name: Cache ccache - uses: hendrikmuhs/ccache-action@v1 + uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 if: startsWith(matrix.os, 'ubuntu') with: key: ${{matrix.os}}-${{matrix.compiler}}-${{matrix.boostBranch}} @@ -188,7 +188,7 @@ jobs: lcov --list coverage.info - name: Upload coverage if: matrix.coverage - uses: coverallsapp/github-action@master + uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7 with: path-to-lcov: ${{github.workspace}}/coverage.info github-token: ${{secrets.GITHUB_TOKEN}} From 14ff967ffab7a1428bd28a9eb47583522692d3f5 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Tue, 23 Jun 2026 16:26:30 +0200 Subject: [PATCH 07/26] Supress 'suggest-override' warnings in mocked methods --- include/turtle/config.hpp | 21 +++++++++++++++++++++ include/turtle/detail/mock_impl.hpp | 5 ++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/include/turtle/config.hpp b/include/turtle/config.hpp index 9395005c..222e9816 100644 --- a/include/turtle/config.hpp +++ b/include/turtle/config.hpp @@ -32,6 +32,27 @@ # endif #endif +#if defined(__clang__) && defined(__has_warning) +# define MOCK_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push") +# define MOCK_DIAGNOSTIC_POP _Pragma("clang diagnostic pop") +# if __has_warning("-Wsuggest-override") +# define MOCK_DIAGNOSTIC_IGNORE_SUGGEST_OVERRIDE _Pragma("clang diagnostic ignored \"-Wsuggest-override\"") +# endif +#elif defined(__GNUC__) +# define MOCK_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push") +# define MOCK_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop") +# if(__GNUC__ >= 9) +# define MOCK_DIAGNOSTIC_IGNORE_SUGGEST_OVERRIDE _Pragma("GCC diagnostic ignored \"-Wsuggest-override\"") +# endif +#endif +#ifndef MOCK_DIAGNOSTIC_PUSH +# define MOCK_DIAGNOSTIC_PUSH +# define MOCK_DIAGNOSTIC_POP +#endif +#ifndef MOCK_DIAGNOSTIC_IGNORE_SUGGEST_OVERRIDE +# define MOCK_DIAGNOSTIC_IGNORE_SUGGEST_OVERRIDE +#endif + #if BOOST_VERSION >= 107700 # define MOCK_CXX_VERSION BOOST_CXX_VERSION #elif defined(_MSC_VER) diff --git a/include/turtle/detail/mock_impl.hpp b/include/turtle/detail/mock_impl.hpp index 59fe4e0f..a53edc5f 100644 --- a/include/turtle/detail/mock_impl.hpp +++ b/include/turtle/detail/mock_impl.hpp @@ -60,10 +60,13 @@ namespace mock { namespace detail { #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_DIAGNOSTIC_PUSH \ + MOCK_DIAGNOSTIC_IGNORE_SUGGEST_OVERRIDE \ MOCK_DECL(name, arity, signature, qualifier) \ { \ return MOCK_ANONYMOUS_HELPER(identifier)(MOCK_FORWARD_PARAMS(arity, signature)); \ - } + } \ + MOCK_DIAGNOSTIC_POP #define MOCK_METHOD_EXT(name, arity, signature, identifier) \ MOCK_METHOD_AUX(name, arity, signature, identifier, ) \ From cc267fdf0ac8d6f7b5656c3f04556eafe17ae794 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Thu, 25 Jun 2026 13:04:48 +0200 Subject: [PATCH 08/26] Fix coverage job Use GCC 13 for coverage Using a container seems to conflict with the upload action, likely as paths are different. --- .github/workflows/ci.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67aeeb53..f2c281cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,7 +68,7 @@ jobs: - { toolset: msvc-14.5, os: windows-2025-vs2026, cxxstd: latest, generator: 'Visual Studio 18 2026' } - { name: Collect coverage, coverage: yes, - compiler: gcc-8, cxxstd: '14', boostBranch: boost-1.86.0, os: ubuntu-latest, container: 'ubuntu:20.04' } + compiler: gcc-13, cxxstd: '14,2b', boostBranch: boost-1.86.0, os: ubuntu-24.04 } timeout-minutes: 120 runs-on: ${{matrix.os}} @@ -177,9 +177,17 @@ jobs: - name: Collect coverage if: matrix.coverage + working-directory: ${{github.workspace}} # Make sure file is found by upload action run: | + B2_COMPILER=${{matrix.compiler}} + if [[ "$B2_COMPILER" =~ gcc- ]]; then + ver="${B2_COMPILER##*gcc-}" + else + ver=8 + fi + GCOV=gcov-${ver} lcov --version - lcov --gcov-tool=gcov-8 --directory "$GITHUB_WORKSPACE/test" --capture --output-file all.info + lcov --gcov-tool="$GCOV" --directory "$GITHUB_WORKSPACE/test" --capture --output-file all.info # dump a summary on the console lcov --list all.info # Limit to our files (header-only in this case) From 2757388ffa7957ab8d470b64b35d6533ba762076 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Thu, 25 Jun 2026 19:57:12 +0200 Subject: [PATCH 09/26] Ignore some lcov warnings/errors --- .github/workflows/ci.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f2c281cd..ef0f551e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -187,13 +187,17 @@ jobs: fi GCOV=gcov-${ver} lcov --version - lcov --gcov-tool="$GCOV" --directory "$GITHUB_WORKSPACE/test" --capture --output-file all.info + LCOV_OPTIONS=() + LCOV_OPTIONS+=(--rc "branch_coverage=0") + LCOV_OPTIONS+=(--ignore-errors "inconsistent,mismatch,unused") + + lcov "${LCOV_OPTIONS[@]}" --gcov-tool="$GCOV" --directory "$GITHUB_WORKSPACE/test" --capture --output-file all.info # dump a summary on the console - lcov --list all.info + lcov "${LCOV_OPTIONS[@]}" --list all.info # Limit to our files (header-only in this case) - lcov --extract all.info "$GITHUB_WORKSPACE/include/*" --output-file coverage.info + lcov "${LCOV_OPTIONS[@]}" --extract all.info "$GITHUB_WORKSPACE/include/*" --output-file coverage.info # Output what was collected - lcov --list coverage.info + lcov "${LCOV_OPTIONS[@]}" --list coverage.info - name: Upload coverage if: matrix.coverage uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7 From 7fa1fe1110eea05f2b17accf7ec117a9630539de Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Fri, 26 Jun 2026 10:36:37 +0200 Subject: [PATCH 10/26] Appveyor: Split VS 2026 job due to timeout --- appveyor.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 21354876..a293278b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -48,7 +48,12 @@ environment: - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2026 BOOST: 1_91_0 TOOLSET: msvc-14.5 - CXX_STANDARD: 20,latest + CXX_STANDARD: 20 + + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2026 + BOOST: 1_91_0 + TOOLSET: msvc-14.5 + CXX_STANDARD: latest # CMake builds - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 From f744e2f3608fa1b4a3ae4323ef77f6fdf8e3dcbe Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Fri, 26 Jun 2026 13:31:53 +0200 Subject: [PATCH 11/26] DEBUG --- include/turtle/detail/type_name.hpp | 9 +++++++++ test/Jamfile.jam | 1 + test/detail/test_demangle.cpp | 18 ++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 test/detail/test_demangle.cpp diff --git a/include/turtle/detail/type_name.hpp b/include/turtle/detail/type_name.hpp index 1aaa79dd..0ed8ccb3 100644 --- a/include/turtle/detail/type_name.hpp +++ b/include/turtle/detail/type_name.hpp @@ -19,6 +19,7 @@ #include #include #include +#include #ifdef __GNUC__ # include # include @@ -40,6 +41,10 @@ namespace mock { namespace detail { { const char* name = info.name(); #ifdef __GNUC__ +#ifdef __MINGW32__ + // Add debug output before demangling + std::cerr << "Demangling: " << name; +#endif int status = 0; struct Deleter { @@ -48,6 +53,10 @@ namespace mock { namespace detail { std::unique_ptr demangled(abi::__cxa_demangle(name, 0, 0, &status)); if(!status && demangled) name = demangled.get(); +#ifdef __MINGW32__ + // Add debug output before demangling + std::cerr << " status: " << status << " res=" << name << std::endl; +#endif #endif serialize(s, name); } diff --git a/test/Jamfile.jam b/test/Jamfile.jam index 31a42921..477186dc 100644 --- a/test/Jamfile.jam +++ b/test/Jamfile.jam @@ -37,6 +37,7 @@ rule run-tests run-test detail/test_is_functor.cpp ; run-test detail/test_signature.cpp ; run-test detail/test_type_name.cpp ; + run-test detail/test_demangle.cpp ; } alias mock_tests : [ run-tests ] ; diff --git a/test/detail/test_demangle.cpp b/test/detail/test_demangle.cpp new file mode 100644 index 00000000..40c97649 --- /dev/null +++ b/test/detail/test_demangle.cpp @@ -0,0 +1,18 @@ +// http://turtle.sourceforge.net +// +// Copyright Mathieu Champlon 2009 +// +// 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) + +#include +#include +#include +int main() { + int status = 0; + char* result = abi::__cxa_demangle(typeid(int).name(), 0, 0, &status); + std::cerr << "Demangled " << status << " res=" << static_cast(result); + // Use result... + std::free(result); // or whatever cleanup +} From 10483ffe173b3eae4fefa2706edec99f7eed586d Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Fri, 26 Jun 2026 20:09:46 +0200 Subject: [PATCH 12/26] debug2 --- .github/workflows/ci.yml | 2 +- test/detail/test_demangle.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef0f551e..ff6b33ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -163,7 +163,7 @@ jobs: - name: Boost build run: | set -x - ./b2 "$GITHUB_WORKSPACE/test" -q $B2_FLAGS -j3 + ./b2 "$GITHUB_WORKSPACE/test" -q $B2_FLAGS -d+2 -j3 ./b2 "$GITHUB_WORKSPACE/doc//mock_examples" -q $B2_FLAGS "$@" working-directory: ${{env.BOOST_ROOT}} diff --git a/test/detail/test_demangle.cpp b/test/detail/test_demangle.cpp index 40c97649..ca2cc3e2 100644 --- a/test/detail/test_demangle.cpp +++ b/test/detail/test_demangle.cpp @@ -14,5 +14,5 @@ int main() { char* result = abi::__cxa_demangle(typeid(int).name(), 0, 0, &status); std::cerr << "Demangled " << status << " res=" << static_cast(result); // Use result... - std::free(result); // or whatever cleanup + //std::free(result); // or whatever cleanup } From 8e0c90a0993ba9bfc0386dfa2d3382263c035297 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Sat, 27 Jun 2026 13:19:22 +0200 Subject: [PATCH 13/26] TEST: CMake opt similar to B2 --- CMakeLists.txt | 1 + test/CMakeLists.txt | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c232f786..2a64b366 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,7 @@ set(MOCK_VERSION "\"${PROJECT_VERSION}\"") set(_turtleVersionFile ${CMAKE_CURRENT_BINARY_DIR}/include/turtle/version.hpp) configure_file(version.hpp.cmake ${_turtleVersionFile} @ONLY) +set(CMAKE_CXX_EXTENSIONS OFF) add_library(turtle INTERFACE) add_library(turtle::turtle ALIAS turtle) target_include_directories(turtle INTERFACE $) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 486fdb7f..8e8dfd39 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -50,10 +50,8 @@ foreach(testFile IN LISTS testFiles) add_test(NAME ${curName} COMMAND ${curName}) endforeach() - target_compile_definitions(${name}_use_conversions PRIVATE MOCK_USE_CONVERSIONS) - - target_link_libraries(${name}_thread_safe PRIVATE Boost::thread) - target_compile_definitions(${name}_thread_safe PRIVATE MOCK_THREAD_SAFE) + target_compile_options(${name}_thread_safe PRIVATE -O0) + target_compile_options(${name}_use_conversions PRIVATE -fno-inline) endforeach() # Link test only to check for a regression From c648489166ce890b2409b10fdb365abdc0fed8b5 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Sat, 27 Jun 2026 13:21:54 +0200 Subject: [PATCH 14/26] Debug-compiler-ver --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff6b33ba..c416d359 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -226,6 +226,8 @@ jobs: extra_args+=(-G "${{matrix.generator}}") fi if [[ "${{matrix.generator}}" == "MinGW"* ]]; then + which g++ && g++ --version || true + which c++ && c++ --version || true extra_args+=(-DCMAKE_CXX_FLAGS="-Wa,-mbig-obj") fi if [[ -n $B2_CXXFLAGS ]]; then From a47344fd86fd99d337b02856575391a72abe0b31 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Sat, 27 Jun 2026 20:31:34 +0200 Subject: [PATCH 15/26] Build both --- .github/workflows/ci.yml | 9 ++++++--- CMakeLists.txt | 1 - 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c416d359..e55d8e2e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -244,10 +244,13 @@ jobs: if [[ -n "$CXX_STD" ]]; then extra_args+=(-DCMAKE_CXX_STANDARD="$CXX_STD") fi - echo "Using extra args: ${extra_args[*]}" - cmake .. -DCMAKE_BUILD_TYPE=Debug -DBoost_ROOT="$BOOST_ROOT/stage" "${extra_args[@]}" -DCMAKE_VERBOSE_MAKEFILE=ON -DBoost_DEBUG=ON -DBoost_VERBOSE=ON + for i in ON OFF; do + echo "Using extra args: ${extra_args[*]} -DCMAKE_CXX_EXTENSIONS=$i" + cmake .. -DCMAKE_BUILD_TYPE=Debug -DBoost_ROOT="$BOOST_ROOT/stage" "${extra_args[@]}" -DCMAKE_CXX_EXTENSIONS=$i -DCMAKE_VERBOSE_MAKEFILE=ON -DBoost_DEBUG=ON -DBoost_VERBOSE=ON cmake --build . --config Debug --parallel 3 - ctest --output-on-failure --build-config Debug + ctest --output-on-failure --build-config Debug || true + done + false - name: Cleanup Boost folder to reduce cache usage if: ${{ always() }} diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a64b366..c232f786 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,6 @@ set(MOCK_VERSION "\"${PROJECT_VERSION}\"") set(_turtleVersionFile ${CMAKE_CURRENT_BINARY_DIR}/include/turtle/version.hpp) configure_file(version.hpp.cmake ${_turtleVersionFile} @ONLY) -set(CMAKE_CXX_EXTENSIONS OFF) add_library(turtle INTERFACE) add_library(turtle::turtle ALIAS turtle) target_include_directories(turtle INTERFACE $) From ffe760527001055c20ee731ed495fc112c1a486f Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Mon, 29 Jun 2026 14:19:41 +0200 Subject: [PATCH 16/26] Free and more output --- include/turtle/detail/type_name.hpp | 6 +++++- test/detail/test_demangle.cpp | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/turtle/detail/type_name.hpp b/include/turtle/detail/type_name.hpp index 0ed8ccb3..53511fe5 100644 --- a/include/turtle/detail/type_name.hpp +++ b/include/turtle/detail/type_name.hpp @@ -54,11 +54,15 @@ namespace mock { namespace detail { if(!status && demangled) name = demangled.get(); #ifdef __MINGW32__ - // Add debug output before demangling std::cerr << " status: " << status << " res=" << name << std::endl; #endif #endif serialize(s, name); +#ifdef __MINGW32__ + std::cerr << "Written" << std::endl; + demangled.reset(); + std::cerr << "Freed" << std::endl; +#endif } typedef std::string::size_type size_type; diff --git a/test/detail/test_demangle.cpp b/test/detail/test_demangle.cpp index ca2cc3e2..39761ee4 100644 --- a/test/detail/test_demangle.cpp +++ b/test/detail/test_demangle.cpp @@ -14,5 +14,6 @@ int main() { char* result = abi::__cxa_demangle(typeid(int).name(), 0, 0, &status); std::cerr << "Demangled " << status << " res=" << static_cast(result); // Use result... - //std::free(result); // or whatever cleanup + std::free(result); // or whatever cleanup + std::cerr << "Freed\n"; } From 9a34556b47462c912d18fa23bfb69f09b0e9843d Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Tue, 30 Jun 2026 10:17:13 +0200 Subject: [PATCH 17/26] test2 --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e55d8e2e..3f67049e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -228,7 +228,8 @@ jobs: if [[ "${{matrix.generator}}" == "MinGW"* ]]; then which g++ && g++ --version || true which c++ && c++ --version || true - extra_args+=(-DCMAKE_CXX_FLAGS="-Wa,-mbig-obj") + extra_args+=(-DCMAKE_CXX_COMPILE=g++) + B2_CXXFLAGS=-fno-inline fi if [[ -n $B2_CXXFLAGS ]]; then extra_args+=(-DCMAKE_CXX_FLAGS="$B2_CXXFLAGS") From 75266bb87cd3369ae669e76caf02eb4f5791a65b Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Tue, 30 Jun 2026 10:51:43 +0200 Subject: [PATCH 18/26] Output link script --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f67049e..197dc4ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -249,6 +249,7 @@ jobs: echo "Using extra args: ${extra_args[*]} -DCMAKE_CXX_EXTENSIONS=$i" cmake .. -DCMAKE_BUILD_TYPE=Debug -DBoost_ROOT="$BOOST_ROOT/stage" "${extra_args[@]}" -DCMAKE_CXX_EXTENSIONS=$i -DCMAKE_VERBOSE_MAKEFILE=ON -DBoost_DEBUG=ON -DBoost_VERBOSE=ON cmake --build . --config Debug --parallel 3 + cat CMakeFiles/test_demangle*/link.txt ctest --output-on-failure --build-config Debug || true done false From ab6b138b8f3924fa1f7f551eff389c91d9af758e Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Tue, 30 Jun 2026 10:55:04 +0200 Subject: [PATCH 19/26] Reduce compilations --- test/CMakeLists.txt | 48 +-------------------------------------------- test/Jamfile.jam | 8 -------- 2 files changed, 1 insertion(+), 55 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8e8dfd39..79c7a11b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -35,7 +35,7 @@ elseif(MSVC) endif() # Regular unit tests in variations -file(GLOB_RECURSE testFiles test_*.cpp) +set(testFiles detail/test_demangle.cpp detail/test_type_name.cpp) set(testsUsingUndefinedCPP test_function test_integration) foreach(testFile IN LISTS testFiles) get_filename_component(name ${testFile} NAME_WE) @@ -54,49 +54,3 @@ foreach(testFile IN LISTS testFiles) target_compile_options(${name}_use_conversions PRIVATE -fno-inline) endforeach() -# Link test only to check for a regression -add_executable(link-test_defined EXCLUDE_FROM_ALL test_exception.cpp defined_1.cpp defined_2.cpp) -target_link_libraries(link-test_defined PRIVATE turtle::turtle TurtleTestMain) -add_test(NAME link-test_defined COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_BINARY_DIR} --target link-test_defined --config $) - -# Should fail to compile -file(GLOB_RECURSE compileFailureTestFiles fail_*.cpp) -foreach(testFile IN LISTS compileFailureTestFiles) - get_filename_component(name ${testFile} NAME_WE) - - add_library(${name} STATIC EXCLUDE_FROM_ALL ${testFile}) - target_link_libraries(${name} turtle::turtle) - add_test(NAME compile-${name} COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_BINARY_DIR} --target ${name} --config $) - set_tests_properties(compile-${name} PROPERTIES WILL_FAIL TRUE) -endforeach() - -# Examples are runnable tests -file(GLOB_RECURSE exampleFiles ${PROJECT_SOURCE_DIR}/doc/example/*.cpp) -foreach(testFile IN LISTS exampleFiles) - get_filename_component(name ${testFile} NAME_WE) - set(name "example_${name}") - add_executable(${name} ${testFile}) - target_link_libraries(${name} PRIVATE turtle::turtle TurtleTestMain) - add_test(NAME ${name} COMMAND ${name}) -endforeach() - -file(GLOB_RECURSE exampleTargetFiles ${PROJECT_SOURCE_DIR}/doc/example/*.hpp) -foreach(name IN ITEMS customization getting_started motivation rationale) - target_sources(example_${name} PUBLIC ${exampleTargetFiles}) -endforeach() - -# Expected to trigger a mock failure -set_tests_properties(example_rationale PROPERTIES WILL_FAIL TRUE PASS_REGULAR_EXPRESSION "Exception thrown but should not") -foreach(name IN ITEMS example_patterns_async_call) - target_link_libraries(${name} PRIVATE Boost::thread) - target_compile_definitions(${name} PRIVATE MOCK_THREAD_SAFE BOOST_THREAD_USES_MOVE) -endforeach() - -# Compile benchmarks -file(GLOB_RECURSE benchFiles bench_*.cpp) -foreach(testFile IN LISTS benchFiles) - get_filename_component(name ${testFile} NAME_WE) - add_executable(${name} EXCLUDE_FROM_ALL ${testFile}) - target_link_libraries(${name} PRIVATE turtle::turtle TurtleTestMain) - add_test(NAME ${name} COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_BINARY_DIR} --target ${name} --config $) -endforeach() diff --git a/test/Jamfile.jam b/test/Jamfile.jam index 477186dc..c489c86a 100644 --- a/test/Jamfile.jam +++ b/test/Jamfile.jam @@ -28,14 +28,6 @@ rule run-test ( name : options * ) rule run-tests { - 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 ; run-test detail/test_demangle.cpp ; } From 0d6ea45d71c6b206db2ae4610a1ed97a82aaf48f Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Tue, 30 Jun 2026 11:14:58 +0200 Subject: [PATCH 20/26] linksc --- .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 197dc4ed..c79a6d9b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -249,7 +249,7 @@ jobs: echo "Using extra args: ${extra_args[*]} -DCMAKE_CXX_EXTENSIONS=$i" cmake .. -DCMAKE_BUILD_TYPE=Debug -DBoost_ROOT="$BOOST_ROOT/stage" "${extra_args[@]}" -DCMAKE_CXX_EXTENSIONS=$i -DCMAKE_VERBOSE_MAKEFILE=ON -DBoost_DEBUG=ON -DBoost_VERBOSE=ON cmake --build . --config Debug --parallel 3 - cat CMakeFiles/test_demangle*/link.txt + cat test/CMakeFiles/test_demangle*/link.txt ctest --output-on-failure --build-config Debug || true done false From 426be9319d978c997351d4a895613425bd279dd2 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Tue, 30 Jun 2026 16:52:52 +0200 Subject: [PATCH 21/26] Disable other jobs --- .github/workflows/ci.yml | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c79a6d9b..7c298ba7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,34 +41,7 @@ jobs: fail-fast: false matrix: include: - # Linux, gcc - - { 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,23,2c', boostBranch: boost-1.86.0, os: ubuntu-24.04 } - - { compiler: gcc-14, cxxstd: '14,17,20,23,2c', boostBranch: master, os: ubuntu-24.04 } - - { compiler: gcc-15, cxxstd: '14,17,20,23,2c', boostBranch: boost-1.86.0, os: ubuntu-26.04 } - - { compiler: gcc-16, cxxstd: '14,17,20,23,26', boostBranch: boost-1.86.0, os: ubuntu-26.04 } - - { compiler: gcc-16, cxxstd: '14,17,20,23,26', boostBranch: master, os: ubuntu-26.04 } - - # Linux, clang - - { compiler: clang-14, cxxstd: '14,17,20', boostBranch: boost-1.86.0, os: ubuntu-24.04 } - - { compiler: clang-18, cxxstd: '14,17,20,23,2c', boostBranch: boost-1.86.0, os: ubuntu-24.04 } - - { compiler: clang-18, cxxstd: '14,17,20,23,2c', boostBranch: master, os: ubuntu-24.04 } - - { compiler: clang-19, cxxstd: '14,17,20,23,2c', boostBranch: boost-1.86.0, os: ubuntu-24.04 } - - { compiler: clang-20, cxxstd: '14,17,20,23,2c', boostBranch: boost-1.86.0, os: ubuntu-24.04 } - - { compiler: clang-21, cxxstd: '14,17,20,23,2c', boostBranch: boost-1.86.0, os: ubuntu-26.04 } - - { compiler: clang-22, cxxstd: '14,17,20,23,2c', boostBranch: boost-1.86.0, os: ubuntu-26.04, cxxflags: '-Wno-c2y-extensions' } - - { compiler: clang-22, cxxstd: '14,17,20,23,2c', boostBranch: master, os: ubuntu-26.04, cxxflags: '-Wno-c2y-extensions' } - - # Windows - { toolset: gcc, os: windows-2022, cxxstd: 17, generator: 'MinGW Makefiles' } - - { toolset: msvc-14.3, os: windows-2022, cxxstd: 20, generator: 'Visual Studio 17 2022' } - - { toolset: msvc-14.5, os: windows-2025-vs2026, cxxstd: 20, generator: 'Visual Studio 18 2026' } - - { toolset: msvc-14.5, os: windows-2025-vs2026, cxxstd: latest, generator: 'Visual Studio 18 2026' } - - - { name: Collect coverage, coverage: yes, - compiler: gcc-13, cxxstd: '14,2b', boostBranch: boost-1.86.0, os: ubuntu-24.04 } timeout-minutes: 120 runs-on: ${{matrix.os}} From c556f0edd0a699ca21c5b2730b0e864b4e72e936 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Tue, 30 Jun 2026 16:59:29 +0200 Subject: [PATCH 22/26] Build less --- .github/workflows/ci.yml | 4 +++- test/Jamfile.jam | 12 +----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c298ba7..96ce0624 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -222,7 +222,9 @@ jobs: echo "Using extra args: ${extra_args[*]} -DCMAKE_CXX_EXTENSIONS=$i" cmake .. -DCMAKE_BUILD_TYPE=Debug -DBoost_ROOT="$BOOST_ROOT/stage" "${extra_args[@]}" -DCMAKE_CXX_EXTENSIONS=$i -DCMAKE_VERBOSE_MAKEFILE=ON -DBoost_DEBUG=ON -DBoost_VERBOSE=ON cmake --build . --config Debug --parallel 3 - cat test/CMakeFiles/test_demangle*/link.txt + for i in test/CMakeFiles; do + echo $i; cat $i; + done ctest --output-on-failure --build-config Debug || true done false diff --git a/test/Jamfile.jam b/test/Jamfile.jam index c489c86a..659d923b 100644 --- a/test/Jamfile.jam +++ b/test/Jamfile.jam @@ -21,9 +21,7 @@ explicit inspect ; rule run-test ( name : options * ) { - 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 ; + run $(name) /boost//unit_test_framework : : : $(options) : $(name)_ ; } rule run-tests @@ -34,11 +32,3 @@ rule run-tests alias mock_tests : [ run-tests ] ; -rule run-failures -{ - for name in [ glob fail_*.cpp ] { compile-fail $(name) ; } -} - -alias mock_failures : [ run-failures ] ; - -# How to time bench_*.cpp compilation ? From 6f2233577cc526c638607b8f4b646401e7ee3f8a Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Tue, 30 Jun 2026 18:23:56 +0200 Subject: [PATCH 23/26] Debug --- .github/workflows/ci.yml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96ce0624..85ec6225 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -138,6 +138,11 @@ jobs: set -x ./b2 "$GITHUB_WORKSPACE/test" -q $B2_FLAGS -d+2 -j3 ./b2 "$GITHUB_WORKSPACE/doc//mock_examples" -q $B2_FLAGS "$@" + for i in $(find . -name 'test_demangle*.exe'); do + echo $i + objdump -p $i | grep "DLL Name" || true + objdump -p $i | grep -i "characteristics" || true + done working-directory: ${{env.BOOST_ROOT}} - name: Run inspect check @@ -201,7 +206,7 @@ jobs: if [[ "${{matrix.generator}}" == "MinGW"* ]]; then which g++ && g++ --version || true which c++ && c++ --version || true - extra_args+=(-DCMAKE_CXX_COMPILE=g++) + extra_args+=(-DCMAKE_CXX_COMPILER=g++) B2_CXXFLAGS=-fno-inline fi if [[ -n $B2_CXXFLAGS ]]; then @@ -219,13 +224,19 @@ jobs: extra_args+=(-DCMAKE_CXX_STANDARD="$CXX_STD") fi for i in ON OFF; do - echo "Using extra args: ${extra_args[*]} -DCMAKE_CXX_EXTENSIONS=$i" - cmake .. -DCMAKE_BUILD_TYPE=Debug -DBoost_ROOT="$BOOST_ROOT/stage" "${extra_args[@]}" -DCMAKE_CXX_EXTENSIONS=$i -DCMAKE_VERBOSE_MAKEFILE=ON -DBoost_DEBUG=ON -DBoost_VERBOSE=ON - cmake --build . --config Debug --parallel 3 - for i in test/CMakeFiles; do - echo $i; cat $i; - done - ctest --output-on-failure --build-config Debug || true + echo "Using extra args: ${extra_args[*]} -DCMAKE_EXECUTABLE_ENABLE_EXPORTS=$i" + cmake .. -DCMAKE_BUILD_TYPE=Debug -DBoost_ROOT="$BOOST_ROOT/stage" "${extra_args[@]}" -DCMAKE_EXECUTABLE_ENABLE_EXPORTS=$i -DCMAKE_EXE_LINKER_FLAGS="-Wl,--verbose" -DCMAKE_CXX_EXTENSIONS=OFF -DCMAKE_VERBOSE_MAKEFILE=ON -DBoost_DEBUG=ON -DBoost_VERBOSE=ON + cmake --build . --config Debug --parallel 3 + for i in $(find . -name 'test_demangle*.exe'); do + echo $i + objdump -p $i | grep "DLL Name" || true + objdump -p $i | grep -i "characteristics" || true + done + for i in $(find test/CMakeFiles -type f); do + [[ $i == *".rsp" ]] || continue + echo $i; cat $i; + done + ctest --output-on-failure --build-config Debug || true done false From bde01883e41fb66c91de7111703d14ac0c7f0d36 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Wed, 1 Jul 2026 14:07:16 +0200 Subject: [PATCH 24/26] Format --- include/turtle/detail/type_name.hpp | 22 +++++++++++----------- test/detail/test_demangle.cpp | 5 +++-- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/include/turtle/detail/type_name.hpp b/include/turtle/detail/type_name.hpp index 53511fe5..a5fd062a 100644 --- a/include/turtle/detail/type_name.hpp +++ b/include/turtle/detail/type_name.hpp @@ -15,11 +15,11 @@ #include #include #include +#include #include #include #include #include -#include #ifdef __GNUC__ # include # include @@ -41,10 +41,10 @@ namespace mock { namespace detail { { const char* name = info.name(); #ifdef __GNUC__ -#ifdef __MINGW32__ - // Add debug output before demangling - std::cerr << "Demangling: " << name; -#endif +# ifdef __MINGW32__ + // Add debug output before demangling + std::cerr << "Demangling: " << name; +# endif int status = 0; struct Deleter { @@ -53,15 +53,15 @@ namespace mock { namespace detail { std::unique_ptr demangled(abi::__cxa_demangle(name, 0, 0, &status)); if(!status && demangled) name = demangled.get(); -#ifdef __MINGW32__ - std::cerr << " status: " << status << " res=" << name << std::endl; -#endif +# ifdef __MINGW32__ + std::cerr << " status: " << status << " res=" << name << std::endl; +# endif #endif serialize(s, name); #ifdef __MINGW32__ - std::cerr << "Written" << std::endl; - demangled.reset(); - std::cerr << "Freed" << std::endl; + std::cerr << "Written" << std::endl; + demangled.reset(); + std::cerr << "Freed" << std::endl; #endif } diff --git a/test/detail/test_demangle.cpp b/test/detail/test_demangle.cpp index 39761ee4..ea5d66a4 100644 --- a/test/detail/test_demangle.cpp +++ b/test/detail/test_demangle.cpp @@ -9,11 +9,12 @@ #include #include #include -int main() { +int main() +{ int status = 0; char* result = abi::__cxa_demangle(typeid(int).name(), 0, 0, &status); std::cerr << "Demangled " << status << " res=" << static_cast(result); // Use result... - std::free(result); // or whatever cleanup + std::free(result); // or whatever cleanup std::cerr << "Freed\n"; } From b0cc6f85a649fd5167e21ac1a01fccc8023b2ed4 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Wed, 1 Jul 2026 14:33:33 +0200 Subject: [PATCH 25/26] verbose link --- .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 85ec6225..5eda3043 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -117,7 +117,7 @@ jobs: if [[ -n $B2_CXXFLAGS ]]; then B2_FLAGS+=" cxxflags='$B2_CXXFLAGS'" fi - echo "B2_FLAGS=$B2_FLAGS" >> $GITHUB_ENV + echo "B2_FLAGS=$B2_FLAGS linkflags=-Wl,--verbose" >> $GITHUB_ENV # Move the Boost root to a sibling folder mv boost-root .. From 6ac128f5f78aa17abc77476b86a176076207fa39 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Thu, 2 Jul 2026 10:09:13 +0200 Subject: [PATCH 26/26] debugscr --- .github/workflows/ci.yml | 3 +- debug.sh | 142 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 144 insertions(+), 1 deletion(-) create mode 100755 debug.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5eda3043..c3a9d287 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -238,7 +238,8 @@ jobs: done ctest --output-on-failure --build-config Debug || true done - false + + - run: debug.sh - name: Cleanup Boost folder to reduce cache usage if: ${{ always() }} diff --git a/debug.sh b/debug.sh new file mode 100755 index 00000000..1bba6c5c --- /dev/null +++ b/debug.sh @@ -0,0 +1,142 @@ +#!/bin/bash + +set +e +SRC="$GITHUB_WORKSPACE/test/detail/test_demangle.cpp" +DIAG_DIR="$GITHUB_WORKSPACE/build/diag" +mkdir -p "$DIAG_DIR" +cd "$DIAG_DIR" || exit 0 + +echo "========== ENVIRONMENT ==========" +g++ --version || true +ld --version || true +cmake --version || true + +echo "========== RUNTIME DLL CRT ANALYSIS ==========" +echo "--- libstdc++-6.dll DLL deps ---" +objdump -p C:/mingw64/bin/libstdc++-6.dll | grep "DLL Name" || true +echo "--- libgcc_s_seh-1.dll DLL deps ---" +objdump -p C:/mingw64/bin/libgcc_s_seh-1.dll | grep "DLL Name" || true +echo "--- libstdc++-6.dll malloc/free imports ---" +objdump -p C:/mingw64/bin/libstdc++-6.dll | grep -iE "malloc|^[[:space:]]*free" || true + +echo "========== B2-BUILT EXE ANALYSIS ==========" +B2_EXE=$(find "$GITHUB_WORKSPACE/test/bin" -name 'test_demangle*cpp*.exe' 2>/dev/null | head -1) +echo "b2 exe: $B2_EXE" +if [ -n "$B2_EXE" ]; then + objdump -p "$B2_EXE" | grep -E "DLL Name|Characteristics" || true + echo "--- b2 exe exports (malloc/free?) ---" + objdump -p "$B2_EXE" | grep -iE "malloc|free" || true + echo "--- b2 exe run ---" + "$B2_EXE" 2>&1 || true +else + echo "b2 exe not found" +fi + +echo "========== CMAKE-BUILT EXE ANALYSIS ==========" +CMAKE_EXE="$GITHUB_WORKSPACE/build/test/test_demangle.exe" +if [ -f "$CMAKE_EXE" ]; then + objdump -p "$CMAKE_EXE" | grep -E "DLL Name|Characteristics" || true + echo "--- CMake exe exports (malloc/free?) ---" + objdump -p "$CMAKE_EXE" | grep -iE "malloc|free" || true + echo "--- CMake exe export count ---" + objdump -p "$CMAKE_EXE" | grep -c "\[Ordinal\|Export" || true + echo "--- CMake exe run ---" + "$CMAKE_EXE" 2>&1 || true +fi + +echo "========== CREATE DIAGNOSTIC SOURCE ==========" +cat > diag_demangle.cpp << 'EOF' +#include +#include +#include +#include +int main() { + HMODULE hM=NULL, hF=NULL, hD=NULL; + GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS|GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,(LPCSTR)&malloc,&hM); + GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS|GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,(LPCSTR)&free,&hF); + GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS|GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,(LPCSTR)&abi::__cxa_demangle,&hD); + char mP[MAX_PATH],fP[MAX_PATH],dP[MAX_PATH]; + GetModuleFileNameA(hM,mP,MAX_PATH); GetModuleFileNameA(hF,fP,MAX_PATH); GetModuleFileNameA(hD,dP,MAX_PATH); + printf("malloc @ %p in %s\n",&malloc,mP); + printf("free @ %p in %s\n",&free,fP); + printf("demangle @ %p in %s\n",&abi::__cxa_demangle,dP); + int status=0; + char* result=abi::__cxa_demangle(typeid(int).name(),0,0,&status); + printf("status=%d result=%s\n",status,result?result:"(null)"); + if(result){printf("freeing...\n"); std::free(result); printf("OK\n");} + return 0; +} +EOF +g++ -std=c++17 -O0 -fno-inline -g -c diag_demangle.cpp -o diag.o 2>&1 || true +ar qc diag.a diag.o 2>&1 || true + +echo "========== ISOLATION TESTS ==========" + +echo "--- A: minimal (no flags) ---" +g++ -std=c++17 -g diag.o -o a.exe 2>&1 || true +objdump -p a.exe | grep "DLL Name" || true +./a.exe 2>&1 || true + +echo "--- B: --whole-archive only ---" +g++ -std=c++17 -g -Wl,--whole-archive diag.a -Wl,--no-whole-archive -o b.exe 2>&1 || true +objdump -p b.exe | grep "DLL Name" || true +./b.exe 2>&1 || true + +echo "--- C: --out-implib only ---" +g++ -std=c++17 -g diag.o -o c.exe -Wl,--out-implib,lc.dll.a -Wl,--major-image-version,0,--minor-image-version,0 2>&1 || true +objdump -p c.exe | grep "DLL Name" || true +echo "exports:"; objdump -p c.exe | grep -c "\[Ordinal" || true +./c.exe 2>&1 || true + +echo "--- D: CMake combo (--whole-archive + --out-implib) ---" +g++ -std=c++17 -g -Wl,--whole-archive diag.a -Wl,--no-whole-archive -o d.exe -Wl,--out-implib,ld.dll.a -Wl,--major-image-version,0,--minor-image-version,0 2>&1 || true +objdump -p d.exe | grep "DLL Name" || true +echo "exports:"; objdump -p d.exe | grep -c "\[Ordinal" || true +./d.exe 2>&1 || true + +echo "--- E: b2-style (--start-group + -Bstatic + -Bdynamic) ---" +g++ -std=c++17 -g -Wl,--start-group diag.o -Wl,-Bstatic -Wl,-Bdynamic -Wl,--end-group -o e.exe 2>&1 || true +objdump -p e.exe | grep "DLL Name" || true +./e.exe 2>&1 || true + +echo "--- F: CMake combo + -shared-libgcc ---" +g++ -std=c++17 -g -shared-libgcc -Wl,--whole-archive diag.a -Wl,--no-whole-archive -o f.exe -Wl,--out-implib,lf.dll.a -Wl,--major-image-version,0,--minor-image-version,0 2>&1 || true +objdump -p f.exe | grep "DLL Name" || true +./f.exe 2>&1 || true + +echo "--- G: --out-implib + --export-all-symbols (explicit) ---" +g++ -std=c++17 -g diag.o -o g.exe -Wl,--out-implib,lg.dll.a -Wl,--export-all-symbols 2>&1 || true +objdump -p g.exe | grep "DLL Name" || true +echo "exports:"; objdump -p g.exe | grep -c "\[Ordinal" || true +./g.exe 2>&1 || true + +echo "--- H: --major-image-version only (no --out-implib) ---" +g++ -std=c++17 -g diag.o -o h.exe -Wl,--major-image-version,0,--minor-image-version,0 2>&1 || true +./h.exe 2>&1 || true + +echo "--- I: CMake combo with static Boost.Test ---" +BOOST_STATIC="$BOOST_ROOT/stage/lib/libboost_unit_test_framework-mgw14-mt-d-x64-1_92.a" +if [ -f "$BOOST_STATIC" ]; then + g++ -std=c++17 -g -Wl,--whole-archive diag.a -Wl,--no-whole-archive -o i.exe -Wl,--out-implib,li.dll.a -Wl,--major-image-version,0,--minor-image-version,0 "$BOOST_STATIC" 2>&1 || true + objdump -p i.exe | grep "DLL Name" || true + ./i.exe 2>&1 || true +fi + +echo "--- J: CMake combo with dynamic Boost.Test ---" +BOOST_DLL_A=$(find "$BOOST_ROOT" -name 'libboost_unit_test_framework-mgw14-d-x64-*.dll.a' 2>/dev/null | head -1) +BOOST_DLL_DIR=$(find "$BOOST_ROOT" -name 'libboost_unit_test_framework-mgw14-d-x64-*.dll' -printf '%h\n' 2>/dev/null | head -1) +if [ -n "$BOOST_DLL_A" ]; then + g++ -std=c++17 -g -Wl,--whole-archive diag.a -Wl,--no-whole-archive -o j.exe -Wl,--out-implib,lj.dll.a -Wl,--major-image-version,0,--minor-image-version,0 "$BOOST_DLL_A" 2>&1 || true + objdump -p j.exe | grep "DLL Name" || true + if [ -n "$BOOST_DLL_DIR" ]; then PATH="$BOOST_DLL_DIR:$PATH" ./j.exe 2>&1 || true; fi +fi + +echo "========== MAP FILE ANALYSIS ==========" +echo "--- b2-style map ---" +g++ -std=c++17 -g -Wl,--start-group diag.o -Wl,-Bstatic -Wl,-Bdynamic -Wl,--end-group -o map_b2.exe -Wl,-Map,map_b2.map 2>&1 || true +grep -iE "free|malloc|demangle|__cxa" map_b2.map 2>/dev/null || true +echo "--- CMake-style map ---" +g++ -std=c++17 -g -Wl,--whole-archive diag.a -Wl,--no-whole-archive -o map_cm.exe -Wl,--out-implib,lmap.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -Wl,-Map,map_cm.map 2>&1 || true +grep -iE "free|malloc|demangle|__cxa" map_cm.map 2>/dev/null || true + +echo "========== DONE ==========" \ No newline at end of file