Repository navigation
Conversation
Generate the shard test command with TEST_BINARY as a bracket argument so paths with spaces or special characters reach CTest unchanged.
Run the new check with the other Python helper tests and label it uses-python.
…aracters Copy SelfTest into a directory with spaces, a closing bracket sequence and a dollar-brace text, generate the shard tests, and check the listed command.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## devel #3231 +/- ##
==========================================
- Coverage 91.41% 91.38% -0.03%
==========================================
Files 205 205
Lines 9106 9106
==========================================
- Hits 8324 8321 -3
- Misses 782 785 +3 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The generated shard CTest file wrote
TEST_BINARYintoadd_testunquoted. With a test executable in a directory whose name contains spaces, CTest split the path at the first space and the shard tests were reported as Not Run. This change writes the path as a CMake bracket argument, using a delimiter that does not occur in the path (so a path containing]==]or${...}also reaches CTest unchanged).TEST_SPECandREPORTER_SPEChandling is not changed.Tests: a new helper test copies SelfTest into a directory containing spaces,
]==]and${NOT_A_VARIABLE}, generates the shard file and checks that the listed command starts with that exact path. It is labeleduses-pythonlike the neighboring Python helper tests, and it only lists tests (it does not run the copied binary).Checks run (Linux, GCC 11.4, CMake 3.22.1, Python 3.10.12), by an independent reviewer:
Known limits: a literal backslash in a Linux file name does not produce a runnable command with or without this change (CTest normalizes the path); I did not test Windows. Not run: Windows, macOS, multi-config generators, the CMake 3.10 minimum.
An AI coding assistant helped write and test this change.