summaryrefslogtreecommitdiff
path: root/contrib/buildsystems
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2023-09-25 11:20:36 (GMT)
committerJunio C Hamano <gitster@pobox.com>2023-11-09 23:16:27 (GMT)
commit694e89baeb824a173b655507b7b62174d2d15688 (patch)
tree2654f8ca8329a1cdb7fa8d2c3fc40f7fe85c8990 /contrib/buildsystems
parent2f2729f3a4626838fce294a0cec4e525c5f4be39 (diff)
downloadgit-694e89baeb824a173b655507b7b62174d2d15688.zip
git-694e89baeb824a173b655507b7b62174d2d15688.tar.gz
git-694e89baeb824a173b655507b7b62174d2d15688.tar.bz2
cmake: handle also unit tests
The unit tests should also be available e.g. in Visual Studio's Test Explorer when configuring Git's source code via CMake. Suggested-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/buildsystems')
-rw-r--r--contrib/buildsystems/CMakeLists.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt
index 356f068..671c7ea 100644
--- a/contrib/buildsystems/CMakeLists.txt
+++ b/contrib/buildsystems/CMakeLists.txt
@@ -981,6 +981,17 @@ foreach(unit_test ${unit_test_PROGRAMS})
PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/t/unit-tests/bin)
endif()
list(APPEND PROGRAMS_BUILT "${unit_test}")
+
+ # t-basic intentionally fails tests, to validate the unit-test infrastructure.
+ # Therefore, it should only be run as part of t0080, which verifies that it
+ # fails only in the expected ways.
+ #
+ # All other unit tests should be run.
+ if(NOT ${unit_test} STREQUAL "t-basic")
+ add_test(NAME "t.unit-tests.${unit_test}"
+ COMMAND "./${unit_test}"
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/t/unit-tests/bin)
+ endif()
endforeach()
#test-tool