forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 153
cmake: accommodate for UNIT_TEST_SOURCES
#1947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dscho
wants to merge
1
commit into
gitgitgadget:master
Choose a base branch
from
dscho:reftable-vs-cmake
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+3
−1
Conversation
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
As part of 9bbc981 (t/unit-tests: finalize migration of reftable-related tests, 2025-07-24), the explicit list of `UNIT_TEST_PROGRAMS` was turned into a wildcard pattern-derived list. Let's do the same in the CMake definition. This fixes build errors with symptoms like this: CMake Error at CMakeLists.txt:132 (string): string sub-command REPLACE requires at least four arguments. Call Stack (most recent call first): CMakeLists.txt:1037 (parse_makefile_for_scripts) Signed-off-by: Johannes Schindelin <[email protected]>
/submit |
Submitted as [email protected] To fetch this version into
To fetch this version to local tag
|
/preview |
Preview email sent as [email protected] |
On the Git mailing list, Johannes Schindelin wrote (reply to this): Hi Junio,
this patch is still required; I sent this before -rc0 was released so that
it could be included in v2.51.0 final. Could you please still merge it?
Thanks,
Johannes
On Sun, 3 Aug 2025, Johannes Schindelin via GitGitGadget wrote:
> From: Johannes Schindelin <[email protected]>
>
> As part of 9bbc981c6f2 (t/unit-tests: finalize migration of
> reftable-related tests, 2025-07-24), the explicit list of
> `UNIT_TEST_PROGRAMS` was turned into a wildcard pattern-derived list.
>
> Let's do the same in the CMake definition.
>
> This fixes build errors with symptoms like this:
>
> CMake Error at CMakeLists.txt:132 (string):
> string sub-command REPLACE requires at least four arguments.
> Call Stack (most recent call first):
> CMakeLists.txt:1037 (parse_makefile_for_scripts)
>
> Signed-off-by: Johannes Schindelin <[email protected]>
> ---
> cmake: accommodate for UNIT_TEST_SOURCES
>
> This fix is needed to build Git using CMake in the wake of the recent
> migration of the reftable tests from being regression tests written in
> Unix shell script to being unit tests in pure C.
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1947%2Fdscho%2Freftable-vs-cmake-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1947/dscho/reftable-vs-cmake-v1
> Pull-Request: https://github.com/gitgitgadget/git/pull/1947
>
> contrib/buildsystems/CMakeLists.txt | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt
> index 25b495fa737..edb0fc04ad7 100644
> --- a/contrib/buildsystems/CMakeLists.txt
> +++ b/contrib/buildsystems/CMakeLists.txt
> @@ -1005,7 +1005,9 @@ parse_makefile_for_sources(clar-test_SOURCES ${CMAKE_SOURCE_DIR}/Makefile "CLAR_
> list(TRANSFORM clar-test_SOURCES REPLACE "\\$\\(UNIT_TEST_DIR\\)/" "${CMAKE_SOURCE_DIR}/t/unit-tests/")
> add_library(clar-test-lib STATIC ${clar-test_SOURCES})
>
> -parse_makefile_for_scripts(unit_test_PROGRAMS "UNIT_TEST_PROGRAMS" "")
> +file(GLOB unit_test_PROGRAMS "${CMAKE_SOURCE_DIR}/t/unit-tests/t-*.c")
> +list(TRANSFORM unit_test_PROGRAMS REPLACE "${CMAKE_SOURCE_DIR}/" "")
> +list(TRANSFORM unit_test_PROGRAMS REPLACE ".c" "")
> foreach(unit_test ${unit_test_PROGRAMS})
> add_executable("${unit_test}" "${CMAKE_SOURCE_DIR}/t/unit-tests/${unit_test}.c")
> target_link_libraries("${unit_test}" unit-test-lib clar-test-lib common-main)
>
> base-commit: 866e6a391f466baeeb98bc585845ea638322c04b
> --
> gitgitgadget
>
> |
This comment was marked as outdated.
This comment was marked as outdated.
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.
This fix is needed to build Git using CMake in the wake of the recent migration of the reftable tests from being regression tests written in Unix shell script to being unit tests in pure C.