Skip to content

Pass the parent toolchain to CMake configuration tests - #3202

Open
vzer200 wants to merge 1 commit into
catchorg:develfrom
vzer200:fix/configure-tests-toolchain
Open

Pass the parent toolchain to CMake configuration tests#3202
vzer200 wants to merge 1 commit into
catchorg:develfrom
vzer200:fix/configure-tests-toolchain

Conversation

@vzer200

@vzer200 vzer200 commented Sep 8, 2026

Copy link
Copy Markdown

Description

When Catch2 is configured with a toolchain whose compiler is not on PATH, the CMake configuration tests start child builds without that toolchain and fail to find a compiler. Pass the parent's toolchain to those tests and forward it explicitly to CMake, including versions before 3.21 that do not read the environment variable automatically.

The existing behavior is preserved when no toolchain is configured.

Validation

  • Reproduced the original CMakeConfig::Disable failure with LLVM MinGW selected only through a toolchain and no compiler on PATH; all four configuration tests pass after the change.
  • Independently checked 28 small C++ build/run cases with CMake 3.16.9 and 4.4.3: inherited and relative toolchain paths with spaces, absent/empty variables, explicit override and explicit clearing. The original helper fails compiler discovery on CMake 3.16; the corrected helper succeeds.
  • Full all-tests build completed. CTest: 143/144 pass; the existing Windows Reporters::CrashInJunitReporter failure reproduces on the unmodified base. Two unrelated Clang 23 warnings were reproduced on the base and kept as warnings in the local validation toolchain.

Implemented and independently reviewed by automated agents before submission.

GitHub Issues

Fixes #2743.

@codecov

codecov Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.17%. Comparing base (897d804) to head (aa3997e).

Additional details and impacted files
@@           Coverage Diff           @@
##            devel    #3202   +/-   ##
=======================================
  Coverage   91.17%   91.17%           
=======================================
  Files         206      206           
  Lines        9031     9031           
=======================================
  Hits         8234     8234           
  Misses        797      797           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ConfigureTestsCommon fail when the compiler is from toolchain file but is not available in the path

1 participant