catch3
Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.
Clonegit clone https://git.progmasoft.com/catch3
Harden Catch3 exit guards and pin build workflows
- Commit
97328fefe9650c84b594f1cea212c48562e1745b- Author
- Leitwolf11 ·
- Parents
fbd2ec1c12c3
Changes
.github/dependabot.yml | 4 + .github/workflows/alternative-build-systems.yml | 13 +- .github/workflows/bazel-builds.yml | 37 ++ .github/workflows/codeql.yml | 2 +- .github/workflows/coverage.yml | 34 +- .github/workflows/mac-builds.yml | 5 +- .github/workflows/mac-sanitizer-builds.yml | 12 +- .github/workflows/meson-builds.yml | 9 +- .github/workflows/package-manager-builds.yaml | 11 +- .github/workflows/validate-header-guards.yml | 9 +- .github/workflows/windows-simple-builds.yml | 5 +- .gitignore | 3 +- MODULE.bazel.lock | 472 +++++++++++++++++++++ extras/catch_amalgamated.cpp | 525 ++++++++++++++++-------- extras/catch_amalgamated.hpp | 137 +++++-- requirements-conan.txt | 4 + requirements-header-guards.txt | 4 + requirements-meson.txt | 5 + src/catch2/catch_session.cpp | 102 ++++- src/catch2/catch_tostring.cpp | 30 +- tests/TestScripts/testBazelExitGuardFile.py | 37 ++ 21 files changed, 1203 insertions(+), 257 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3024cb7c..6bad227c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,4 +11,8 @@ updates: directory: / schedule: interval: weekly + - package-ecosystem: pip + directory: / + schedule: + interval: weekly diff --git a/.github/workflows/alternative-build-systems.yml b/.github/workflows/alternative-build-systems.yml index 114d512e..30e59847 100644 --- a/.github/workflows/alternative-build-systems.yml +++ b/.github/workflows/alternative-build-systems.yml @@ -2,6 +2,9 @@ name: Alternative Build Systems on: [push, pull_request] +permissions: + contents: read + jobs: xmake: name: Xmake on ${{ matrix.os }} @@ -12,9 +15,9 @@ jobs: os: [windows-2025, macos-15] steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - - uses: xmake-io/github-action-setup-xmake@v1 + - uses: xmake-io/github-action-setup-xmake@3a1a5dddfc7fa625d9a698738334bf55655a861a # v1 with: xmake-version: '3.1.1' @@ -36,13 +39,13 @@ jobs: os: [windows-2022, macos-15] steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - - uses: abel0b/setup-premake@v2.4 + - uses: abel0b/setup-premake@b80dc6f70e8ab159fb854bdadbeb1a53cfc28723 # v2.4 with: version: '5.0.0-beta7' - - uses: microsoft/setup-msbuild@v3 + - uses: microsoft/setup-msbuild@30375c66a4eea26614e0d39710365f22f8b0af57 # v3 if: runner.os == 'Windows' with: msbuild-architecture: x64 diff --git a/.github/workflows/bazel-builds.yml b/.github/workflows/bazel-builds.yml new file mode 100644 index 00000000..459c4db0 --- /dev/null +++ b/.github/workflows/bazel-builds.yml @@ -0,0 +1,37 @@ +# SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +# SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-1.1 + +name: Bazel Builds + +on: [push, pull_request] + +permissions: + contents: read + +jobs: + build: + name: Bazel on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [windows-2025, macos-15] + + steps: + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 + + - uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0 + with: + bazelisk-cache: true + repository-cache: true + + - name: Run Progmasoft property tests on Windows + if: runner.os == 'Windows' + run: bazel test tests/Progmasoft:property_tests + shell: bash + env: + BAZEL_SH: C:\Program Files\Git\bin\bash.exe + + - name: Run Progmasoft property tests on macOS + if: runner.os == 'macOS' + run: bazel test tests/Progmasoft:property_tests diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index a9f409f0..223f5eee 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -20,7 +20,7 @@ jobs: matrix: language: [actions, c-cpp] steps: - - uses: actions/checkout@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: github/codeql-action/init@7999b86c43a865dc79d8923397f35af22de63401 # v4 with: languages: ${{ matrix.language }} diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 4241f9a1..b1f72428 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -11,14 +11,15 @@ on: permissions: contents: read - id-token: write jobs: - clang: + coverage: runs-on: macos-latest timeout-minutes: 40 + permissions: + contents: read steps: - - uses: actions/checkout@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Configure Clang coverage build run: >- cmake --preset basic-tests -G Ninja @@ -40,9 +41,32 @@ jobs: build/tests/SelfTest \ -object=build/tests/ProgmasoftSelfTest \ > catch3.lcov - - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 + + - name: Upload coverage artifact for Codecov + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: catch3-native-coverage + path: catch3.lcov + if-no-files-found: error + retention-days: 1 + + codecov: + needs: coverage + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository + runs-on: ubuntu-latest + permissions: + id-token: write + steps: + - name: Download coverage artifact + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: catch3-native-coverage + path: coverage + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 with: use_oidc: true - files: catch3.lcov + files: coverage/catch3.lcov flags: catch3-native fail_ci_if_error: true diff --git a/.github/workflows/mac-builds.yml b/.github/workflows/mac-builds.yml index 2262d0bf..d3e9e906 100644 --- a/.github/workflows/mac-builds.yml +++ b/.github/workflows/mac-builds.yml @@ -2,6 +2,9 @@ name: Mac Builds on: [push, pull_request] +permissions: + contents: read + env: CTEST_OUTPUT_ON_FAILURE: 1 CTEST_NO_TESTS_ACTION: error @@ -17,7 +20,7 @@ jobs: std: [14, 17] steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Configure run: | diff --git a/.github/workflows/mac-sanitizer-builds.yml b/.github/workflows/mac-sanitizer-builds.yml index 388afed2..953d0cf7 100644 --- a/.github/workflows/mac-sanitizer-builds.yml +++ b/.github/workflows/mac-sanitizer-builds.yml @@ -2,6 +2,9 @@ name: Mac Sanitizer Builds on: [push, pull_request] +permissions: + contents: read + env: CTEST_OUTPUT_ON_FAILURE: 1 CTEST_NO_TESTS_ACTION: error @@ -25,12 +28,13 @@ jobs: filter: steps: - - uses: actions/checkout@v6 - - - name: Configure + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 + - name: Configure with the selected sanitizers + env: + CXXFLAGS: -fsanitize=${{ matrix.sanitizer }},undefined + LDFLAGS: -fsanitize=${{ matrix.sanitizer }},undefined run: | - CFXXFLAGS=-fsanitize=${{matrix.sanitizer}},undefined cmake --preset ${{matrix.preset}} -GNinja \ -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ -DCMAKE_CXX_STANDARD=${{matrix.std}} \ diff --git a/.github/workflows/meson-builds.yml b/.github/workflows/meson-builds.yml index e7ff79af..bf116da3 100644 --- a/.github/workflows/meson-builds.yml +++ b/.github/workflows/meson-builds.yml @@ -2,6 +2,9 @@ name: Meson Builds on: [push, pull_request] +permissions: + contents: read + jobs: build: name: Meson on ${{ matrix.os }} @@ -12,14 +15,14 @@ jobs: os: [windows-2025, macos-15] steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - - uses: actions/setup-python@v6 + - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: '3.14' - name: Install Meson and Ninja - run: python -m pip install meson ninja + run: python -m pip install --requirement requirements-meson.txt - name: Configure with Clang-CL on Windows if: runner.os == 'Windows' diff --git a/.github/workflows/package-manager-builds.yaml b/.github/workflows/package-manager-builds.yaml index 3041f5f1..8754a7c1 100644 --- a/.github/workflows/package-manager-builds.yaml +++ b/.github/workflows/package-manager-builds.yaml @@ -2,23 +2,24 @@ name: Package Manager Builds on: [push, pull_request] +permissions: + contents: read + jobs: conan_builds: - name: Conan ${{matrix.conan_version}} + name: Conan on ${{ matrix.os }} runs-on: ${{matrix.os}} strategy: fail-fast: false matrix: # Conan's detected MSVC runtime targets the VS 2022 (v143) toolset. os: [macos-15, windows-2022] - conan_version: - - '2.31.1' steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Install conan - run: pip install conan==${{matrix.conan_version}} + run: python -m pip install --requirement requirements-conan.txt - name: Detect a Clang-based Conan profile run: conan profile detect --force diff --git a/.github/workflows/validate-header-guards.yml b/.github/workflows/validate-header-guards.yml index 98641b89..9b85a912 100644 --- a/.github/workflows/validate-header-guards.yml +++ b/.github/workflows/validate-header-guards.yml @@ -2,6 +2,9 @@ name: Check header guards on: [push, pull_request] +permissions: + contents: read + jobs: build: # Set the type of machine to run on @@ -9,14 +12,14 @@ jobs: steps: - name: Checkout source code - uses: actions/checkout@v6 + uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Setup Dependencies - uses: actions/setup-python@v6 + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: '3.12' - name: Install checkguard - run: pip install guardonce + run: python -m pip install --requirement requirements-header-guards.txt - name: Check that include guards are properly named run: | diff --git a/.github/workflows/windows-simple-builds.yml b/.github/workflows/windows-simple-builds.yml index 0caeb6b1..2f244b32 100644 --- a/.github/workflows/windows-simple-builds.yml +++ b/.github/workflows/windows-simple-builds.yml @@ -2,6 +2,9 @@ name: Windows Builds (Basic) on: [push, pull_request] +permissions: + contents: read + env: CTEST_OUTPUT_ON_FAILURE: 1 CTEST_NO_TESTS_ACTION: error @@ -18,7 +21,7 @@ jobs: build_type: [Debug, Release] std: [14, 17] steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Configure build run: | diff --git a/.gitignore b/.gitignore index 88d930ab..ac7ff3f3 100644 --- a/.gitignore +++ b/.gitignore @@ -27,8 +27,7 @@ cmake-build-* benchmark-dir .conan/test_package/build **/CMakeUserPresets.json -bazel-* -MODULE.bazel.lock +/bazel-* build-fuzzers debug-build .vscode diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock new file mode 100644 index 00000000..255955a5 --- /dev/null +++ b/MODULE.bazel.lock @@ -0,0 +1,472 @@ +{ + "lockFileVersion": 28, + "registryFileHashes": { + "https://bcr.bazel.build/bazel_registry.json": "8a28e4aff06ee60aed2a8c281907fb8bcbf3b753c91fb5a5c57da3215d5b3497", + "https://bcr.bazel.build/modules/abseil-cpp/20210324.2/MODULE.bazel": "7cd0312e064fde87c8d1cd79ba06c876bd23630c83466e9500321be55c96ace2", + "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/MODULE.bazel": "70390338f7a5106231d20620712f7cccb659cd0e9d073d1991c038eb9fc57589", + "https://bcr.bazel.build/modules/abseil-cpp/20230125.1/MODULE.bazel": "89047429cb0207707b2dface14ba7f8df85273d484c2572755be4bab7ce9c3a0", + "https://bcr.bazel.build/modules/abseil-cpp/20230802.0.bcr.1/MODULE.bazel": "1c8cec495288dccd14fdae6e3f95f772c1c91857047a098fad772034264cc8cb", + "https://bcr.bazel.build/modules/abseil-cpp/20230802.0/MODULE.bazel": "d253ae36a8bd9ee3c5955384096ccb6baf16a1b1e93e858370da0a3b94f77c16", + "https://bcr.bazel.build/modules/abseil-cpp/20230802.1/MODULE.bazel": "fa92e2eb41a04df73cdabeec37107316f7e5272650f81d6cc096418fe647b915", + "https://bcr.bazel.build/modules/abseil-cpp/20240116.1/MODULE.bazel": "37bcdb4440fbb61df6a1c296ae01b327f19e9bb521f9b8e26ec854b6f97309ed", + "https://bcr.bazel.build/modules/abseil-cpp/20240116.2/MODULE.bazel": "73939767a4686cd9a520d16af5ab440071ed75cec1a876bf2fcfaf1f71987a16", + "https://bcr.bazel.build/modules/abseil-cpp/20250127.1/MODULE.bazel": "c4a89e7ceb9bf1e25cf84a9f830ff6b817b72874088bf5141b314726e46a57c1", + "https://bcr.bazel.build/modules/abseil-cpp/20250512.1/MODULE.bazel": "d209fdb6f36ffaf61c509fcc81b19e81b411a999a934a032e10cd009a0226215", + "https://bcr.bazel.build/modules/abseil-cpp/20250814.1/MODULE.bazel": "51f2312901470cdab0dbdf3b88c40cd21c62a7ed58a3de45b365ddc5b11bcab2", + "https://bcr.bazel.build/modules/abseil-cpp/20250814.1/source.json": "cea3901d7e299da7320700abbaafe57a65d039f10d0d7ea601c4a66938ea4b0c", + "https://bcr.bazel.build/modules/apple_support/1.11.1/MODULE.bazel": "1843d7cd8a58369a444fc6000e7304425fba600ff641592161d9f15b179fb896", + "https://bcr.bazel.build/modules/apple_support/1.15.1/MODULE.bazel": "a0556fefca0b1bb2de8567b8827518f94db6a6e7e7d632b4c48dc5f865bc7c85", + "https://bcr.bazel.build/modules/apple_support/1.21.0/MODULE.bazel": "ac1824ed5edf17dee2fdd4927ada30c9f8c3b520be1b5fd02a5da15bc10bff3e", + "https://bcr.bazel.build/modules/apple_support/1.21.1/MODULE.bazel": "5809fa3efab15d1f3c3c635af6974044bac8a4919c62238cce06acee8a8c11f1", + "https://bcr.bazel.build/modules/apple_support/1.24.2/MODULE.bazel": "0e62471818affb9f0b26f128831d5c40b074d32e6dda5a0d3852847215a41ca4", + "https://bcr.bazel.build/modules/apple_support/1.24.2/source.json": "2c22c9827093250406c5568da6c54e6fdf0ef06238def3d99c71b12feb057a8d", + "https://bcr.bazel.build/modules/bazel_features/1.1.1/MODULE.bazel": "27b8c79ef57efe08efccbd9dd6ef70d61b4798320b8d3c134fd571f78963dbcd", + "https://bcr.bazel.build/modules/bazel_features/1.10.0/MODULE.bazel": "f75e8807570484a99be90abcd52b5e1f390362c258bcb73106f4544957a48101", + "https://bcr.bazel.build/modules/bazel_features/1.11.0/MODULE.bazel": "f9382337dd5a474c3b7d334c2f83e50b6eaedc284253334cf823044a26de03e8", + "https://bcr.bazel.build/modules/bazel_features/1.15.0/MODULE.bazel": "d38ff6e517149dc509406aca0db3ad1efdd890a85e049585b7234d04238e2a4d", + "https://bcr.bazel.build/modules/bazel_features/1.17.0/MODULE.bazel": "039de32d21b816b47bd42c778e0454217e9c9caac4a3cf8e15c7231ee3ddee4d", + "https://bcr.bazel.build/modules/bazel_features/1.18.0/MODULE.bazel": "1be0ae2557ab3a72a57aeb31b29be347bcdc5d2b1eb1e70f39e3851a7e97041a", + "https://bcr.bazel.build/modules/bazel_features/1.19.0/MODULE.bazel": "59adcdf28230d220f0067b1f435b8537dd033bfff8db21335ef9217919c7fb58", + "https://bcr.bazel.build/modules/bazel_features/1.21.0/MODULE.bazel": "675642261665d8eea09989aa3b8afb5c37627f1be178382c320d1b46afba5e3b", + "https://bcr.bazel.build/modules/bazel_features/1.23.0/MODULE.bazel": "fd1ac84bc4e97a5a0816b7fd7d4d4f6d837b0047cf4cbd81652d616af3a6591a", + "https://bcr.bazel.build/modules/bazel_features/1.27.0/MODULE.bazel": "621eeee06c4458a9121d1f104efb80f39d34deff4984e778359c60eaf1a8cb65", + "https://bcr.bazel.build/modules/bazel_features/1.28.0/MODULE.bazel": "4b4200e6cbf8fa335b2c3f43e1d6ef3e240319c33d43d60cc0fbd4b87ece299d", + "https://bcr.bazel.build/modules/bazel_features/1.3.0/MODULE.bazel": "cdcafe83ec318cda34e02948e81d790aab8df7a929cec6f6969f13a489ccecd9", + "https://bcr.bazel.build/modules/bazel_features/1.30.0/MODULE.bazel": "a14b62d05969a293b80257e72e597c2da7f717e1e69fa8b339703ed6731bec87", + "https://bcr.bazel.build/modules/bazel_features/1.33.0/MODULE.bazel": "8b8dc9d2a4c88609409c3191165bccec0e4cb044cd7a72ccbe826583303459f6", + "https://bcr.bazel.build/modules/bazel_features/1.4.1/MODULE.bazel": "e45b6bb2350aff3e442ae1111c555e27eac1d915e77775f6fdc4b351b758b5d7", + "https://bcr.bazel.build/modules/bazel_features/1.42.1/MODULE.bazel": "275a59b5406ff18c01739860aa70ad7ccb3cfb474579411decca11c93b951080", + "https://bcr.bazel.build/modules/bazel_features/1.42.1/source.json": "fcd4396b2df85f64f2b3bb436ad870793ecf39180f1d796f913cc9276d355309", + "https://bcr.bazel.build/modules/bazel_features/1.9.1/MODULE.bazel": "8f679097876a9b609ad1f60249c49d68bfab783dd9be012faf9d82547b14815a", + "https://bcr.bazel.build/modules/bazel_skylib/1.0.3/MODULE.bazel": "bcb0fd896384802d1ad283b4e4eb4d718eebd8cb820b0a2c3a347fb971afd9d8", + "https://bcr.bazel.build/modules/bazel_skylib/1.1.1/MODULE.bazel": "1add3e7d93ff2e6998f9e118022c84d163917d912f5afafb3058e3d2f1545b5e", + "https://bcr.bazel.build/modules/bazel_skylib/1.2.0/MODULE.bazel": "44fe84260e454ed94ad326352a698422dbe372b21a1ac9f3eab76eb531223686", + "https://bcr.bazel.build/modules/bazel_skylib/1.2.1/MODULE.bazel": "f35baf9da0efe45fa3da1696ae906eea3d615ad41e2e3def4aeb4e8bc0ef9a7a", + "https://bcr.bazel.build/modules/bazel_skylib/1.3.0/MODULE.bazel": "20228b92868bf5cfc41bda7afc8a8ba2a543201851de39d990ec957b513579c5", + "https://bcr.bazel.build/modules/bazel_skylib/1.4.1/MODULE.bazel": "a0dcb779424be33100dcae821e9e27e4f2901d9dfd5333efe5ac6a8d7ab75e1d", + "https://bcr.bazel.build/modules/bazel_skylib/1.4.2/MODULE.bazel": "3bd40978e7a1fac911d5989e6b09d8f64921865a45822d8b09e815eaa726a651", + "https://bcr.bazel.build/modules/bazel_skylib/1.5.0/MODULE.bazel": "32880f5e2945ce6a03d1fbd588e9198c0a959bb42297b2cfaf1685b7bc32e138", + "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/MODULE.bazel": "8fdee2dbaace6c252131c00e1de4b165dc65af02ea278476187765e1a617b917", + "https://bcr.bazel.build/modules/bazel_skylib/1.7.0/MODULE.bazel": "0db596f4563de7938de764cc8deeabec291f55e8ec15299718b93c4423e9796d", + "https://bcr.bazel.build/modules/bazel_skylib/1.7.1/MODULE.bazel": "3120d80c5861aa616222ec015332e5f8d3171e062e3e804a2a0253e1be26e59b", + "https://bcr.bazel.build/modules/bazel_skylib/1.8.1/MODULE.bazel": "88ade7293becda963e0e3ea33e7d54d3425127e0a326e0d17da085a5f1f03ff6", + "https://bcr.bazel.build/modules/bazel_skylib/1.8.2/MODULE.bazel": "69ad6927098316848b34a9142bcc975e018ba27f08c4ff403f50c1b6e646ca67", + "https://bcr.bazel.build/modules/bazel_skylib/1.9.0/MODULE.bazel": "72997b29dfd95c3fa0d0c48322d05590418edef451f8db8db5509c57875fb4b7", + "https://bcr.bazel.build/modules/bazel_skylib/1.9.0/source.json": "7ad77c1e8c1b84222d9b3f3cae016a76639435744c19330b0b37c0a3c9da7dc0", + "https://bcr.bazel.build/modules/buildozer/8.5.1/MODULE.bazel": "a35d9561b3fc5b18797c330793e99e3b834a473d5fbd3d7d7634aafc9bdb6f8f", + "https://bcr.bazel.build/modules/buildozer/8.5.1/source.json": "e3386e6ff4529f2442800dee47ad28d3e6487f36a1f75ae39ae56c70f0cd2fbd", + "https://bcr.bazel.build/modules/google_benchmark/1.8.2/MODULE.bazel": "a70cf1bba851000ba93b58ae2f6d76490a9feb74192e57ab8e8ff13c34ec50cb", + "https://bcr.bazel.build/modules/googletest/1.11.0/MODULE.bazel": "3a83f095183f66345ca86aa13c58b59f9f94a2f81999c093d4eeaa2d262d12f4", + "https://bcr.bazel.build/modules/googletest/1.14.0.bcr.1/MODULE.bazel": "22c31a561553727960057361aa33bf20fb2e98584bc4fec007906e27053f80c6", + "https://bcr.bazel.build/modules/googletest/1.14.0/MODULE.bazel": "cfbcbf3e6eac06ef9d85900f64424708cc08687d1b527f0ef65aa7517af8118f", + "https://bcr.bazel.build/modules/googletest/1.15.2/MODULE.bazel": "6de1edc1d26cafb0ea1a6ab3f4d4192d91a312fd2d360b63adaa213cd00b2108", + "https://bcr.bazel.build/modules/googletest/1.17.0/MODULE.bazel": "dbec758171594a705933a29fcf69293d2468c49ec1f2ebca65c36f504d72df46", + "https://bcr.bazel.build/modules/googletest/1.17.0/source.json": "38e4454b25fc30f15439c0378e57909ab1fd0a443158aa35aec685da727cd713", + "https://bcr.bazel.build/modules/jsoncpp/1.9.5/MODULE.bazel": "31271aedc59e815656f5736f282bb7509a97c7ecb43e927ac1a37966e0578075", + "https://bcr.bazel.build/modules/jsoncpp/1.9.6/MODULE.bazel": "2f8d20d3b7d54143213c4dfc3d98225c42de7d666011528dc8fe91591e2e17b0", + "https://bcr.bazel.build/modules/jsoncpp/1.9.6/source.json": "a04756d367a2126c3541682864ecec52f92cdee80a35735a3cb249ce015ca000", + "https://bcr.bazel.build/modules/libpfm/4.11.0/MODULE.bazel": "45061ff025b301940f1e30d2c16bea596c25b176c8b6b3087e92615adbd52902", + "https://bcr.bazel.build/modules/nlohmann_json/3.6.1/MODULE.bazel": "6f7b417dcc794d9add9e556673ad25cb3ba835224290f4f848f8e2db1e1fca74", + "https://bcr.bazel.build/modules/nlohmann_json/3.6.1/source.json": "f448c6e8963fdfa7eb831457df83ad63d3d6355018f6574fb017e8169deb43a9", + "https://bcr.bazel.build/modules/platforms/0.0.10/MODULE.bazel": "8cb8efaf200bdeb2150d93e162c40f388529a25852b332cec879373771e48ed5", + "https://bcr.bazel.build/modules/platforms/0.0.11/MODULE.bazel": "0daefc49732e227caa8bfa834d65dc52e8cc18a2faf80df25e8caea151a9413f", + "https://bcr.bazel.build/modules/platforms/0.0.4/MODULE.bazel": "9b328e31ee156f53f3c416a64f8491f7eb731742655a47c9eec4703a71644aee", + "https://bcr.bazel.build/modules/platforms/0.0.5/MODULE.bazel": "5733b54ea419d5eaf7997054bb55f6a1d0b5ff8aedf0176fef9eea44f3acda37", + "https://bcr.bazel.build/modules/platforms/0.0.6/MODULE.bazel": "ad6eeef431dc52aefd2d77ed20a4b353f8ebf0f4ecdd26a807d2da5aa8cd0615", + "https://bcr.bazel.build/modules/platforms/0.0.7/MODULE.bazel": "72fd4a0ede9ee5c021f6a8dd92b503e089f46c227ba2813ff183b71616034814", + "https://bcr.bazel.build/modules/platforms/0.0.8/MODULE.bazel": "9f142c03e348f6d263719f5074b21ef3adf0b139ee4c5133e2aa35664da9eb2d", + "https://bcr.bazel.build/modules/platforms/0.0.9/MODULE.bazel": "4a87a60c927b56ddd67db50c89acaa62f4ce2a1d2149ccb63ffd871d5ce29ebc", + "https://bcr.bazel.build/modules/platforms/1.0.0/MODULE.bazel": "f05feb42b48f1b3c225e4ccf351f367be0371411a803198ec34a389fb22aa580", + "https://bcr.bazel.build/modules/platforms/1.0.0/source.json": "f4ff1fd412e0246fd38c82328eb209130ead81d62dcd5a9e40910f867f733d96", + "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel": "a5a29bb89544f9b97edce05642fac225a808b5b7be74038ea3640fae2f8e66a7", + "https://bcr.bazel.build/modules/protobuf/27.0/MODULE.bazel": "7873b60be88844a0a1d8f80b9d5d20cfbd8495a689b8763e76c6372998d3f64c", + "https://bcr.bazel.build/modules/protobuf/29.0-rc2/MODULE.bazel": "6241d35983510143049943fc0d57937937122baf1b287862f9dc8590fc4c37df", + "https://bcr.bazel.build/modules/protobuf/29.0-rc3/MODULE.bazel": "33c2dfa286578573afc55a7acaea3cada4122b9631007c594bf0729f41c8de92", + "https://bcr.bazel.build/modules/protobuf/29.1/MODULE.bazel": "557c3457560ff49e122ed76c0bc3397a64af9574691cb8201b4e46d4ab2ecb95", + "https://bcr.bazel.build/modules/protobuf/3.19.0/MODULE.bazel": "6b5fbb433f760a99a22b18b6850ed5784ef0e9928a72668b66e4d7ccd47db9b0", + "https://bcr.bazel.build/modules/protobuf/32.1/MODULE.bazel": "89cd2866a9cb07fee9ff74c41ceace11554f32e0d849de4e23ac55515cfada4d", + "https://bcr.bazel.build/modules/protobuf/33.4/MODULE.bazel": "114775b816b38b6d0ca620450d6b02550c60ceedfdc8d9a229833b34a223dc42", + "https://bcr.bazel.build/modules/protobuf/33.4/source.json": "555f8686b4c7d6b5ba731fbea13bf656b4bfd9a7ff629c1d9d3f6e1d6155de79", + "https://bcr.bazel.build/modules/pybind11_bazel/2.11.1/MODULE.bazel": "88af1c246226d87e65be78ed49ecd1e6f5e98648558c14ce99176da041dc378e", + "https://bcr.bazel.build/modules/pybind11_bazel/2.12.0/MODULE.bazel": "e6f4c20442eaa7c90d7190d8dc539d0ab422f95c65a57cc59562170c58ae3d34", + "https://bcr.bazel.build/modules/pybind11_bazel/2.12.0/source.json": "6900fdc8a9e95866b8c0d4ad4aba4d4236317b5c1cd04c502df3f0d33afed680", + "https://bcr.bazel.build/modules/re2/2023-09-01/MODULE.bazel": "cb3d511531b16cfc78a225a9e2136007a48cf8a677e4264baeab57fe78a80206", + "https://bcr.bazel.build/modules/re2/2024-07-02.bcr.1/MODULE.bazel": "b4963dda9b31080be1905ef085ecd7dd6cd47c05c79b9cdf83ade83ab2ab271a", + "https://bcr.bazel.build/modules/re2/2024-07-02.bcr.1/source.json": "2ff292be6ef3340325ce8a045ecc326e92cbfab47c7cbab4bd85d28971b97ac4", + "https://bcr.bazel.build/modules/re2/2024-07-02/MODULE.bazel": "0eadc4395959969297cbcf31a249ff457f2f1d456228c67719480205aa306daa", + "https://bcr.bazel.build/modules/rules_android/0.1.1/MODULE.bazel": "48809ab0091b07ad0182defb787c4c5328bd3a278938415c00a7b69b50c4d3a8", + "https://bcr.bazel.build/modules/rules_android/0.1.1/source.json": "e6986b41626ee10bdc864937ffb6d6bf275bb5b9c65120e6137d56e6331f089e", + "https://bcr.bazel.build/modules/rules_apple/3.16.0/MODULE.bazel": "0d1caf0b8375942ce98ea944be754a18874041e4e0459401d925577624d3a54a", + "https://bcr.bazel.build/modules/rules_apple/4.1.0/MODULE.bazel": "76e10fd4a48038d3fc7c5dc6e63b7063bbf5304a2e3bd42edda6ec660eebea68", + "https://bcr.bazel.build/modules/rules_apple/4.1.0/source.json": "8ee81e1708756f81b343a5eb2b2f0b953f1d25c4ab3d4a68dc02754872e80715", + "https://bcr.bazel.build/modules/rules_cc/0.0.1/MODULE.bazel": "cb2aa0747f84c6c3a78dad4e2049c154f08ab9d166b1273835a8174940365647", + "https://bcr.bazel.build/modules/rules_cc/0.0.10/MODULE.bazel": "ec1705118f7eaedd6e118508d3d26deba2a4e76476ada7e0e3965211be012002", + "https://bcr.bazel.build/modules/rules_cc/0.0.13/MODULE.bazel": "0e8529ed7b323dad0775ff924d2ae5af7640b23553dfcd4d34344c7e7a867191", + "https://bcr.bazel.build/modules/rules_cc/0.0.15/MODULE.bazel": "6704c35f7b4a72502ee81f61bf88706b54f06b3cbe5558ac17e2e14666cd5dcc", + "https://bcr.bazel.build/modules/rules_cc/0.0.16/MODULE.bazel": "7661303b8fc1b4d7f532e54e9d6565771fea666fbdf839e0a86affcd02defe87", + "https://bcr.bazel.build/modules/rules_cc/0.0.17/MODULE.bazel": "2ae1d8f4238ec67d7185d8861cb0a2cdf4bc608697c331b95bf990e69b62e64a", + "https://bcr.bazel.build/modules/rules_cc/0.0.2/MODULE.bazel": "6915987c90970493ab97393024c156ea8fb9f3bea953b2f3ec05c34f19b5695c", + "https://bcr.bazel.build/modules/rules_cc/0.0.6/MODULE.bazel": "abf360251023dfe3efcef65ab9d56beefa8394d4176dd29529750e1c57eaa33f", + "https://bcr.bazel.build/modules/rules_cc/0.0.8/MODULE.bazel": "964c85c82cfeb6f3855e6a07054fdb159aced38e99a5eecf7bce9d53990afa3e", + "https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel": "836e76439f354b89afe6a911a7adf59a6b2518fafb174483ad78a2a2fde7b1c5", + "https://bcr.bazel.build/modules/rules_cc/0.1.1/MODULE.bazel": "2f0222a6f229f0bf44cd711dc13c858dad98c62d52bd51d8fc3a764a83125513", + "https://bcr.bazel.build/modules/rules_cc/0.1.2/MODULE.bazel": "557ddc3a96858ec0d465a87c0a931054d7dcfd6583af2c7ed3baf494407fd8d0", + "https://bcr.bazel.build/modules/rules_cc/0.1.5/MODULE.bazel": "88dfc9361e8b5ae1008ac38f7cdfd45ad738e4fa676a3ad67d19204f045a1fd8", + "https://bcr.bazel.build/modules/rules_cc/0.2.0/MODULE.bazel": "b5c17f90458caae90d2ccd114c81970062946f49f355610ed89bebf954f5783c", + "https://bcr.bazel.build/modules/rules_cc/0.2.13/MODULE.bazel": "eecdd666eda6be16a8d9dc15e44b5c75133405e820f620a234acc4b1fdc5aa37", + "https://bcr.bazel.build/modules/rules_cc/0.2.17/MODULE.bazel": "1849602c86cb60da8613d2de887f9566a6d354a6df6d7009f9d04a14402f9a84", + "https://bcr.bazel.build/modules/rules_cc/0.2.17/source.json": "3832f45d145354049137c0090df04629d9c2b5493dc5c2bf46f1834040133a07", + "https://bcr.bazel.build/modules/rules_cc/0.2.8/MODULE.bazel": "f1df20f0bf22c28192a794f29b501ee2018fa37a3862a1a2132ae2940a23a642", + "https://bcr.bazel.build/modules/rules_foreign_cc/0.9.0/MODULE.bazel": "c9e8c682bf75b0e7c704166d79b599f93b72cfca5ad7477df596947891feeef6", + "https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/MODULE.bazel": "40c97d1144356f52905566c55811f13b299453a14ac7769dfba2ac38192337a8", + "https://bcr.bazel.build/modules/rules_java/4.0.0/MODULE.bazel": "5a78a7ae82cd1a33cef56dc578c7d2a46ed0dca12643ee45edbb8417899e6f74", + "https://bcr.bazel.build/modules/rules_java/5.3.5/MODULE.bazel": "a4ec4f2db570171e3e5eb753276ee4b389bae16b96207e9d3230895c99644b86", + "https://bcr.bazel.build/modules/rules_java/6.5.2/MODULE.bazel": "1d440d262d0e08453fa0c4d8f699ba81609ed0e9a9a0f02cd10b3e7942e61e31", + "https://bcr.bazel.build/modules/rules_java/7.10.0/MODULE.bazel": "530c3beb3067e870561739f1144329a21c851ff771cd752a49e06e3dc9c2e71a", + "https://bcr.bazel.build/modules/rules_java/7.12.2/MODULE.bazel": "579c505165ee757a4280ef83cda0150eea193eed3bef50b1004ba88b99da6de6", + "https://bcr.bazel.build/modules/rules_java/7.2.0/MODULE.bazel": "06c0334c9be61e6cef2c8c84a7800cef502063269a5af25ceb100b192453d4ab", + "https://bcr.bazel.build/modules/rules_java/7.6.1/MODULE.bazel": "2f14b7e8a1aa2f67ae92bc69d1ec0fa8d9f827c4e17ff5e5f02e91caa3b2d0fe", + "https://bcr.bazel.build/modules/rules_java/8.3.2/MODULE.bazel": "7336d5511ad5af0b8615fdc7477535a2e4e723a357b6713af439fe8cf0195017", + "https://bcr.bazel.build/modules/rules_java/8.5.1/MODULE.bazel": "d8a9e38cc5228881f7055a6079f6f7821a073df3744d441978e7a43e20226939", + "https://bcr.bazel.build/modules/rules_java/8.6.1/MODULE.bazel": "f4808e2ab5b0197f094cabce9f4b006a27766beb6a9975931da07099560ca9c2", + "https://bcr.bazel.build/modules/rules_java/9.1.0/MODULE.bazel": "ee63f27e36a3fada80342869361182f120a9819c74320e8e65b1e04ba0cd7a9d", + "https://bcr.bazel.build/modules/rules_java/9.1.0/source.json": "da589573c1dee2c9ac4a568b301269a2e8191110ff0345c1a959fa7ea6c4dfd6", + "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7", + "https://bcr.bazel.build/modules/rules_jvm_external/5.1/MODULE.bazel": "33f6f999e03183f7d088c9be518a63467dfd0be94a11d0055fe2d210f89aa909", + "https://bcr.bazel.build/modules/rules_jvm_external/5.2/MODULE.bazel": "d9351ba35217ad0de03816ef3ed63f89d411349353077348a45348b096615036", + "https://bcr.bazel.build/modules/rules_jvm_external/6.3/MODULE.bazel": "c998e060b85f71e00de5ec552019347c8bca255062c990ac02d051bb80a38df0", + "https://bcr.bazel.build/modules/rules_jvm_external/6.7/MODULE.bazel": "e717beabc4d091ecb2c803c2d341b88590e9116b8bf7947915eeb33aab4f96dd", + "https://bcr.bazel.build/modules/rules_jvm_external/6.7/source.json": "5426f412d0a7fc6b611643376c7e4a82dec991491b9ce5cb1cfdd25fe2e92be4", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.6/MODULE.bazel": "d269a01a18ee74d0335450b10f62c9ed81f2321d7958a2934e44272fe82dcef3", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.6/source.json": "2faa4794364282db7c06600b7e5e34867a564ae91bda7cae7c29c64e9466b7d5", + "https://bcr.bazel.build/modules/rules_license/0.0.3/MODULE.bazel": "627e9ab0247f7d1e05736b59dbb1b6871373de5ad31c3011880b4133cafd4bd0", + "https://bcr.bazel.build/modules/rules_license/0.0.7/MODULE.bazel": "088fbeb0b6a419005b89cf93fe62d9517c0a2b8bb56af3244af65ecfe37e7d5d", + "https://bcr.bazel.build/modules/rules_license/1.0.0/MODULE.bazel": "a7fda60eefdf3d8c827262ba499957e4df06f659330bbe6cdbdb975b768bb65c", + "https://bcr.bazel.build/modules/rules_license/1.0.0/source.json": "a52c89e54cc311196e478f8382df91c15f7a2bfdf4c6cd0e2675cc2ff0b56efb", + "https://bcr.bazel.build/modules/rules_pkg/0.7.0/MODULE.bazel": "df99f03fc7934a4737122518bb87e667e62d780b610910f0447665a7e2be62dc", + "https://bcr.bazel.build/modules/rules_pkg/1.0.1/MODULE.bazel": "5b1df97dbc29623bccdf2b0dcd0f5cb08e2f2c9050aab1092fd39a41e82686ff", + "https://bcr.bazel.build/modules/rules_pkg/1.0.1/source.json": "bd82e5d7b9ce2d31e380dd9f50c111d678c3bdaca190cb76b0e1c71b05e1ba8a", + "https://bcr.bazel.build/modules/rules_proto/4.0.0/MODULE.bazel": "a7a7b6ce9bee418c1a760b3d84f83a299ad6952f9903c67f19e4edd964894e06", + "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/MODULE.bazel": "e8dff86b0971688790ae75528fe1813f71809b5afd57facb44dad9e8eca631b7", + "https://bcr.bazel.build/modules/rules_proto/6.0.0-rc1/MODULE.bazel": "1e5b502e2e1a9e825eef74476a5a1ee524a92297085015a052510b09a1a09483", + "https://bcr.bazel.build/modules/rules_proto/6.0.2/MODULE.bazel": "ce916b775a62b90b61888052a416ccdda405212b6aaeb39522f7dc53431a5e73", + "https://bcr.bazel.build/modules/rules_proto/7.1.0/MODULE.bazel": "002d62d9108f75bb807cd56245d45648f38275cb3a99dcd45dfb864c5d74cb96", + "https://bcr.bazel.build/modules/rules_proto/7.1.0/source.json": "39f89066c12c24097854e8f57ab8558929f9c8d474d34b2c00ac04630ad8940e", + "https://bcr.bazel.build/modules/rules_python/0.10.2/MODULE.bazel": "cc82bc96f2997baa545ab3ce73f196d040ffb8756fd2d66125a530031cd90e5f", + "https://bcr.bazel.build/modules/rules_python/0.23.1/MODULE.bazel": "49ffccf0511cb8414de28321f5fcf2a31312b47c40cc21577144b7447f2bf300", + "https://bcr.bazel.build/modules/rules_python/0.25.0/MODULE.bazel": "72f1506841c920a1afec76975b35312410eea3aa7b63267436bfb1dd91d2d382", + "https://bcr.bazel.build/modules/rules_python/0.28.0/MODULE.bazel": "cba2573d870babc976664a912539b320cbaa7114cd3e8f053c720171cde331ed", + "https://bcr.bazel.build/modules/rules_python/0.31.0/MODULE.bazel": "93a43dc47ee570e6ec9f5779b2e64c1476a6ce921c48cc9a1678a91dd5f8fd58", + "https://bcr.bazel.build/modules/rules_python/0.33.2/MODULE.bazel": "3e036c4ad8d804a4dad897d333d8dce200d943df4827cb849840055be8d2e937", + "https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel": "9208ee05fd48bf09ac60ed269791cf17fb343db56c8226a720fbb1cdf467166c", + "https://bcr.bazel.build/modules/rules_python/1.3.0/MODULE.bazel": "8361d57eafb67c09b75bf4bbe6be360e1b8f4f18118ab48037f2bd50aa2ccb13", + "https://bcr.bazel.build/modules/rules_python/1.4.1/MODULE.bazel": "8991ad45bdc25018301d6b7e1d3626afc3c8af8aaf4bc04f23d0b99c938b73a6", + "https://bcr.bazel.build/modules/rules_python/1.6.0/MODULE.bazel": "7e04ad8f8d5bea40451cf80b1bd8262552aa73f841415d20db96b7241bd027d8", + "https://bcr.bazel.build/modules/rules_python/1.7.0/MODULE.bazel": "d01f995ecd137abf30238ad9ce97f8fc3ac57289c8b24bd0bf53324d937a14f8", + "https://bcr.bazel.build/modules/rules_python/1.7.0/source.json": "028a084b65dcf8f4dc4f82f8778dbe65df133f234b316828a82e060d81bdce32", + "https://bcr.bazel.build/modules/rules_shell/0.2.0/MODULE.bazel": "fda8a652ab3c7d8fee214de05e7a9916d8b28082234e8d2c0094505c5268ed3c", + "https://bcr.bazel.build/modules/rules_shell/0.3.0/MODULE.bazel": "de4402cd12f4cc8fda2354fce179fdb068c0b9ca1ec2d2b17b3e21b24c1a937b", + "https://bcr.bazel.build/modules/rules_shell/0.6.1/MODULE.bazel": "72e76b0eea4e81611ef5452aa82b3da34caca0c8b7b5c0c9584338aa93bae26b", + "https://bcr.bazel.build/modules/rules_shell/0.6.1/source.json": "20ec05cd5e592055e214b2da8ccb283c7f2a421ea0dc2acbf1aa792e11c03d0c", + "https://bcr.bazel.build/modules/rules_swift/1.16.0/MODULE.bazel": "4a09f199545a60d09895e8281362b1ff3bb08bbde69c6fc87aff5b92fcc916ca", + "https://bcr.bazel.build/modules/rules_swift/2.1.1/MODULE.bazel": "494900a80f944fc7aa61500c2073d9729dff0b764f0e89b824eb746959bc1046", + "https://bcr.bazel.build/modules/rules_swift/2.4.0/MODULE.bazel": "1639617eb1ede28d774d967a738b4a68b0accb40650beadb57c21846beab5efd", + "https://bcr.bazel.build/modules/rules_swift/3.1.2/MODULE.bazel": "72c8f5cf9d26427cee6c76c8e3853eb46ce6b0412a081b2b6db6e8ad56267400", + "https://bcr.bazel.build/modules/rules_swift/3.1.2/source.json": "e85761f3098a6faf40b8187695e3de6d97944e98abd0d8ce579cb2daf6319a66", + "https://bcr.bazel.build/modules/stardoc/0.5.1/MODULE.bazel": "1a05d92974d0c122f5ccf09291442580317cdd859f07a8655f1db9a60374f9f8", + "https://bcr.bazel.build/modules/stardoc/0.5.3/MODULE.bazel": "c7f6948dae6999bf0db32c1858ae345f112cacf98f174c7a8bb707e41b974f1c", + "https://bcr.bazel.build/modules/stardoc/0.7.0/MODULE.bazel": "05e3d6d30c099b6770e97da986c53bd31844d7f13d41412480ea265ac9e8079c", + "https://bcr.bazel.build/modules/stardoc/0.7.2/MODULE.bazel": "fc152419aa2ea0f51c29583fab1e8c99ddefd5b3778421845606ee628629e0e5", + "https://bcr.bazel.build/modules/stardoc/0.7.2/source.json": "58b029e5e901d6802967754adf0a9056747e8176f017cfe3607c0851f4d42216", + "https://bcr.bazel.build/modules/swift_argument_parser/1.3.1.1/MODULE.bazel": "5e463fbfba7b1701d957555ed45097d7f984211330106ccd1352c6e0af0dcf91", + "https://bcr.bazel.build/modules/swift_argument_parser/1.3.1.2/MODULE.bazel": "75aab2373a4bbe2a1260b9bf2a1ebbdbf872d3bd36f80bff058dccd82e89422f", + "https://bcr.bazel.build/modules/swift_argument_parser/1.3.1.2/source.json": "5fba48bbe0ba48761f9e9f75f92876cafb5d07c0ce059cc7a8027416de94a05b", + "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43", + "https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0", + "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.5/MODULE.bazel": "eec517b5bbe5492629466e11dae908d043364302283de25581e3eb944326c4ca", + "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.5/source.json": "22bc55c47af97246cfc093d0acf683a7869377de362b5d1c552c2c2e16b7a806", + "https://bcr.bazel.build/modules/zlib/1.3.1/MODULE.bazel": "751c9940dcfe869f5f7274e1295422a34623555916eb98c174c1e945594bf198" + }, + "selectedYankedVersions": {}, + "moduleExtensions": { + "@@pybind11_bazel+//:internal_configure.bzl%internal_configure_extension": { + "general": { + "bzlTransitiveDigest": "NRXra7941UfmNUyIxnLt82V5hULluVGL2nBsijTl4j4=", + "usagesDigest": "D1r3lfzMuUBFxgG8V6o0bQTLMk3GkaGOaPzw53wrwyw=", + "recordedInputs": [ + "REPO_MAPPING:pybind11_bazel+,bazel_tools bazel_tools", + "FILE:@@pybind11_bazel+//MODULE.bazel e6f4c20442eaa7c90d7190d8dc539d0ab422f95c65a57cc59562170c58ae3d34" + ], + "generatedRepoSpecs": { + "pybind11": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "build_file": "@@pybind11_bazel+//:pybind11-BUILD.bazel", + "strip_prefix": "pybind11-2.12.0", + "urls": [ + "https://github.com/pybind/pybind11/archive/v2.12.0.zip" + ] + } + } + } + } + }, + "@@rules_kotlin+//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions": { + "general": { + "bzlTransitiveDigest": "+Kp6j204mBZ3mxlIDDR0gBoP45BZ4jYRhRAcB8sU0qc=", + "usagesDigest": "QI2z8ZUR+mqtbwsf2fLqYdJAkPOHdOV+tF2yVAUgRzw=", + "recordedInputs": [ + "REPO_MAPPING:rules_kotlin+,bazel_tools bazel_tools" + ], + "generatedRepoSpecs": { + "com_github_jetbrains_kotlin_git": { + "repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl%kotlin_compiler_git_repository", + "attributes": { + "urls": [ + "https://github.com/JetBrains/kotlin/releases/download/v1.9.23/kotlin-compiler-1.9.23.zip" + ], + "sha256": "93137d3aab9afa9b27cb06a824c2324195c6b6f6179d8a8653f440f5bd58be88" + } + }, + "com_github_jetbrains_kotlin": { + "repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl%kotlin_capabilities_repository", + "attributes": { + "git_repository_name": "com_github_jetbrains_kotlin_git", + "compiler_version": "1.9.23" + } + }, + "com_github_google_ksp": { + "repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:ksp.bzl%ksp_compiler_plugin_repository", + "attributes": { + "urls": [ + "https://github.com/google/ksp/releases/download/1.9.23-1.0.20/artifacts.zip" + ], + "sha256": "ee0618755913ef7fd6511288a232e8fad24838b9af6ea73972a76e81053c8c2d", + "strip_version": "1.9.23-1.0.20" + } + }, + "com_github_pinterest_ktlint": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_file", + "attributes": { + "sha256": "01b2e0ef893383a50dbeb13970fe7fa3be36ca3e83259e01649945b09d736985", + "urls": [ + "https://github.com/pinterest/ktlint/releases/download/1.3.0/ktlint" + ], + "executable": true + } + }, + "rules_android": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "sha256": "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806", + "strip_prefix": "rules_android-0.1.1", + "urls": [ + "https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip" + ] + } + } + } + } + }, + "@@rules_python+//python/extensions:config.bzl%config": { + "general": { + "bzlTransitiveDigest": "dzD8Q2YmrP3fz8saWLHPmlwPLO91ImtTmP/c9JKTStM=", + "usagesDigest": "ZVSXMAGpD+xzVNPuvF1IoLBkty7TROO0+akMapt1pAg=", + "recordedInputs": [ + "REPO_MAPPING:rules_python+,bazel_tools bazel_tools", + "REPO_MAPPING:rules_python+,pypi__build rules_python++config+pypi__build", + "REPO_MAPPING:rules_python+,pypi__click rules_python++config+pypi__click", + "REPO_MAPPING:rules_python+,pypi__colorama rules_python++config+pypi__colorama", + "REPO_MAPPING:rules_python+,pypi__importlib_metadata rules_python++config+pypi__importlib_metadata", + "REPO_MAPPING:rules_python+,pypi__installer rules_python++config+pypi__installer", + "REPO_MAPPING:rules_python+,pypi__more_itertools rules_python++config+pypi__more_itertools", + "REPO_MAPPING:rules_python+,pypi__packaging rules_python++config+pypi__packaging", + "REPO_MAPPING:rules_python+,pypi__pep517 rules_python++config+pypi__pep517", + "REPO_MAPPING:rules_python+,pypi__pip rules_python++config+pypi__pip", + "REPO_MAPPING:rules_python+,pypi__pip_tools rules_python++config+pypi__pip_tools", + "REPO_MAPPING:rules_python+,pypi__pyproject_hooks rules_python++config+pypi__pyproject_hooks", + "REPO_MAPPING:rules_python+,pypi__setuptools rules_python++config+pypi__setuptools", + "REPO_MAPPING:rules_python+,pypi__tomli rules_python++config+pypi__tomli", + "REPO_MAPPING:rules_python+,pypi__wheel rules_python++config+pypi__wheel", + "REPO_MAPPING:rules_python+,pypi__zipp rules_python++config+pypi__zipp" + ], + "generatedRepoSpecs": { + "rules_python_internal": { + "repoRuleId": "@@rules_python+//python/private:internal_config_repo.bzl%internal_config_repo", + "attributes": { + "transition_setting_generators": {}, + "transition_settings": [] + } + }, + "pypi__build": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/e2/03/f3c8ba0a6b6e30d7d18c40faab90807c9bb5e9a1e3b2fe2008af624a9c97/build-1.2.1-py3-none-any.whl", + "sha256": "75e10f767a433d9a86e50d83f418e83efc18ede923ee5ff7df93b6cb0306c5d4", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__click": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/00/2e/d53fa4befbf2cfa713304affc7ca780ce4fc1fd8710527771b58311a3229/click-8.1.7-py3-none-any.whl", + "sha256": "ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__colorama": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", + "sha256": "4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__importlib_metadata": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/2d/0a/679461c511447ffaf176567d5c496d1de27cbe34a87df6677d7171b2fbd4/importlib_metadata-7.1.0-py3-none-any.whl", + "sha256": "30962b96c0c223483ed6cc7280e7f0199feb01a0e40cfae4d4450fc6fab1f570", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__installer": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/e5/ca/1172b6638d52f2d6caa2dd262ec4c811ba59eee96d54a7701930726bce18/installer-0.7.0-py3-none-any.whl", + "sha256": "05d1933f0a5ba7d8d6296bb6d5018e7c94fa473ceb10cf198a92ccea19c27b53", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__more_itertools": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/50/e2/8e10e465ee3987bb7c9ab69efb91d867d93959095f4807db102d07995d94/more_itertools-10.2.0-py3-none-any.whl", + "sha256": "686b06abe565edfab151cb8fd385a05651e1fdf8f0a14191e4439283421f8684", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__packaging": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/49/df/1fceb2f8900f8639e278b056416d49134fb8d84c5942ffaa01ad34782422/packaging-24.0-py3-none-any.whl", + "sha256": "2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__pep517": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/25/6e/ca4a5434eb0e502210f591b97537d322546e4833dcb4d470a48c375c5540/pep517-0.13.1-py3-none-any.whl", + "sha256": "31b206f67165b3536dd577c5c3f1518e8fbaf38cbc57efff8369a392feff1721", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__pip": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/8a/6a/19e9fe04fca059ccf770861c7d5721ab4c2aebc539889e97c7977528a53b/pip-24.0-py3-none-any.whl", + "sha256": "ba0d021a166865d2265246961bec0152ff124de910c5cc39f1156ce3fa7c69dc", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__pip_tools": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/0d/dc/38f4ce065e92c66f058ea7a368a9c5de4e702272b479c0992059f7693941/pip_tools-7.4.1-py3-none-any.whl", + "sha256": "4c690e5fbae2f21e87843e89c26191f0d9454f362d8acdbd695716493ec8b3a9", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__pyproject_hooks": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/ae/f3/431b9d5fe7d14af7a32340792ef43b8a714e7726f1d7b69cc4e8e7a3f1d7/pyproject_hooks-1.1.0-py3-none-any.whl", + "sha256": "7ceeefe9aec63a1064c18d939bdc3adf2d8aa1988a510afec15151578b232aa2", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__setuptools": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/90/99/158ad0609729111163fc1f674a5a42f2605371a4cf036d0441070e2f7455/setuptools-78.1.1-py3-none-any.whl", + "sha256": "c3a9c4211ff4c309edb8b8c4f1cbfa7ae324c4ba9f91ff254e3d305b9fd54561", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__tomli": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/97/75/10a9ebee3fd790d20926a90a2547f0bf78f371b2f13aa822c759680ca7b9/tomli-2.0.1-py3-none-any.whl", + "sha256": "939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__wheel": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/7d/cd/d7460c9a869b16c3dd4e1e403cce337df165368c71d6af229a74699622ce/wheel-0.43.0-py3-none-any.whl", + "sha256": "55c570405f142630c6b9f72fe09d9b67cf1477fcf543ae5b8dcb1f5b7377da81", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__zipp": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/da/55/a03fd7240714916507e1fcf7ae355bd9d9ed2e6db492595f1a67f61681be/zipp-3.18.2-py3-none-any.whl", + "sha256": "dce197b859eb796242b0622af1b8beb0a722d52aa2f57133ead08edd5bf5374e", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + } + } + } + }, + "@@rules_python+//python/uv:uv.bzl%uv": { + "general": { + "bzlTransitiveDigest": "ijW9KS7qsIY+yBVvJ+Nr1mzwQox09j13DnE3iIwaeTM=", + "usagesDigest": "H8dQoNZcoqP+Mu0tHZTi4KHATzvNkM5ePuEqoQdklIU=", + "recordedInputs": [ + "REPO_MAPPING:rules_python+,bazel_tools bazel_tools", + "REPO_MAPPING:rules_python+,platforms platforms" + ], + "generatedRepoSpecs": { + "uv": { + "repoRuleId": "@@rules_python+//python/uv/private:uv_toolchains_repo.bzl%uv_toolchains_repo", + "attributes": { + "toolchain_type": "'@@rules_python+//python/uv:uv_toolchain_type'", + "toolchain_names": [ + "none" + ], + "toolchain_implementations": { + "none": "'@@rules_python+//python:none'" + }, + "toolchain_compatible_with": { + "none": [ + "@platforms//:incompatible" + ] + }, + "toolchain_target_settings": {} + } + } + } + } + } + }, + "facts": {}, + "factsVersions": {} +} diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 73ef255d..c6a8de36 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -7,7 +7,7 @@ // SPDX-License-Identifier: BSL-1.0 // Catch v3.16.0 -// Generated: 2026-08-25 09:29:23.172704 +// Generated: 2026-09-28 00:12:28.744397 // ---------------------------------------------------------- // This file is an amalgamation of multiple different files. // You probably shouldn't edit it directly. @@ -1248,11 +1248,22 @@ namespace Catch { #include <cassert> +#include <cerrno> #include <cstdio> #include <cstdlib> +#include <cstring> #include <exception> #include <iomanip> -#include <set> + +#if defined( _WIN32 ) +# include <fcntl.h> +# include <io.h> +# include <sys/stat.h> +#else +# include <fcntl.h> +# include <sys/stat.h> +# include <unistd.h> +#endif namespace Catch { @@ -1307,24 +1318,32 @@ namespace Catch { assert( m_config->testSpec().getInvalidSpecs().empty() && "Invalid test specs should be handled before running tests" ); + // Note that we are working with pointers into this vector + // of sorted test cases, so sorting/unique-ing the pointers + // keeps the user-specified order. auto const& allTestCases = getAllTestCasesSorted(*m_config); auto const& testSpec = m_config->testSpec(); + m_tests.reserve( allTestCases.size() ); if ( !testSpec.hasFilters() ) { for ( auto const& test : allTestCases ) { if ( !test.getTestCaseInfo().isHidden() ) { - m_tests.emplace( &test ); + m_tests.push_back( &test ); } } } else { - m_matches = - testSpec.matchesByFilter( allTestCases, *m_config ); + m_matches = testSpec.matchesByFilter( allTestCases, *m_config ); for ( auto const& match : m_matches ) { - m_tests.insert( match.tests.begin(), + m_tests.insert( m_tests.end(), + match.tests.begin(), match.tests.end() ); } + std::sort( m_tests.begin(), m_tests.end() ); + m_tests.erase( + std::unique( m_tests.begin(), m_tests.end() ), + m_tests.end() ); } - m_tests = createShard(m_tests, m_config->shardCount(), m_config->shardIndex()); + m_tests = createShard(CATCH_MOVE(m_tests), m_config->shardCount(), m_config->shardIndex()); } Totals execute() { @@ -1355,7 +1374,7 @@ namespace Catch { IEventListener* m_reporter; Config const* m_config; RunContext m_context; - std::set<TestCaseHandle const*> m_tests; + std::vector<TestCaseHandle const*> m_tests; TestSpec::Matches m_matches; bool m_unmatchedTestSpecs = false; }; @@ -1364,29 +1383,93 @@ namespace Catch { getMutableRegistryHub().getMutableTestCaseRegistry().enableFilenameTags(); } - // Creates empty file at path. The path must be writable, we do not - // try to create directories in path because that's hard in C++14. + std::FILE* openGuardFile( std::string const& guardFilePath, + int& error ) { +#if defined( _MSC_VER ) + std::FILE* file = nullptr; + error = fopen_s( &file, guardFilePath.c_str(), "w" ); + return error ? nullptr : file; +#elif defined( _WIN32 ) + const int descriptor = _open( guardFilePath.c_str(), + _O_WRONLY | _O_CREAT | _O_TRUNC | + _O_BINARY | _O_NOINHERIT, + _S_IREAD | _S_IWRITE ); + if ( descriptor == -1 ) { + error = errno; + return nullptr; + } + std::FILE* const file = _fdopen( descriptor, "w" ); + if ( file == nullptr ) { + error = errno; + _close( descriptor ); + } + return file; +#else + int flags = O_WRONLY | O_CREAT | O_TRUNC; +# if defined( O_NONBLOCK ) + flags |= O_NONBLOCK; +# endif +# if defined( O_CLOEXEC ) + flags |= O_CLOEXEC; +# endif +# if defined( O_NOFOLLOW ) + // Do not let a stale guard-file symlink redirect this write. + flags |= O_NOFOLLOW; +# endif + const int descriptor = + ::open( guardFilePath.c_str(), flags, S_IRUSR | S_IWUSR ); + if ( descriptor == -1 ) { + error = errno; + return nullptr; + } + + struct stat fileStatus = {}; + if ( ::fstat( descriptor, &fileStatus ) != 0 ) { + error = errno; + ::close( descriptor ); + return nullptr; + } + if ( !S_ISREG( fileStatus.st_mode ) ) { + error = EINVAL; + ::close( descriptor ); + return nullptr; + } + // The creation mode is already owner-only; also tighten an + // existing regular guard file before it is reused. + if ( ::fchmod( descriptor, S_IRUSR | S_IWUSR ) != 0 ) { + error = errno; + ::close( descriptor ); + return nullptr; + } + + std::FILE* const file = ::fdopen( descriptor, "w" ); + if ( file == nullptr ) { + error = errno; + ::close( descriptor ); + } + return file; +#endif + } + + // Creates an owner-only guard file. The path must be writable; we do + // not create its parent directories. void setUpGuardFile( std::string const& guardFilePath ) { if ( !guardFilePath.empty() ) { -#if defined( _MSC_VER ) - std::FILE* file = nullptr; - if ( fopen_s( &file, guardFilePath.c_str(), "w" ) ) { - char msgBuffer[100]; - const auto err = errno; + int err = 0; + std::FILE* const file = openGuardFile( guardFilePath, err ); + if ( file == nullptr ) { + char msgBuffer[100] = {}; std::string errMsg; +#if defined( _MSC_VER ) if ( !strerror_s( msgBuffer, err ) ) { errMsg = msgBuffer; } else { errMsg = "Could not translate errno to a string"; } - #else - std::FILE* file = std::fopen( guardFilePath.c_str(), "w" ); - if ( !file ) { - const auto err = errno; - const char* errMsg = std::strerror( err ); + const char* const message = std::strerror( err ); + errMsg = message ? message : "Unknown error"; #endif - CATCH_RUNTIME_ERROR( "Could not open the exit guard file '" << guardFilePath << "' because '" << errMsg << "' (" << err << ')' ); @@ -1668,6 +1751,7 @@ namespace Catch { #include <cassert> #include <cctype> #include <algorithm> +#include <utility> namespace Catch { @@ -1701,32 +1785,27 @@ namespace Catch { return tcp != TestCaseProperties::None; } - TestCaseProperties parseSpecialTag( StringRef tag ) { - if( !tag.empty() && tag[0] == '.' ) - return TestCaseProperties::IsHidden; - else if( tag == "!throws"_sr ) - return TestCaseProperties::Throws; - else if( tag == "!shouldfail"_sr ) - return TestCaseProperties::ShouldFail; - else if( tag == "!mayfail"_sr ) - return TestCaseProperties::MayFail; - else if( tag == "!nonportable"_sr ) - return TestCaseProperties::NonPortable; - else if( tag == "!benchmark"_sr ) - return TestCaseProperties::Benchmark | TestCaseProperties::IsHidden; - else - return TestCaseProperties::None; - } - bool isReservedTag( StringRef tag ) { - return parseSpecialTag( tag ) == TestCaseProperties::None - && tag.size() > 0 - && !std::isalnum( static_cast<unsigned char>(tag[0]) ); - } - void enforceNotReservedTag( StringRef tag, SourceLineInfo const& _lineInfo ) { - CATCH_ENFORCE( !isReservedTag(tag), - "Tag name: [" << tag << "] is not allowed.\n" - << "Tag names starting with non alphanumeric characters are reserved\n" - << _lineInfo ); + TestCaseProperties propertiesFromTag( StringRef tag, SourceLineInfo const& _lineInfo ) { + if ( tag.empty() ) { return TestCaseProperties::None; } + // All tags starting with alphanumeric characters are normal. + if ( std::isalnum( tag[0] ) ) { return TestCaseProperties::None; } + + // Explicitly check known special tags, and error out if it is not one of them + if ( tag[0] == '.' ) { return TestCaseProperties::IsHidden; } + else if ( tag == "!throws"_sr ) { return TestCaseProperties::Throws; } + else if ( tag == "!shouldfail"_sr ) { return TestCaseProperties::ShouldFail; } + else if ( tag == "!mayfail"_sr ) { return TestCaseProperties::MayFail; } + else if ( tag == "!nonportable"_sr ) { return TestCaseProperties::NonPortable; } + else if ( tag == "!benchmark"_sr ) { + return TestCaseProperties::Benchmark | + TestCaseProperties::IsHidden; + } else { + CATCH_RUNTIME_ERROR( + "Tag name: [" << tag << "] is not allowed.\n" + << "Tag names starting with non-alphanumeric " + "characters are reserved.\n" + << _lineInfo ); + } } std::string makeDefaultName() { @@ -1788,6 +1867,18 @@ namespace Catch { auto requiredSize = originalTags.size() + sizeOfExtraTags(_lineInfo.file); backingTags.reserve(requiredSize); + // Since there is usually only small number of tags on a test case, + // the geometric growth on vector does not get time to properly + // amortize the reallocations. But we can save a lot of time by + // pre-allocating space for all tags. + if ( !originalTags.empty() ) { + size_t tagCount = 1; // 1 for filename tag + for ( size_t i = 0; i < originalTags.size(); ++i ) { + if ( originalTags[i] == '[' ) { ++tagCount; } + } + tags.reserve( tagCount ); + } + // We cannot copy the tags directly, as we need to normalize // some tags, so that [.foo] is copied as [.][foo]. size_t tagStart = 0; @@ -1823,8 +1914,7 @@ namespace Catch { << _nameAndTags.name << "' at " << _lineInfo ); - enforceNotReservedTag(tagStr, lineInfo); - properties |= parseSpecialTag(tagStr); + properties |= propertiesFromTag(tagStr, _lineInfo); // When copying a tag to the backing storage, we need to // check if it is a merged hide tag, such as [.foo], and // if it is, we need to handle it as if it was [foo]. @@ -1847,10 +1937,21 @@ namespace Catch { internalAppendTag("."_sr); } - // Sort and prepare tags - std::sort(begin(tags), end(tags)); - tags.erase(std::unique(begin(tags), end(tags)), - end(tags)); + // Tests usually have small number of tags, so we explicitly handle + // the 1 and 2 tags cases for better performance in low-opt builds. + switch ( tags.size() ) { + case 1: + break; + case 2: + if ( tags[0] == tags[1] ) { tags.pop_back(); } + else if ( tags[1] < tags[0] ) { std::swap( tags[0], tags[1] ); } + break; + default: + std::sort( begin( tags ), end( tags ) ); + tags.erase( std::unique( begin( tags ), end( tags ) ), + end( tags ) ); + } + } bool TestCaseInfo::isHidden() const { @@ -1913,6 +2014,12 @@ namespace Catch { return lhs.tags < rhs.tags; } + bool operator==( TestCaseInfo const& lhs, TestCaseInfo const& rhs ) { + return lhs.name == rhs.name + && lhs.className == rhs.className + && lhs.tags == rhs.tags; + } + } // end namespace Catch @@ -1937,7 +2044,7 @@ namespace Catch { TestSpec::NamePattern::NamePattern( std::string const& name, std::string const& filterString ) : Pattern( filterString ) - , m_wildcardPattern( toLower( name ), CaseSensitive::No ) + , m_wildcardPattern( name, CaseSensitive::No ) {} bool TestSpec::NamePattern::matches( TestCaseInfo const& testCase ) const { @@ -2018,12 +2125,14 @@ namespace Catch { matches.reserve( m_filters.size() ); for ( auto const& filter : m_filters ) { std::vector<TestCaseHandle const*> currentMatches; - for ( auto const& test : testCases ) + for ( auto const& test : testCases ) { if ( isThrowSafe( test, config ) && - filter.matches( test.getTestCaseInfo() ) ) + filter.matches( test.getTestCaseInfo() ) ) { currentMatches.emplace_back( &test ); - matches.push_back( - FilterMatch{ extractFilterName( filter ), currentMatches } ); + } + } + matches.push_back( FilterMatch{ extractFilterName( filter ), + CATCH_MOVE( currentMatches ) } ); } return matches; } @@ -2131,26 +2240,40 @@ namespace Detail { } std::string formatTimeT(std::time_t time) { -#ifdef _MSC_VER std::tm timeInfo = {}; +#ifdef _MSC_VER const auto err = gmtime_s( &timeInfo, &time ); if ( err ) { return "gmtime from provided timepoint has failed. This " "happens e.g. with pre-1970 dates using Microsoft libc"; } +#elif defined( __MINGW32__ ) + if ( gmtime_s( &timeInfo, &time ) != 0 ) { + return "gmtime from provided timepoint has failed"; + } +#elif defined( CATCH_PLATFORM_PLAYSTATION ) + gmtime_s( &time, &timeInfo ); +#elif defined( __IAR_SYSTEMS_ICC__ ) + // This toolchain does not provide gmtime_r. Copy the result immediately + // so the formatter does not retain the C library's static buffer. + const std::tm* const converted = std::gmtime( &time ); + if ( converted == nullptr ) { + return "gmtime from provided timepoint has failed"; + } + timeInfo = *converted; #else - std::tm* timeInfo = std::gmtime( &time ); + if ( gmtime_r( &time, &timeInfo ) == nullptr ) { + return "gmtime from provided timepoint has failed"; + } #endif auto const timeStampSize = sizeof( "2017-01-16T17:06:45Z" ); - char timeStamp[timeStampSize]; + char timeStamp[timeStampSize] = {}; const char* const fmt = "%Y-%m-%dT%H:%M:%SZ"; -#ifdef _MSC_VER - std::strftime( timeStamp, timeStampSize, fmt, &timeInfo ); -#else - std::strftime( timeStamp, timeStampSize, fmt, timeInfo ); -#endif + if ( std::strftime( timeStamp, timeStampSize, fmt, &timeInfo ) == 0 ) { + return "gmtime from provided timepoint has failed"; + } return std::string( timeStamp, timeStampSize - 1 ); } @@ -7082,7 +7205,6 @@ namespace Catch { #include <ostream> #include <cstring> -#include <cctype> #include <vector> namespace Catch { @@ -7112,9 +7234,6 @@ namespace Catch { toLowerInPlace( lc ); return lc; } - char toLower(char c) { - return static_cast<char>(std::tolower(static_cast<unsigned char>(c))); - } std::string trim( std::string const& str ) { static char const* whitespaceChars = "\n\r\t "; @@ -7327,7 +7446,6 @@ namespace Catch { #include <algorithm> -#include <set> namespace Catch { @@ -7337,23 +7455,39 @@ namespace Catch { static void enforceNoDuplicateTestCases( std::vector<TestCaseHandle> const& tests ) { - auto testInfoCmp = []( TestCaseInfo const* lhs, - TestCaseInfo const* rhs ) { - return *lhs < *rhs; - }; - std::set<TestCaseInfo const*, decltype( testInfoCmp )&> seenTests( - testInfoCmp ); + // Flat set instead of std::set for performance. + std::vector<TestCaseInfo const*> seenTests; + seenTests.reserve( tests.size() ); for ( auto const& test : tests ) { - const auto infoPtr = &test.getTestCaseInfo(); - const auto prev = seenTests.insert( infoPtr ); - CATCH_ENFORCE( prev.second, - "error: test case \"" - << infoPtr->name << "\", with tags \"" - << infoPtr->tagsAsString() - << "\" already defined.\n" - << "\tFirst seen at " - << ( *prev.first )->lineInfo << "\n" - << "\tRedefined at " << infoPtr->lineInfo ); + seenTests.push_back( &test.getTestCaseInfo() ); + } + // We want to keep order of ~equal~ tests + // stable_sort so that duplicates are reported with the + // registration order preserved ("first seen" really is first) + std::stable_sort( + seenTests.begin(), + seenTests.end(), + []( TestCaseInfo const* lhs, TestCaseInfo const* rhs ) { + return *lhs < *rhs; + } + ); + const auto duplicate = std::adjacent_find( + seenTests.begin(), + seenTests.end(), + []( TestCaseInfo const* lhs, TestCaseInfo const* rhs ) { + return *lhs == *rhs; + } + ); + + if ( duplicate != seenTests.end() ) { + const auto infoPtr = *std::next( duplicate ); + CATCH_ERROR( "error: test case \"" + << infoPtr->name << "\", with tags \"" + << infoPtr->tagsAsString() + << "\" already defined.\n" + << "\tFirst seen at " + << ( *duplicate )->lineInfo << "\n" + << "\tRedefined at " << infoPtr->lineInfo ); } } @@ -7430,7 +7564,7 @@ namespace Catch { filtered.push_back(testCase); } } - return createShard(filtered, config.shardCount(), config.shardIndex()); + return createShard(CATCH_MOVE(filtered), config.shardCount(), config.shardIndex()); } std::vector<TestCaseHandle> const& getAllTestCasesSorted( IConfig const& config ) { return getRegistryHub().getTestCaseRegistry().getAllTestsSorted( config ); @@ -7634,7 +7768,7 @@ namespace TestCaseTracking { bool SectionTracker::isFilteredImpl() const { // TBD: This is currently _very_ similar to the block in `isComplete`. - // Is this neccessarily that way, or just accident of current semantics? + // Is this necessarily that way, or just accident of current semantics? const size_t filterIndex = m_newStyleFilters ? m_allTrackerDepth : m_sectionOnlyDepth; @@ -7810,6 +7944,15 @@ namespace Catch { return Detail::make_unique<TestInvokerAsFunction>( testAsFunction ); } + AutoReg::AutoReg( void ( *testAsFunction )(), + SourceLineInfo const& lineInfo, + StringRef classOrMethod, + NameAndTags const& nameAndTags ) noexcept: + AutoReg( makeTestInvoker( testAsFunction ), + lineInfo, + classOrMethod, + nameAndTags ) {} + AutoReg::AutoReg( Detail::unique_ptr<ITestInvoker> invoker, SourceLineInfo const& lineInfo, StringRef classOrMethod, NameAndTags const& nameAndTags ) noexcept { CATCH_TRY { getMutableRegistryHub() @@ -8087,6 +8230,15 @@ namespace { namespace Catch { namespace TextFlow { void AnsiSkippingString::preprocessString() { + // If there are no potential escapes, we can use fast path + if ( m_string.find( '\033' ) == std::string::npos ) { + size_t size = 0; + for ( const char c : m_string ) { + size += !isUtf8ContinuationByte( c ); + } + m_size = size; + return; + } for ( auto it = m_string.begin(); it != m_string.end(); ) { // try to read through an ansi sequence while ( it != m_string.end() && *it == '\033' && @@ -8099,8 +8251,10 @@ namespace Catch { if ( cursor == m_string.end() || *cursor != 'm' ) { break; } - // 'm' -> 0xff - *cursor = AnsiSkippingString::sentinel; + // record the escape sequence's byte range + m_escapes.push_back( + { std::distance( m_string.begin(), it ), + std::distance( m_string.begin(), cursor + 1 ) } ); // if we've read an ansi sequence, set the iterator and // return to the top of the loop it = cursor + 1; @@ -8128,79 +8282,102 @@ namespace Catch { } AnsiSkippingString::const_iterator AnsiSkippingString::begin() const { - return const_iterator( m_string ); + return const_iterator( *this ); } AnsiSkippingString::const_iterator AnsiSkippingString::end() const { - return const_iterator( m_string, const_iterator::EndTag{} ); + return const_iterator( *this, const_iterator::EndTag{} ); + } + + std::string AnsiSkippingString::substring( const_iterator first, + const_iterator last ) const { + std::string ret; + appendSubstringTo( ret, first, last ); + return ret; } - std::string AnsiSkippingString::substring( const_iterator begin, - const_iterator end ) const { + void + AnsiSkippingString::appendSubstringTo( std::string& out, + const_iterator first, + const_iterator last ) const { // There's one caveat here to an otherwise simple substring: when // making a begin iterator we might have skipped ansi sequences at - // the start. If `begin` here is a begin iterator, skipped over + // the start. If `first` here is a begin iterator, skipped over // initial ansi sequences, we'll use the true beginning of the - // string. Lastly: We need to transform any chars we replaced with - // 0xff back to 'm' - auto str = std::string( begin == this->begin() ? m_string.begin() - : begin.m_it, - end.m_it ); - std::transform( str.begin(), str.end(), str.begin(), []( char c ) { - return c == AnsiSkippingString::sentinel ? 'm' : c; - } ); - return str; - } - - void AnsiSkippingString::const_iterator::tryParseAnsiEscapes() { - // check if we've landed on an ansi sequence, and if so read through - // it - while ( m_it != m_string->end() && *m_it == '\033' && - m_it + 1 != m_string->end() && *( m_it + 1 ) == '[' ) { - auto cursor = m_it + 2; - while ( cursor != m_string->end() && - ( isdigit( *cursor ) || *cursor == ';' ) ) { - ++cursor; - } - if ( cursor == m_string->end() || - *cursor != AnsiSkippingString::sentinel ) { + // string. + if ( hasEscapes() && first == begin() ) { + out.append( m_string.begin(), last.m_it ); + } else { + out.append( first.m_it, last.m_it ); + } + } + + void AnsiSkippingString::const_iterator::jumpForwardOverEscapes() { + // Escapes can only start with '\033' + if ( m_it == m_string->m_string.end() || *m_it != '\033' ) { + return; + } + // If we are at '\033', check if we are at an actual escape + auto current_pos = std::distance( m_string->m_string.begin(), m_it ); + + auto const& escapes = m_string->m_escapes; + auto candidate = + std::lower_bound( escapes.begin(), + escapes.end(), + current_pos, + []( AnsiSkippingString::EscapeRange const& r, + std::ptrdiff_t o ) { return r.start < o; } ); + // Escapes can be consecutive, we need to jump over all of them + while ( candidate != escapes.end() && candidate->start == current_pos ) { + current_pos = candidate->end; + ++candidate; + } + m_it = m_string->m_string.begin() + current_pos; + } + + void AnsiSkippingString::const_iterator::jumpBackOverEscapes() { + auto strBegin = m_string->m_string.begin(); + // Escapes only end with 'm' + while ( *m_it == 'm' ) { + // If we are at 'm', check if we are at an actual escape + const auto current_pos = std::distance( strBegin, m_it ); + + auto const& escapes = m_string->m_escapes; + auto range = std::lower_bound( + escapes.begin(), + escapes.end(), + current_pos + 1, // to half-open range + []( AnsiSkippingString::EscapeRange const& r, + std::ptrdiff_t o ) { return r.end < o; } ); + if ( range == escapes.end() || range->end != current_pos + 1 ) { break; } - // if we've read an ansi sequence, set the iterator and - // return to the top of the loop - m_it = cursor + 1; + assert( range->start != 0 && + "Trying to go back with begin iterator" ); + m_it = strBegin + range->start - 1; } } + void AnsiSkippingString::const_iterator::advance() { - assert( m_it != m_string->end() ); + auto strEnd = m_string->m_string.end(); + assert( m_it != strEnd ); m_it++; // Skip UTF-8 continuation bytes - while ( m_it != m_string->end() && + while ( m_it != strEnd && isUtf8ContinuationByte( *m_it ) ) { m_it++; } - tryParseAnsiEscapes(); + if ( m_string->hasEscapes() ) { jumpForwardOverEscapes(); } } void AnsiSkippingString::const_iterator::unadvance() { - assert( m_it != m_string->begin() ); + auto strBegin = m_string->m_string.begin(); + assert( m_it != strBegin ); m_it--; - // if *m_it is 0xff, scan back to the \033 and then m_it-- once more - // (and repeat check) - while ( *m_it == AnsiSkippingString::sentinel ) { - while ( *m_it != '\033' ) { - assert( m_it != m_string->begin() ); - m_it--; - } - // if this happens, we must have been a begin iterator that had - // skipped over ansi sequences at the start of a string - assert( m_it != m_string->begin() ); - assert( *m_it == '\033' ); - m_it--; - } + if ( m_string->hasEscapes() ) { jumpBackOverEscapes(); } // Skip back over UTF-8 continuation bytes to the leading byte - while ( m_it != m_string->begin() && + while ( m_it != strBegin && isUtf8ContinuationByte( *m_it ) ) { m_it--; } @@ -8278,10 +8455,8 @@ namespace Catch { AnsiSkippingString::const_iterator end ) const { std::string ret; const auto desired_indent = indentSize(); - // ret.reserve( desired_indent + (end - start) + m_addHyphen ); ret.append( desired_indent, ' ' ); - // ret.append( start, end ); - ret += m_column.m_string.substring( start, end ); + m_column.m_string.appendSubstringTo( ret, start, end ); if ( m_addHyphen ) { ret.push_back( '-' ); } return ret; @@ -8473,35 +8648,53 @@ namespace Catch { WildcardPattern::WildcardPattern( std::string const& pattern, CaseSensitive caseSensitivity ) : m_caseSensitivity( caseSensitivity ), - m_pattern( normaliseString( pattern ) ) + m_pattern( trim(pattern) ) { if( startsWith( m_pattern, '*' ) ) { - m_pattern = m_pattern.substr( 1 ); - m_wildcard = WildcardAtStart; + m_pattern = m_pattern.erase( 0, 1 ); // effectively pop_front + m_wildcard = static_cast<WildcardPosition>( m_wildcard | WildcardAtStart ); } if( endsWith( m_pattern, '*' ) ) { - m_pattern = m_pattern.substr( 0, m_pattern.size()-1 ); + m_pattern.pop_back(); m_wildcard = static_cast<WildcardPosition>( m_wildcard | WildcardAtEnd ); } } - bool WildcardPattern::matches( std::string const& str ) const { - switch( m_wildcard ) { - case NoWildcard: - return m_pattern == normaliseString( str ); - case WildcardAtStart: - return endsWith( normaliseString( str ), m_pattern ); - case WildcardAtEnd: - return startsWith( normaliseString( str ), m_pattern ); - case WildcardAtBothEnds: - return contains( normaliseString( str ), m_pattern ); - default: - CATCH_INTERNAL_ERROR( "Unknown enum" ); - } - } + bool WildcardPattern::matches( StringRef input ) const { + input = trim( input ); + if ( input.size() < m_pattern.size() ) { return false; } + + auto casedMatch = [&]( StringRef lhs, StringRef rhs ) { + if ( m_caseSensitivity == CaseSensitive::Yes ) { + return lhs == rhs; + } else { + Detail::CaseInsensitiveEqualTo eq; + return eq( lhs, rhs ); + } + }; - std::string WildcardPattern::normaliseString( std::string const& str ) const { - return trim( m_caseSensitivity == CaseSensitive::No ? toLower( str ) : str ); + switch ( m_wildcard ) { + case NoWildcard: + return casedMatch(input, m_pattern); + case WildcardAtStart: + return casedMatch( + input.substr( input.size() - m_pattern.size(), input.size() ), + m_pattern ); + case WildcardAtEnd: + return casedMatch( input.substr( 0, m_pattern.size() ), m_pattern ); + case WildcardAtBothEnds: { + // TBD: This has terrible performance, but it is also the least + // common use case. Once the StringContains matcher gets + // efficient implementation, we should reuse it here. + const size_t lastOffset = input.size() - m_pattern.size(); + for ( size_t offset = 0; offset <= lastOffset; ++offset ) { + if ( casedMatch( input.substr(offset, m_pattern.size()), m_pattern ) ) { return true; } + } + return false; + } + default: + CATCH_INTERNAL_ERROR( "Unknown enum" ); + } } } @@ -10366,7 +10559,7 @@ namespace Catch { if ( m_sectionStack.empty() ) { if ( !m_rootSection ) { m_rootSection = - Detail::make_unique<SectionNode>( incompleteStats ); + Detail::make_unique<SectionNode>( CATCH_MOVE( incompleteStats ) ); } node = m_rootSection.get(); } else { @@ -10376,7 +10569,7 @@ namespace Catch { BySectionInfo( sectionInfo ) ); if ( it == parentNode.childSections.end() ) { auto newNode = - Detail::make_unique<SectionNode>( incompleteStats ); + Detail::make_unique<SectionNode>( CATCH_MOVE( incompleteStats ) ); node = newNode.get(); parentNode.childSections.push_back( CATCH_MOVE( newNode ) ); } else { @@ -10756,7 +10949,7 @@ namespace Catch { row.insert( 0, m_width - row.size(), ' ' ); } m_width = new_width; - m_rows.push_back( row ); + m_rows.push_back( CATCH_MOVE( row ) ); return std::move( *this ); } diff --git a/extras/catch_amalgamated.hpp b/extras/catch_amalgamated.hpp index 7a21dd51..29279da0 100644 --- a/extras/catch_amalgamated.hpp +++ b/extras/catch_amalgamated.hpp @@ -7,7 +7,7 @@ // SPDX-License-Identifier: BSL-1.0 // Catch v3.16.0 -// Generated: 2026-08-25 09:29:22.652020 +// Generated: 2026-09-28 00:12:28.337654 // ---------------------------------------------------------- // This file is an amalgamation of multiple different files. // You probably shouldn't edit it directly. @@ -2957,7 +2957,7 @@ namespace Catch { #if defined( CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER ) && \ defined( CATCH_CONFIG_CPP17_OPTIONAL ) && \ - /* P3168 turned optional into a range, making this ambigous with the range support */ \ + /* P3168 turned optional into a range, making this ambiguous with the range support */ \ !defined( __cpp_lib_optional_range_support ) #include <optional> namespace Catch { @@ -3530,10 +3530,9 @@ namespace Catch public: WildcardPattern( std::string const& pattern, CaseSensitive caseSensitivity ); - bool matches( std::string const& str ) const; + bool matches( StringRef str ) const; private: - std::string normaliseString( std::string const& str ) const; CaseSensitive m_caseSensitivity; WildcardPosition m_wildcard = NoWildcard; std::string m_pattern; @@ -4742,8 +4741,9 @@ namespace Catch { -> ParserResult override { T temp; auto result = convertInto( arg, temp ); - if ( result ) - m_ref.push_back( temp ); + if ( result ) { + m_ref.push_back( CATCH_MOVE( temp ) ); + } return result; } }; @@ -5285,21 +5285,40 @@ namespace Catch { # pragma clang diagnostic ignored "-Wfloat-equal" #endif + // To avoid instantiating all of `is_foo_comparable<T, T&>`, + // `is_foo_comparable<T&, T&>`, `is_foo_comparable<T, T>`, ... + // we force the type into simple T ref. This does not cause behaviour + // change, because the decomposer already only uses lvalues. + // + // Note that we do not strip away constness, as that would make + // the comparability of `const T` dependent on comparability of `T`, + // which could lead to behavior change from the current implementation. + template <typename T> + using IsComparableNormalized_t = std::remove_reference_t<T>&; + #define CATCH_DEFINE_COMPARABLE_TRAIT( id, op ) \ template <typename, typename, typename = void> \ - struct is_##id##_comparable : std::false_type {}; \ + struct is_##id##_comparable_impl : std::false_type {}; \ template <typename T, typename U> \ - struct is_##id##_comparable< \ + struct is_##id##_comparable_impl< \ T, \ U, \ void_t<decltype( std::declval<T>() op std::declval<U>() )>> \ : std::true_type {}; \ + template <typename T, typename U> \ + using is_##id##_comparable = \ + is_##id##_comparable_impl<IsComparableNormalized_t<T>, \ + IsComparableNormalized_t<U>>; \ template <typename, typename = void> \ - struct is_##id##_0_comparable : std::false_type {}; \ + struct is_##id##_0_comparable_impl : std::false_type {}; \ template <typename T> \ - struct is_##id##_0_comparable<T, \ - void_t<decltype( std::declval<T>() op 0 )>> \ - : std::true_type {}; + struct is_##id##_0_comparable_impl< \ + T, \ + void_t<decltype( std::declval<T>() op 0 )>> \ + : std::true_type {}; \ + template <typename T> \ + using is_##id##_0_comparable = \ + is_##id##_0_comparable_impl<IsComparableNormalized_t<T>>; // We need all 6 pre-spaceship comparison ops: <, <=, >, >=, ==, != CATCH_DEFINE_COMPARABLE_TRAIT( lt, < ) @@ -6282,7 +6301,22 @@ struct NameAndTags { }; struct AutoReg : Detail::NonCopyable { - AutoReg( Detail::unique_ptr<ITestInvoker> invoker, SourceLineInfo const& lineInfo, StringRef classOrMethod, NameAndTags const& nameAndTags ) noexcept; + AutoReg( Detail::unique_ptr<ITestInvoker> invoker, + SourceLineInfo const& lineInfo, + StringRef classOrMethod, + NameAndTags const& nameAndTags ) noexcept; + + /** + * Overload that takes the simple function pointer directly. + * + * Useful to keep compilation costs low; the unique_ptr overload + * combined with `makeTestInvoker` causes quadratic compilation times + * with GCC + optimizations (and super-linear with Clang + optims). + */ + AutoReg( void ( *testAsFunction )(), + SourceLineInfo const& lineInfo, + StringRef classOrMethod, + NameAndTags const& nameAndTags ) noexcept; }; } // end namespace Catch @@ -6308,7 +6342,7 @@ struct AutoReg : Detail::NonCopyable { CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \ - namespace{ const Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( Catch::makeTestInvoker( &TestName ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ __VA_ARGS__ } ); } /* NOLINT */ \ + namespace{ const Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &TestName, CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ __VA_ARGS__ } ); } /* NOLINT */ \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ static void TestName() #define INTERNAL_CATCH_TESTCASE( ... ) \ @@ -6411,7 +6445,7 @@ static int catchInternalSectionHint = 0; CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \ - Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( Catch::makeTestInvoker( Function ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ __VA_ARGS__ } ); /* NOLINT */ \ + Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( Function, CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ __VA_ARGS__ } ); /* NOLINT */ \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ } while(false) @@ -7108,7 +7142,7 @@ namespace Catch { constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\ constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\ constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\ - (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFuncName<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + '<' + types_list[index % num_types] + '>', Tags } ), index++)... };/* NOLINT */\ + (void)expander{(Catch::AutoReg( &TestFuncName<Types>, CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + '<' + types_list[index % num_types] + '>', Tags } ), index++)... };/* NOLINT */\ } \ }; \ static const int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \ @@ -7154,7 +7188,7 @@ namespace Catch { void reg_tests() { \ size_t index = 0; \ using expander = size_t[]; \ - (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFunc<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " INTERNAL_CATCH_STRINGIZE(TmplList) " - " + std::to_string(index), Tags } ), index++)... };/* NOLINT */\ + (void)expander{(Catch::AutoReg( &TestFunc<Types>, CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " INTERNAL_CATCH_STRINGIZE(TmplList) " - " + std::to_string(index), Tags } ), index++)... };/* NOLINT */\ } \ };\ static const int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \ @@ -7485,7 +7519,9 @@ namespace Catch { //! Orders by name, classname and tags friend bool operator<( TestCaseInfo const& lhs, TestCaseInfo const& rhs ); - + //! Compares name, classname and tags + friend bool operator==( TestCaseInfo const& lhs, + TestCaseInfo const& rhs ); std::string tagsAsString() const; @@ -11197,9 +11233,10 @@ namespace Catch { namespace Catch { template<typename Container> - Container createShard(Container const& container, std::size_t const shardCount, std::size_t const shardIndex) { + Container createShard(Container container, std::size_t const shardCount, std::size_t const shardIndex) { assert(shardCount > shardIndex); + // Single shard means there is nothing to do if (shardCount == 1) { return container; } @@ -11215,7 +11252,10 @@ namespace Catch { auto startIterator = std::next(container.begin(), static_cast<std::ptrdiff_t>(startIndex)); auto endIterator = std::next(container.begin(), static_cast<std::ptrdiff_t>(endIndex)); - return Container(startIterator, endIterator); + container.erase(endIterator, container.end()); + container.erase(container.begin(), startIterator); + + return container; } } @@ -11322,7 +11362,12 @@ namespace Catch { bool contains( std::string const& s, std::string const& infix ); void toLowerInPlace( std::string& s ); std::string toLower( std::string const& s ); - char toLower( char c ); + //! ASCII only. + constexpr char toLower( char c ) { + const uint32_t as_number = static_cast<unsigned char>( c ); + const bool isUpper = ( as_number - static_cast<uint32_t>( 'A' ) ) < 26u; + return static_cast<char>( as_number | ( isUpper << 5 ) ); + } //! Returns a new string without whitespace at the start/end std::string trim( std::string const& str ); //! Returns a substring of the original ref without whitespace. Beware lifetimes! @@ -11554,25 +11599,30 @@ namespace Catch { * escape sequences are considered. * * Internal representation: - * An escape sequence looks like \033[39;49m - * We need bidirectional iteration and the unbound length of escape - * sequences poses a problem for operator-- To make this work we'll - * replace the last `m` with a 0xff (this is a codepoint that won't have - * any utf-8 meaning). + * * An escape sequence looks like \033[39;49m + * * The string is stored unmodified + * * Index ranges of escape sequences are stored in separate vector */ class AnsiSkippingString { + public: + //! Byte offsets of an escape sequence: [start, end) + struct EscapeRange { + std::ptrdiff_t start; + std::ptrdiff_t end; + }; + + private: std::string m_string; std::size_t m_size = 0; + // Sorted, non-overlapping. Empty -> no escapes in input + std::vector<EscapeRange> m_escapes; - // perform 0xff replacement and calculate m_size + // find escape sequences and calculate m_size void preprocessString(); public: class const_iterator; using iterator = const_iterator; - // note: must be u-suffixed or this will cause a "truncation of - // constant value" warning on MSVC - static constexpr char sentinel = static_cast<char>( 0xffu ); explicit AnsiSkippingString( std::string const& text ); explicit AnsiSkippingString( std::string&& text ); @@ -11581,22 +11631,28 @@ namespace Catch { const_iterator end() const; size_t size() const { return m_size; } - - std::string substring( const_iterator begin, - const_iterator end ) const; + bool hasEscapes() const { return !m_escapes.empty(); } + + std::string substring( const_iterator first, + const_iterator last ) const; + // Support for appending without extra allocations + void appendSubstringTo( std::string& out, + const_iterator first, + const_iterator last ) const; }; class AnsiSkippingString::const_iterator { friend AnsiSkippingString; struct EndTag {}; - const std::string* m_string; + const AnsiSkippingString* m_string; std::string::const_iterator m_it; - explicit const_iterator( const std::string& string, EndTag ): - m_string( &string ), m_it( string.end() ) {} + explicit const_iterator( const AnsiSkippingString& string, EndTag ): + m_string( &string ), m_it( string.m_string.end() ) {} - void tryParseAnsiEscapes(); + void jumpForwardOverEscapes(); + void jumpBackOverEscapes(); void advance(); void unadvance(); @@ -11607,9 +11663,9 @@ namespace Catch { using reference = value_type&; using iterator_category = std::bidirectional_iterator_tag; - explicit const_iterator( const std::string& string ): - m_string( &string ), m_it( string.begin() ) { - tryParseAnsiEscapes(); + explicit const_iterator( const AnsiSkippingString& string ): + m_string( &string ), m_it( string.m_string.begin() ) { + if ( m_string->hasEscapes() ) { jumpForwardOverEscapes(); } } char operator*() const { return *m_it; } @@ -14044,6 +14100,7 @@ namespace Catch { }; struct SectionNode { explicit SectionNode(SectionStats const& _stats) : stats(_stats) {} + explicit SectionNode(SectionStats&& _stats) : stats(CATCH_MOVE(_stats)) {} bool operator == (SectionNode const& other) const { return stats.sectionInfo.lineInfo == other.stats.sectionInfo.lineInfo; diff --git a/requirements-conan.txt b/requirements-conan.txt new file mode 100644 index 00000000..da0775f6 --- /dev/null +++ b/requirements-conan.txt @@ -0,0 +1,4 @@ +# SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +# SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-1.1 + +conan==2.31.1 diff --git a/requirements-header-guards.txt b/requirements-header-guards.txt new file mode 100644 index 00000000..7f76f02f --- /dev/null +++ b/requirements-header-guards.txt @@ -0,0 +1,4 @@ +# SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +# SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-1.1 + +guardonce==2.4.0 diff --git a/requirements-meson.txt b/requirements-meson.txt new file mode 100644 index 00000000..5aa5ed30 --- /dev/null +++ b/requirements-meson.txt @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +# SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-1.1 + +meson==1.12.1 +ninja==1.13.2 diff --git a/src/catch2/catch_session.cpp b/src/catch2/catch_session.cpp index 78cb5a06..56612ba1 100644 --- a/src/catch2/catch_session.cpp +++ b/src/catch2/catch_session.cpp @@ -27,11 +27,23 @@ #include <catch2/internal/catch_istream.hpp> #include <cassert> +#include <cerrno> #include <cstdio> #include <cstdlib> +#include <cstring> #include <exception> #include <iomanip> +#if defined( _WIN32 ) +# include <fcntl.h> +# include <io.h> +# include <sys/stat.h> +#else +# include <fcntl.h> +# include <sys/stat.h> +# include <unistd.h> +#endif + namespace Catch { namespace { @@ -150,29 +162,93 @@ namespace Catch { getMutableRegistryHub().getMutableTestCaseRegistry().enableFilenameTags(); } - // Creates empty file at path. The path must be writable, we do not - // try to create directories in path because that's hard in C++14. + std::FILE* openGuardFile( std::string const& guardFilePath, + int& error ) { +#if defined( _MSC_VER ) + std::FILE* file = nullptr; + error = fopen_s( &file, guardFilePath.c_str(), "w" ); + return error ? nullptr : file; +#elif defined( _WIN32 ) + const int descriptor = _open( guardFilePath.c_str(), + _O_WRONLY | _O_CREAT | _O_TRUNC | + _O_BINARY | _O_NOINHERIT, + _S_IREAD | _S_IWRITE ); + if ( descriptor == -1 ) { + error = errno; + return nullptr; + } + std::FILE* const file = _fdopen( descriptor, "w" ); + if ( file == nullptr ) { + error = errno; + _close( descriptor ); + } + return file; +#else + int flags = O_WRONLY | O_CREAT | O_TRUNC; +# if defined( O_NONBLOCK ) + flags |= O_NONBLOCK; +# endif +# if defined( O_CLOEXEC ) + flags |= O_CLOEXEC; +# endif +# if defined( O_NOFOLLOW ) + // Do not let a stale guard-file symlink redirect this write. + flags |= O_NOFOLLOW; +# endif + const int descriptor = + ::open( guardFilePath.c_str(), flags, S_IRUSR | S_IWUSR ); + if ( descriptor == -1 ) { + error = errno; + return nullptr; + } + + struct stat fileStatus = {}; + if ( ::fstat( descriptor, &fileStatus ) != 0 ) { + error = errno; + ::close( descriptor ); + return nullptr; + } + if ( !S_ISREG( fileStatus.st_mode ) ) { + error = EINVAL; + ::close( descriptor ); + return nullptr; + } + // The creation mode is already owner-only; also tighten an + // existing regular guard file before it is reused. + if ( ::fchmod( descriptor, S_IRUSR | S_IWUSR ) != 0 ) { + error = errno; + ::close( descriptor ); + return nullptr; + } + + std::FILE* const file = ::fdopen( descriptor, "w" ); + if ( file == nullptr ) { + error = errno; + ::close( descriptor ); + } + return file; +#endif + } + + // Creates an owner-only guard file. The path must be writable; we do + // not create its parent directories. void setUpGuardFile( std::string const& guardFilePath ) { if ( !guardFilePath.empty() ) { -#if defined( _MSC_VER ) - std::FILE* file = nullptr; - if ( fopen_s( &file, guardFilePath.c_str(), "w" ) ) { - char msgBuffer[100]; - const auto err = errno; + int err = 0; + std::FILE* const file = openGuardFile( guardFilePath, err ); + if ( file == nullptr ) { + char msgBuffer[100] = {}; std::string errMsg; +#if defined( _MSC_VER ) if ( !strerror_s( msgBuffer, err ) ) { errMsg = msgBuffer; } else { errMsg = "Could not translate errno to a string"; } - #else - std::FILE* file = std::fopen( guardFilePath.c_str(), "w" ); - if ( !file ) { - const auto err = errno; - const char* errMsg = std::strerror( err ); + const char* const message = std::strerror( err ); + errMsg = message ? message : "Unknown error"; #endif - CATCH_RUNTIME_ERROR( "Could not open the exit guard file '" << guardFilePath << "' because '" << errMsg << "' (" << err << ')' ); diff --git a/src/catch2/catch_tostring.cpp b/src/catch2/catch_tostring.cpp index dad62410..1fbf3a54 100644 --- a/src/catch2/catch_tostring.cpp +++ b/src/catch2/catch_tostring.cpp @@ -64,26 +64,40 @@ namespace Detail { } std::string formatTimeT(std::time_t time) { -#ifdef _MSC_VER std::tm timeInfo = {}; +#ifdef _MSC_VER const auto err = gmtime_s( &timeInfo, &time ); if ( err ) { return "gmtime from provided timepoint has failed. This " "happens e.g. with pre-1970 dates using Microsoft libc"; } +#elif defined( __MINGW32__ ) + if ( gmtime_s( &timeInfo, &time ) != 0 ) { + return "gmtime from provided timepoint has failed"; + } +#elif defined( CATCH_PLATFORM_PLAYSTATION ) + gmtime_s( &time, &timeInfo ); +#elif defined( __IAR_SYSTEMS_ICC__ ) + // This toolchain does not provide gmtime_r. Copy the result immediately + // so the formatter does not retain the C library's static buffer. + const std::tm* const converted = std::gmtime( &time ); + if ( converted == nullptr ) { + return "gmtime from provided timepoint has failed"; + } + timeInfo = *converted; #else - std::tm* timeInfo = std::gmtime( &time ); + if ( gmtime_r( &time, &timeInfo ) == nullptr ) { + return "gmtime from provided timepoint has failed"; + } #endif auto const timeStampSize = sizeof( "2017-01-16T17:06:45Z" ); - char timeStamp[timeStampSize]; + char timeStamp[timeStampSize] = {}; const char* const fmt = "%Y-%m-%dT%H:%M:%SZ"; -#ifdef _MSC_VER - std::strftime( timeStamp, timeStampSize, fmt, &timeInfo ); -#else - std::strftime( timeStamp, timeStampSize, fmt, timeInfo ); -#endif + if ( std::strftime( timeStamp, timeStampSize, fmt, &timeInfo ) == 0 ) { + return "gmtime from provided timepoint has failed"; + } return std::string( timeStamp, timeStampSize - 1 ); } diff --git a/tests/TestScripts/testBazelExitGuardFile.py b/tests/TestScripts/testBazelExitGuardFile.py index b4d31b52..c1186689 100755 --- a/tests/TestScripts/testBazelExitGuardFile.py +++ b/tests/TestScripts/testBazelExitGuardFile.py @@ -8,6 +8,7 @@ # SPDX-License-Identifier: BSL-1.0 import os +import stat import sys import subprocess @@ -43,6 +44,12 @@ def test_bazel_env_vars(bin_path, guard_path): run_common([bin_path], env) def test_cli_parameter(bin_path, guard_path): + # Reuse a deliberately permissive stale guard file to verify that the + # implementation tightens its permissions before truncating it. + if os.name != 'nt': + with open(guard_path, 'w'): + pass + os.chmod(guard_path, 0o666) cmd = [ bin_path, '--premature-exit-guard-file', @@ -50,6 +57,31 @@ def test_cli_parameter(bin_path, guard_path): ] run_common(cmd) + if os.name != 'nt': + target_path = guard_path + '.target' + symlink_path = guard_path + '.symlink' + sentinel = 'do not truncate a symlink target\n' + with open(target_path, 'w') as target: + target.write(sentinel) + os.symlink(target_path, symlink_path) + try: + result = subprocess.run( + [bin_path, '--premature-exit-guard-file', symlink_path], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + universal_newlines=True, + ) + assert result.returncode != 0, ( + 'A symlink was accepted as a premature-exit guard file' + ) + with open(target_path, 'r') as target: + assert target.read() == sentinel, ( + 'Opening the guard-file symlink modified its target' + ) + finally: + os.remove(symlink_path) + os.remove(target_path) + def test_no_crash(bin_path, guard_path): cmd = [ bin_path, @@ -77,6 +109,11 @@ check_func, file_should_exist = checks[test_kind] check_func(bin_path, guard_file_path) assert os.path.exists(guard_file_path) == file_should_exist +if file_should_exist and os.name != 'nt': + guard_mode = stat.S_IMODE(os.stat(guard_file_path).st_mode) + assert guard_mode & 0o077 == 0, ( + f'Guard file permissions are accessible to group/others: {guard_mode:o}' + ) # With randomly generated file suffix, we should not run into name conflicts. # However, we try to cleanup anyway, to avoid having infinity files in # long living build directories.