Skip to content

Commit 9511056

Browse files
dschogitster
authored andcommitted
cmake: let test-tool run the unit tests, too
The `test-tool` recently learned to run the unit tests. To this end, it needs to link with `test-lib.c`, which was done in the `Makefile`, and this patch does it in the CMake definition, too. This is a companion of 44400f5 (t0080: turn t-basic unit test into a helper, 2024-02-02). Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b121eed commit 9511056

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

contrib/buildsystems/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,10 +1005,11 @@ endforeach()
10051005

10061006
#test-tool
10071007
parse_makefile_for_sources(test-tool_SOURCES "TEST_BUILTINS_OBJS")
1008+
add_library(test-lib OBJECT ${CMAKE_SOURCE_DIR}/t/unit-tests/test-lib.c)
10081009

10091010
list(TRANSFORM test-tool_SOURCES PREPEND "${CMAKE_SOURCE_DIR}/t/helper/")
10101011
add_executable(test-tool ${CMAKE_SOURCE_DIR}/t/helper/test-tool.c ${test-tool_SOURCES} ${test-reftable_SOURCES})
1011-
target_link_libraries(test-tool common-main)
1012+
target_link_libraries(test-tool test-lib common-main)
10121013

10131014
set_target_properties(test-fake-ssh test-tool
10141015
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/t/helper)

0 commit comments

Comments
 (0)