From patchwork Mon Sep 18 20:54:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 13390474 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89F03CD37B0 for ; Mon, 18 Sep 2023 20:54:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229702AbjIRUyi (ORCPT ); Mon, 18 Sep 2023 16:54:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229478AbjIRUyh (ORCPT ); Mon, 18 Sep 2023 16:54:37 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0978290 for ; Mon, 18 Sep 2023 13:54:32 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-402d0eda361so54132245e9.0 for ; Mon, 18 Sep 2023 13:54:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695070470; x=1695675270; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=ltxtQ9vs58ZkLsFx7dc2UlYFSCGlP20DljWV5O0PqwY=; b=D4RuuusQN4wGVDDc6T0DADe+2Dtd8KUWbbJ1WRDUPDRkonnkyNxFPLETOC8GgDgM/P QUdAb/2b02mY04o8Nmy2yp2pM6IftuzOVDA/SkmVRbDJGa7t+IhjX1GnLQNLyY23orrp /52aOafG4GsrKl0OcTXjRbX+cYJYWVtOktDi0tr69eWJZCMiXVlg0RMVi0gySy7h3ENt AOalZpqgptVyWuxN3x1IxUIKUqXtinYJAWrDdxRJkLxIv0DkQ2NkJsuVBBZfywdODYI6 uokAzQC8KXwWhajcQXlYvM8dlcoZnPMrjNCiT3HfT+pcn+jygd82SZnwelAkTt32i/RF VzvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695070470; x=1695675270; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ltxtQ9vs58ZkLsFx7dc2UlYFSCGlP20DljWV5O0PqwY=; b=lEVoizIc8vKY01yUjlAoI8TlFO1Sd/x3PKuuNMksYDxgTKTbJxmCMk7hLpNjvuhje+ iM+jLDbe+Pa/l08K35Ai+7HyhZagVMMhiMPzMtJJkbJq24/GxDgBfZAKhsKehpwkmCG8 tfXPg24sR7gxQZrEZu/s/Wogj0aC3Ysw6i4LyRAroZitsO/NGBhrsT3QJf+BBuekctNx fHRLjOhozJuJQHa3HXgc5rv3lnlly6+ZHndq4IOzVIXe6utbh66rc787JW/Isqxzgg7b n2OId9GettiGSp4kefXbfygLpprRGeirZfRTOi4E6rWXhMXoK2kKA2mWZrYtclt9t79f 4Clw== X-Gm-Message-State: AOJu0Yw/9fmo7xlKfaF7tbCk+hhHkfwenIW2B9yNNdX0E4kdwA+gOdyz 9nSWUtj/jdVB0d6XEiWIJcK+x5g8n1o= X-Google-Smtp-Source: AGHT+IG30m0RTrzEv3YEwYtlnpSoBwQWUxo1VYYJfySLbPgKYUqa06oJgcSFqqvwF0Vvmev7mJseiQ== X-Received: by 2002:a7b:ca4a:0:b0:401:c297:affb with SMTP id m10-20020a7bca4a000000b00401c297affbmr9357653wml.37.1695070469990; Mon, 18 Sep 2023 13:54:29 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id t11-20020a1c770b000000b003fc04d13242sm16166976wmi.0.2023.09.18.13.54.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 13:54:29 -0700 (PDT) Message-ID: <2cc1c03d85153356edd55fc0747a957db3c94ab0.1695070468.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 18 Sep 2023 20:54:22 +0000 Subject: [PATCH v2 1/7] cmake: also build unit tests Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Phillip Wood , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin A new, better way to run unit tests was just added to Git. This adds support for building those unit tests via CMake. Signed-off-by: Johannes Schindelin --- contrib/buildsystems/CMakeLists.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index 2f6e0197ffa..45016213358 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -965,6 +965,24 @@ target_link_libraries(test-fake-ssh common-main) parse_makefile_for_sources(test-reftable_SOURCES "REFTABLE_TEST_OBJS") list(TRANSFORM test-reftable_SOURCES PREPEND "${CMAKE_SOURCE_DIR}/") +#unit-tests +add_library(unit-test-lib OBJECT ${CMAKE_SOURCE_DIR}/t/unit-tests/test-lib.c) + +parse_makefile_for_scripts(unit_test_PROGRAMS "UNIT_TEST_PROGRAMS" "") +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 common-main) + set_target_properties("${unit_test}" + PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/t/unit-tests) + if(MSVC) + set_target_properties("${unit_test}" + PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/t/unit-tests) + set_target_properties("${unit_test}" + PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/t/unit-tests) + endif() + list(APPEND PROGRAMS_BUILT "${unit_test}") +endforeach() + #test-tool parse_makefile_for_sources(test-tool_SOURCES "TEST_BUILTINS_OBJS") From patchwork Mon Sep 18 20:54:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 13390475 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE9CFCD13D2 for ; Mon, 18 Sep 2023 20:54:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229449AbjIRUyl (ORCPT ); Mon, 18 Sep 2023 16:54:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229641AbjIRUyi (ORCPT ); Mon, 18 Sep 2023 16:54:38 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F3B910D for ; Mon, 18 Sep 2023 13:54:32 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-405082a8c77so16870715e9.0 for ; Mon, 18 Sep 2023 13:54:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695070470; x=1695675270; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=TcNCEV02FNopnwM40T1pAoRlxIYH68QM3v1pI2RK28c=; b=c5CN+nx5D3TZl0XyYWY/295L/T7XD5pzSk5ytrmQWAIz9VgeaFdtZaRMTKzmgzVh+y fsvL9zK/Fvlf6FZHzr9oPQ15LBLTuCHlSP3lnGR5/SlvF1NenJfUjEYFBA7bO8b8BD70 h/Uoyso4dGKtg9gsBEDCQoeSPomGyGEgxjj0384CKgkZsKPyRDrlR4wXVhJgy/oZKl4v s1JBrtCTyJhWQNrnDlsi7XRpup6o5x9hdJ3ct5XTa6S2q3EdEn2WT0EsvB6vhQRiZl/x WrKuEO0JsIm/7GTEXcNxwZZTN7FRSoi/1oV6VXodm5KCJpgLPO90oAmkeEAlZkCUN9MY UAFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695070470; x=1695675270; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TcNCEV02FNopnwM40T1pAoRlxIYH68QM3v1pI2RK28c=; b=aBhSMCg+lMJWGwRoCfXFZwpcnS2Lwy4LROivYLWaxpP6U/m0qwEhQtTBFqIFdhL0rH FDnlyYKQ6j39SLtkueaxRZ2B5krdoPc8t4dDyIXfjdeDIuTErjVGASevZ1dTOLdqvt+Q 1L2NHPYxFlDpsMot4I4OB+NnwWVqH2GCvUWBlVhP91rJXdkpDVkBoDvT6Xy6NyLrDJXC ai3OQzYOypocIBNFRGV6GHkus/PNovV0cCJ3D62wysm4gewvth1fn33jC5eTaFxFQYIc I7lrfofGDiFL719yogVexg/9i7hDSaaSMawqomENUhMVClJYObiYx7bMWojmG/WQIUKW PYpw== X-Gm-Message-State: AOJu0YwsVnI5wOWU9DHsylPYyHjAu92JkfF/5O70gO6qnrj3M6D335WN +HyBGMFYxWyVn8TebqiESHupiLXacig= X-Google-Smtp-Source: AGHT+IE5esK0mnRJcb2Ut5edzQkpgsfppndm1NmZmgZkprbFZ7oHqwvl8jKZdHxX/iwVuNHiHF7elw== X-Received: by 2002:a7b:c8d0:0:b0:401:b0f2:88cf with SMTP id f16-20020a7bc8d0000000b00401b0f288cfmr7731397wml.40.1695070470472; Mon, 18 Sep 2023 13:54:30 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id z7-20020a05600c220700b00403038d7652sm13393606wml.39.2023.09.18.13.54.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 13:54:30 -0700 (PDT) Message-ID: <90db3d5d41f8042a28cce02f910e7b6d5904308d.1695070468.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 18 Sep 2023 20:54:23 +0000 Subject: [PATCH v2 2/7] unit-tests: do not mistake `.pdb` files for being executable Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Phillip Wood , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin When building the unit tests via CMake, the `.pdb` files are built. Those are, essentially, files containing the debug information separately from the executables. Let's not confuse them with the executables we actually want to run. Signed-off-by: Johannes Schindelin --- t/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/Makefile b/t/Makefile index 095334bfdec..38fe0ded5bd 100644 --- a/t/Makefile +++ b/t/Makefile @@ -42,7 +42,7 @@ TPERF = $(sort $(wildcard perf/p[0-9][0-9][0-9][0-9]-*.sh)) TINTEROP = $(sort $(wildcard interop/i[0-9][0-9][0-9][0-9]-*.sh)) CHAINLINTTESTS = $(sort $(patsubst chainlint/%.test,%,$(wildcard chainlint/*.test))) CHAINLINT = '$(PERL_PATH_SQ)' chainlint.pl -UNIT_TESTS = $(sort $(filter-out %.h %.c %.o unit-tests/t-basic%,$(wildcard unit-tests/t-*))) +UNIT_TESTS = $(sort $(filter-out %.h %.c %.o %.pdb unit-tests/t-basic%,$(wildcard unit-tests/t-*))) # `test-chainlint` (which is a dependency of `test-lint`, `test` and `prove`) # checks all tests in all scripts via a single invocation, so tell individual From patchwork Mon Sep 18 20:54:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 13390477 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ECE27CD13D9 for ; Mon, 18 Sep 2023 20:54:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230015AbjIRUym (ORCPT ); Mon, 18 Sep 2023 16:54:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229680AbjIRUyi (ORCPT ); Mon, 18 Sep 2023 16:54:38 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1540C111 for ; Mon, 18 Sep 2023 13:54:33 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-31f737b8b69so4783602f8f.3 for ; Mon, 18 Sep 2023 13:54:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695070471; x=1695675271; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=sTC0H5bMqEvutVYdT1W8jB4c4FKMKzN/kGSamHxn0Nk=; b=L17tG0toUsfcLjUvJxHmcFSdGj8LFQ0+FJJSjVHagFPFFAH4tsZz+1hA3mKxXS/5qZ /pg34xhMUkf/fL/HBEhbSDfq+VQ/WSS0RCp929TdEIIbf8DX32Vhm7ksB5zdUjoUXaHR TqUEU2k5wEzcduMIC8UnqGiHrJ+F03/V3Oju2rE+XzcmCMBsdpoNP/XK0FqJQXdfzX1B oOZaCNo5//tUQuhxf5zbmwbkMzerDExo2DOyO8xFrOfvHqn4U/BzWXU9/Peey1HjK46l E0ReQ9/k2KLuxGJL1xBCxbeNPVzF/VgRPXi3k8hr71U0frhBgAjv7zUcfsiYH44WW9Lr d5Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695070471; x=1695675271; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sTC0H5bMqEvutVYdT1W8jB4c4FKMKzN/kGSamHxn0Nk=; b=OVfBCSkBMo7nej+0vUr2y+KoGy1mr8pDnf9MPX3TnrKH+daDo7Com56FUVfl1Ft49N SaHsLXDpit5U7dNThFWeYaelUDFieG260BBms45P+xPw7HgER7YkgAAFzyL63s39ueY4 u6VQN4jVGMrInvtSZ6gY+IgtumSP4e9MMbmuIMn+XKYtlpIHuuRUanQ5y91oh7KUwr7X c8J/LWr7ETCcuwb1173r6je+WWOIlJOvkfa9R6wnmhuXzpr7WOj4SzVseIBlrA4yjRSJ +gCdvFrTGhbCEk1/WdwBTrift4a+z6flWpr4OQR4qPfVsPDZmdIB26Ak/VIzH/A2cxqV IeBg== X-Gm-Message-State: AOJu0YwrkWobTMdVv2Y+EWzxOB1p0Pl6YBRDTPJjaF/jifm0zPO68F3f kyZ+w8PW5cIZn2CzjfB1fDN0vFgabBo= X-Google-Smtp-Source: AGHT+IFuNOVyY2585d7sNysQvfJ2GFh3ULbe8xWMG3amDwVux4t/oysIbxMbwIH+ZoHTbT43i0iflQ== X-Received: by 2002:adf:b197:0:b0:320:7272:8fbe with SMTP id q23-20020adfb197000000b0032072728fbemr3556218wra.17.1695070471135; Mon, 18 Sep 2023 13:54:31 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id z2-20020adfd0c2000000b0030ada01ca78sm2527141wrh.10.2023.09.18.13.54.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 13:54:30 -0700 (PDT) Message-ID: In-Reply-To: References: Date: Mon, 18 Sep 2023 20:54:24 +0000 Subject: [PATCH v2 3/7] unit-tests: do show relative file paths Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Phillip Wood , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin Visual C interpolates `__FILE__` with the absolute _Windows_ path of the source file. GCC interpolates it with the relative path, and the tests even verify that. So let's make sure that the unit tests only emit such paths. Signed-off-by: Johannes Schindelin --- t/unit-tests/test-lib.c | 52 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/t/unit-tests/test-lib.c b/t/unit-tests/test-lib.c index 70030d587ff..744e223ee98 100644 --- a/t/unit-tests/test-lib.c +++ b/t/unit-tests/test-lib.c @@ -21,6 +21,46 @@ static struct { .result = RESULT_NONE, }; +#ifndef _MSC_VER +#define make_relative(location) location +#else +/* + * Visual C interpolates the absolute Windows path for `__FILE__`, + * but we want to see relative paths, as verified by t0080. + */ +#include "dir.h" + +static const char *make_relative(const char *location) +{ + static char prefix[] = __FILE__, buf[PATH_MAX], *p; + static size_t prefix_len; + + if (!prefix_len) { + size_t len = strlen(prefix); + const char *needle = "\\t\\unit-tests\\test-lib.c"; + size_t needle_len = strlen(needle); + + if (len < needle_len || strcmp(needle, prefix + len - needle_len)) + die("unexpected suffix of '%s'", prefix); + + /* let it end in a directory separator */ + prefix_len = len - needle_len + 1; + } + + /* Does it not start with the expected prefix? */ + if (fspathncmp(location, prefix, prefix_len)) + return location; + + strlcpy(buf, location + prefix_len, sizeof(buf)); + /* convert backslashes to forward slashes */ + for (p = buf; *p; p++) + if (*p == '\\') + *p = '/'; + + return buf; +} +#endif + static void msg_with_prefix(const char *prefix, const char *format, va_list ap) { fflush(stderr); @@ -147,7 +187,8 @@ int test__run_end(int was_run UNUSED, const char *location, const char *format, break; case RESULT_NONE: - test_msg("BUG: test has no checks at %s", location); + test_msg("BUG: test has no checks at %s", + make_relative(location)); printf("not ok %d", ctx.count); print_description(format, ap); ctx.result = RESULT_FAILURE; @@ -193,13 +234,15 @@ int test_assert(const char *location, const char *check, int ok) assert(ctx.running); if (ctx.result == RESULT_SKIP) { - test_msg("skipping check '%s' at %s", check, location); + test_msg("skipping check '%s' at %s", check, + make_relative(location)); return 0; } else if (!ctx.todo) { if (ok) { test_pass(); } else { - test_msg("check \"%s\" failed at %s", check, location); + test_msg("check \"%s\" failed at %s", check, + make_relative(location)); test_fail(); } } @@ -224,7 +267,8 @@ int test__todo_end(const char *location, const char *check, int res) if (ctx.result == RESULT_SKIP) return 0; if (!res) { - test_msg("todo check '%s' succeeded at %s", check, location); + test_msg("todo check '%s' succeeded at %s", check, + make_relative(location)); test_fail(); } else { test_todo(); From patchwork Mon Sep 18 20:54:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 13390478 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94564C46CA1 for ; Mon, 18 Sep 2023 20:54:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230017AbjIRUyn (ORCPT ); Mon, 18 Sep 2023 16:54:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229478AbjIRUyj (ORCPT ); Mon, 18 Sep 2023 16:54:39 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4BA38E for ; Mon, 18 Sep 2023 13:54:33 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-31f7638be6eso4718262f8f.3 for ; Mon, 18 Sep 2023 13:54:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695070472; x=1695675272; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=NPUNwTpoGT9m/YFejKsp7W7P/TOk3usDGQALMcYRJwg=; b=HwxLCkLVVveT5dRszTF1SrPIEDV8pdVNnxTTqArzKy0fuUsPaV2Q2HxSgLKTz2uNQE MPrxh3mCcXOVrHJGz0WQerXhLGPkFmnCkXONsj3J/uzRiLo3SQFW2V8qUAkTKMFp6CYY UlI4lUIPmLPLU6A4US8el7Ub48Mxw6VqwudkWkJtqgRoCu9ZD0R49Z0sybC2wO0u3fdR F3Pf3Mts10VqKcnEcpL4inh+P6wFsrn8EvKmM8j1GFJwrYHKaaXz+RTj0oJaXN76Czq+ ZzCIEC1YcwpHsMBn/8rcJmASSq4szA8r6Dy2etPivmqPBVmBFVyXUv1QFWG8q4ambJjg cofg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695070472; x=1695675272; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NPUNwTpoGT9m/YFejKsp7W7P/TOk3usDGQALMcYRJwg=; b=jk8hy2jLicqSF0TN8REutiaC2lw5uoiHlM3a1FVyq8BstkufuUHNHg2aS0SynQPCFx zvOhGfGUiPcQqX44Wn/hpncirWM6vz/sKLvA2ZYpAsxySQwa3vl/SYmlqIvt+OsN+xcx V+yw0JRGw/yNjGozilExW0MUuMTAerddF268k5xjGlDWjkAdYXi//oIXgViZhFe+EkU+ 2FBtldLsm3wlnKThzxr8y5DnPI40GwgjREgODB/YGZseY/gym8Br8HHn9iiIfvt21spc zE8vlxMlvibhXtC3UOaG6Nv/WUX7DSe0e7OgmcRU9TAjJTLEAV5Shli4y/zOIJK8xZBO dbHA== X-Gm-Message-State: AOJu0YyhRHuiKf4e5wfOADIwD0dVUySthdd3dqJMfYm+vwGBajqoYANS wM4PY1/3gehCTmGNNE9rQhDNESMi/uI= X-Google-Smtp-Source: AGHT+IHZKQDcqg/vdJWRbGAUiFwdxugz0mltf3GJkg60HOgboiwNtVHgbYCTCR55IzeQ0ar7/+q5tg== X-Received: by 2002:adf:db49:0:b0:313:f0d7:a43 with SMTP id f9-20020adfdb49000000b00313f0d70a43mr7264178wrj.23.1695070471907; Mon, 18 Sep 2023 13:54:31 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id v23-20020adfa1d7000000b003142ea7a661sm11532087wrv.21.2023.09.18.13.54.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 13:54:31 -0700 (PDT) Message-ID: In-Reply-To: References: Date: Mon, 18 Sep 2023 20:54:25 +0000 Subject: [PATCH v2 4/7] artifacts-tar: when including `.dll` files, don't forget the unit-tests Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Phillip Wood , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin As of recent, Git also builds executables in `t/unit-tests/`. For technical reasons, when building with CMake and Visual C, the dependencies (".dll files") need to be copied there, too, otherwise running the executable will fail "due to missing dependencies". The CMake definition already contains the directives to copy those `.dll` files, but we also need to adjust the `artifacts-tar` rule in the `Makefile` accordingly to let the `vs-test` job in the CI runs pass successfully. Signed-off-by: Johannes Schindelin --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4016da6e39c..d95a7b19b50 100644 --- a/Makefile +++ b/Makefile @@ -3596,7 +3596,7 @@ rpm:: .PHONY: rpm ifneq ($(INCLUDE_DLLS_IN_ARTIFACTS),) -OTHER_PROGRAMS += $(shell echo *.dll t/helper/*.dll) +OTHER_PROGRAMS += $(shell echo *.dll t/helper/*.dll t/unit-tests/*.dll) endif artifacts-tar:: $(ALL_COMMANDS_TO_INSTALL) $(SCRIPT_LIB) $(OTHER_PROGRAMS) \ From patchwork Mon Sep 18 20:54:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 13390479 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11E94CD37B0 for ; Mon, 18 Sep 2023 20:54:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230030AbjIRUyo (ORCPT ); Mon, 18 Sep 2023 16:54:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229975AbjIRUyk (ORCPT ); Mon, 18 Sep 2023 16:54:40 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F33710D for ; Mon, 18 Sep 2023 13:54:34 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-403012f27e1so53159645e9.1 for ; Mon, 18 Sep 2023 13:54:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695070473; x=1695675273; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=23l3Z8R4FAVJkDvMIqmZkHPda5QO1OxxfN1rwfQduxM=; b=KOakKsJP5q/XAYGVWf73lccnQl44fybleK/XXP9i4WVrQJMCL06A3VbvFzmbRnPdOt bB9kwhRUbMbNMqEsTJsMJJbguGI8E0u9xn5s6wFKcdzLLGOxz1BAPrYV1aG0XB5LR85U CbGMJiAGEBhj9EdopgEAsXnyhB3wCl94QwhaJEzIvh9WbLU9xXGxfp9YHPlUnBc12dBW ZAORM9iZF0PGGptf7b16Yh75onxAKLd+6a7nf0upHIodaFwzRzJNyRhpJ2kVLYm3hoay MBETBBfvPWL5sGOrg88UVUpvd3o7cs5bhbSF4kNhXD2lzupNYmoTYO9ShYGx0bPwObox HG6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695070473; x=1695675273; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=23l3Z8R4FAVJkDvMIqmZkHPda5QO1OxxfN1rwfQduxM=; b=K5r+I6lTDnJm7if45o/qaGpwspcC7PPdAH/U/+zd7f3hPkpv+LtSajH8pW1PzyiKft jRbh35fg41eyvfpWFPFhzEg4omQLhw30EAK2RHajxJgkGE8YhqesFZNZa1E0/ApXhdSN aLSGvSZme5wwwCLb70ly2bM0MNYtaSxyu2pgPfIrZQZ852yheZkI9rQTDlxy00gkbE18 rdoK7T/0Jn0cwTnxpZ8pTozU8EvIbp6itXWRx9iG/Rvdas5nPoZky14pJe0ze97iYPB6 +1qt5N4f3jGppx4TIKBVA5XlaJw+wXac04u0+n6ohw6hUtt+n6qURy2SnYxCqmAD8heu uAiw== X-Gm-Message-State: AOJu0YyfSSIQoEpHFPHyX/ScMrTK6kWmCS4Vroea7nYiITaj/hZPh2lK ubHOh2Vl6ZfIcC/lFzqyglOhOVBSJVA= X-Google-Smtp-Source: AGHT+IFDpe0lMpbAylTJgJN1Y5dT+T248e+edIaNygKojznmkNyTRlGPBSQAAev8VAJ35K6X/cug2g== X-Received: by 2002:a1c:4c07:0:b0:402:ee9e:ed98 with SMTP id z7-20020a1c4c07000000b00402ee9eed98mr8338366wmf.34.1695070472696; Mon, 18 Sep 2023 13:54:32 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id p14-20020a1c740e000000b003fe407ca05bsm16269391wmc.37.2023.09.18.13.54.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 13:54:32 -0700 (PDT) Message-ID: <75a74571fbee7677d0e473a199d99c10da35ba09.1695070468.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 18 Sep 2023 20:54:26 +0000 Subject: [PATCH v2 5/7] cmake: fix typo in variable name Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Phillip Wood , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin Signed-off-by: Johannes Schindelin --- contrib/buildsystems/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index 45016213358..ad197ea433f 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -1102,10 +1102,10 @@ if(NOT ${CMAKE_BINARY_DIR}/CMakeCache.txt STREQUAL ${CACHE_PATH}) file(COPY ${CMAKE_SOURCE_DIR}/contrib/completion/git-completion.bash DESTINATION ${CMAKE_BINARY_DIR}/contrib/completion/) endif() -file(GLOB test_scipts "${CMAKE_SOURCE_DIR}/t/t[0-9]*.sh") +file(GLOB test_scripts "${CMAKE_SOURCE_DIR}/t/t[0-9]*.sh") #test -foreach(tsh ${test_scipts}) +foreach(tsh ${test_scripts}) add_test(NAME ${tsh} COMMAND ${SH_EXE} ${tsh} --no-bin-wrappers --no-chain-lint -vx WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/t) From patchwork Mon Sep 18 20:54:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 13390480 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 225B1C46CA1 for ; Mon, 18 Sep 2023 20:54:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230038AbjIRUyp (ORCPT ); Mon, 18 Sep 2023 16:54:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229999AbjIRUyk (ORCPT ); Mon, 18 Sep 2023 16:54:40 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21E3F8E for ; Mon, 18 Sep 2023 13:54:35 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-401b5516104so53428325e9.2 for ; Mon, 18 Sep 2023 13:54:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695070473; x=1695675273; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=eWVgy3TCCF3l/JJt+MfR17FAOgB5+dYGh0iwW3wP6N4=; b=jJB7zvpkx3oIRadmXU8hI5eV/4f8Mu6nD7nl+87/Ch1BM/RyOLcjZKEcm7aCedaOOi iDqmEPF0GuPEwfIbvgVsV2G6hjd77aODY3W+TzGEKGm8KK3TD9Q2SqfxLhvXnbFgWlyG OrfbuHq05i55K51oLW4WslJyuZb8YTN4gm/8LpPIH1L+UjJheH8K+T7+0gFGErRUyku5 AHV9lY+MpKQeiOiOQegdVd20Dwaqy9FW3nCbXIk11bryeXpLgqHet/sQicqxcQxerubr 4YUOQCMZioTREItZckp4sD9q8M6XURsN+tZ33KIur6hnjeXO4gpLu1xLIKIHitQ/QQeh wdVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695070473; x=1695675273; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eWVgy3TCCF3l/JJt+MfR17FAOgB5+dYGh0iwW3wP6N4=; b=kH/cW+bF3OCiqp95qDreAXImf5RGwRFo+nmg/JiKeDzSYnMep1V4jZq22XtzArmUZj pZ4jf70KHx/FIb7Di11ALia5t6bhemgDAM21bbwsJaIjzVNqhTE7yQeuOAVVECVwXiPm MqcmhUcPeIc6gsEGPxPF76GTDccBW5AYLzXqO6EJ18M3LqVNpbU8VixrzqJCt0YNalMO yv4YILCeKiz4Na7dCg8NBkjLARcr+WWi5E3GZP5XnSXCScd0te7ljaxv054m25P0rF4K hX+5z0a6ZmX1y1mEGwPW2pCT/F+7fdpqIb2gdtM+2V9MFd+oUwLxrFo3ffldSrT/nPw9 PjBg== X-Gm-Message-State: AOJu0YxN+VlbTv9JwrMr8diALEAheyxf9JaSjDTCLELPY9/l70sKqF8N tFt5wBTBZ+4z/XBSWM8/YnqzgGLGJak= X-Google-Smtp-Source: AGHT+IE5SGxft1DkADjloHw2JoVY7cG5nIrvxQo0fgObrnhxWRA7oEv18IO0XPlFqAtAH1aYVeeTfw== X-Received: by 2002:a05:600c:1d9a:b0:404:f9c1:d5d7 with SMTP id p26-20020a05600c1d9a00b00404f9c1d5d7mr6546297wms.25.1695070473153; Mon, 18 Sep 2023 13:54:33 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id m10-20020a7bce0a000000b003fee53feab5sm13441291wmc.10.2023.09.18.13.54.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 13:54:32 -0700 (PDT) Message-ID: <41228df1b469d9a79f3278fe8c1ca37082600669.1695070468.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 18 Sep 2023 20:54:27 +0000 Subject: [PATCH v2 6/7] cmake: use test names instead of full paths Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Phillip Wood , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin The primary purpose of Git's CMake definition is to allow developing Git in Visual Studio. As part of that, the CTest feature allows running individual test scripts conveniently in Visual Studio's Test Explorer. However, this Test Explorer's design targets object-oriented languages and therefore expects the test names in the form `..`. And since we specify the full path of the test scripts instead, including the ugly `/.././t/` part, these dots confuse the Test Explorer and it uses a large part of the path as "namespace". Let's just use `t.` instead. This still adds an ugly "Empty Namespace" layer by default, but at least the ugly absolute path is now gone. Signed-off-by: Johannes Schindelin --- contrib/buildsystems/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index ad197ea433f..ff1a8cc348f 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -1106,13 +1106,14 @@ file(GLOB test_scripts "${CMAKE_SOURCE_DIR}/t/t[0-9]*.sh") #test foreach(tsh ${test_scripts}) - add_test(NAME ${tsh} + string(REGEX REPLACE ".*/(.*)\\.sh" "\\1" test_name ${tsh}) + add_test(NAME "t.${test_name}" COMMAND ${SH_EXE} ${tsh} --no-bin-wrappers --no-chain-lint -vx WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/t) endforeach() # This test script takes an extremely long time and is known to time out even # on fast machines because it requires in excess of one hour to run -set_tests_properties("${CMAKE_SOURCE_DIR}/t/t7112-reset-submodule.sh" PROPERTIES TIMEOUT 4000) +set_tests_properties("t.t7112-reset-submodule" PROPERTIES TIMEOUT 4000) endif()#BUILD_TESTING From patchwork Mon Sep 18 20:54:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 13390481 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1E12CD37B0 for ; Mon, 18 Sep 2023 20:54:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229771AbjIRUyq (ORCPT ); Mon, 18 Sep 2023 16:54:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230000AbjIRUyk (ORCPT ); Mon, 18 Sep 2023 16:54:40 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6430D111 for ; Mon, 18 Sep 2023 13:54:35 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-401b393ddd2so56412635e9.0 for ; Mon, 18 Sep 2023 13:54:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695070473; x=1695675273; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=504cxXwL03Ag40A4Pc/uIlsTRsHlyA+4I9I/EJ5xJ+0=; b=O1/Ghx2fnIpkpkCbBKxoHa6ocJ5y/bF4ALxoBsqN8CjUUpvd0cIYoxSjsTWw3BzH9A sUSZFWhYBRAoveb6iVPe/ooj6zx/sb30dS9+SZXSDYLBCepPl4QL4T8HAejAs4QFKd2r zUwaU4m0qo0ffL2JIpKFJRwztRoxCYS3ri3jiYvEj2x5jPqzpRldKSlYKczF/Vf2Qp0g e53rrcSNLWh7MetdQgoyQWnZFvKNEosc3s0RTormLdcffNDBMnEOVE8LrR/FzeKP0bCy zp+W41j6B6tqziK4C1rMagm1C7qGunw3wtUedef28HLjTbb4MX4gaQcbGvk7EoXj7jB9 BiBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695070473; x=1695675273; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=504cxXwL03Ag40A4Pc/uIlsTRsHlyA+4I9I/EJ5xJ+0=; b=A3rEoCvPJ+/0nvr+yER9DWM3+eda1WeONbgH5zE06MvvV3W4fd3ybEc9BtDACIQaWR 7E7W5xKvjCbQiRauPCLhKkgQ/lMveOnQWvRZzscPiCaXMvWS0VAvoKMuQjgvzXEgeWkV hUr5qWPM0yxEzMirC5FYWjH4v2yCAguCKPfiov2So+DFZqXQ6Hfr5ou+enJ/qqsg35oR 5lMDM0Ew/tEQyaBP4IZNHQ75LO8wVz9smYl8/sCKIU7Xr3GKphaDTEV+6Q9ICOxoMykA w3PMYdWbaH90bE4nyopipX2UTJeXZH9djrjV+YvEVPrJQ8UWm5TmT5TpLrwR3mwMmoAm OmqA== X-Gm-Message-State: AOJu0Yx6hbzdAK8gwibi7T61A9SedPo8Vt+HeB82wO7AjTQFxRdZPGbp 6FKTeQ8UI8yNPH1z+YGBYg71AmLr07k= X-Google-Smtp-Source: AGHT+IEmFZ8q8YIUTBh4kvvFSBsaKId2TTXyO4IluVIaIaEbhHqBB3uV2h2TWt2UQEZu81RACYsbzw== X-Received: by 2002:a1c:f204:0:b0:401:4c61:90ac with SMTP id s4-20020a1cf204000000b004014c6190acmr9454609wmc.11.1695070473684; Mon, 18 Sep 2023 13:54:33 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id u17-20020a05600c00d100b003fe0a0e03fcsm16239148wmm.12.2023.09.18.13.54.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 13:54:33 -0700 (PDT) Message-ID: <003d44e9f0d73efae887d6b61ebdffb3c4e0904f.1695070468.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 18 Sep 2023 20:54:28 +0000 Subject: [PATCH v2 7/7] cmake: handle also unit tests Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Phillip Wood , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin 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 Signed-off-by: Johannes Schindelin --- contrib/buildsystems/CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index ff1a8cc348f..35d451856a0 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) 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 "unit-tests.${unit_test}" + COMMAND "./${unit_test}" + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/t/unit-tests) + endif() endforeach() #test-tool