Fix relative PRE_TEST discovery paths - #3175
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## devel #3175 +/- ##
=======================================
Coverage 91.16% 91.16%
=======================================
Files 206 206
Lines 9016 9016
=======================================
Hits 8219 8219
Misses 797 797 🚀 New features to boost your workflow:
|
77c8a2f to
c15c563
Compare
|
Rebased onto current Focused Windows/MSVC validation passed for both the default and relocated relative modes: 22 test names matched the CTest listing, 22 matched |
c15c563 to
899f969
Compare
|
Rebased onto current The conflict, and why it was not a mechanical resolve.
So the resolution puts the same Verified, not assumed. Built and ran the real script under CMake 3.28.3 / g++ 13.3 (the relative branch needs ≥ 3.24): I also checked the resolution was necessary rather than incidental — dropping the two lines back off the relative registration reproduces the failure: The No maintainer has looked at this yet and I know the queue is long — no rush from me. Flagging only that it is current and green again, so it is not blocked on being stale. Happy to close it if the approach is not one you want. |
Description
Add an opt-in
USE_RELATIVE_PATHSmode tocatch_discover_testsforDISCOVERY_MODE PRE_TEST.When enabled, the generated CTest include resolves the test executable, discovery script, working directory, and discovery cache relative to its own relocated build-tree location. This keeps the existing behavior unchanged by default, supports single- and multi-config generators, and requires CMake 3.24 for the path generator expressions. The option and version requirement are documented.
The regression relocates the build tree before first discovery, uses a generator-expression
WORKING_DIRECTORY, verifies the discovered names, runs the actual tests, and cleans the generated discovery cache.GitHub Issues
Closes #3051
Testing
git diff --checkpassed