From patchwork Mon Sep 25 11:20:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 13397668 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 01516CE7A94 for ; Mon, 25 Sep 2023 11:20:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230476AbjIYLVA (ORCPT ); Mon, 25 Sep 2023 07:21:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229619AbjIYLUw (ORCPT ); Mon, 25 Sep 2023 07:20:52 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DA0CD3 for ; Mon, 25 Sep 2023 04:20:43 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4054f790190so44829775e9.2 for ; Mon, 25 Sep 2023 04:20:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695640842; x=1696245642; 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=cpa/gvONQYdJUDcZlOlhmG1jBwU10iHrNLCQ9DD6iZm0Bd2/tjHuur3DbdeJWFzTux PwaFey4iEabzhJmNK7SIQZDu3HHS1AW0r2OQ41X6hrtGy4Xw0KRBLAHQi7sgL5OfrsuZ 4FB4fxinwoHC7R6sR1epOz7Ywl1lmWcNbejyjOcAhYM86DU011eWAOW3r8HD0lok0UZr 2KRp/t1dzKoi+ZKJRa9GK+UWqFCa2zAjeqBX+a7qdOmx75G7Efy0FlBDm35TqZwt+oum 2x+ygpR+mCFjGPTL9uUCjC/PLf/8AV+FLr88E2aGsza2GK7I+mAm2+96Wd8pcJR3CPoY ZteA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695640842; x=1696245642; 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=dFU5k3dKMwFd1kINPLDt/5kv1+sJJGhDgXoz4gQHttzY00Q22T1fWIvtmZyA3wMeyg BYBI4yvsJ8cV9H6+7aPLst0ugLrUcXFV80aEkJfyAhgdw8g/XCYn3AQEdq6vZp2a9yMh SU3iZ46giLKMzdKwnbC9CloYNHgMWW2jvah6/UF76wAFvlhxMaLpOid0gn3jjm8QdJ9d L43Kl9PtXxBxiLRFNMMfLk8y15d4pjnrmZMHdbFG/fXWrcPI1xAvC42z1ZrIQJWPlNaA FKw9h7Aeb1IftmMYgE382GrC39xhEsaInix6E7WuwRMZs5+xpAUHckOMs6FnazRMXmnw x3jg== X-Gm-Message-State: AOJu0Yz0w+IMs4DirJfrdCHj38cwyQ2H/ke7yljnqYO8pJTBhqiVlp/q 4UDodE5ertX0616PllYJtrEWz4K6H1g= X-Google-Smtp-Source: AGHT+IGgRVtSCunyQNyJBveFd3eQ8We2hkDhn4vkwvqTsVofITrEehyHXSbLTbreZUqZNxnw5aqPUg== X-Received: by 2002:a05:600c:2215:b0:405:348e:aa43 with SMTP id z21-20020a05600c221500b00405348eaa43mr5437104wml.12.1695640841521; Mon, 25 Sep 2023 04:20:41 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id k3-20020a05600c0b4300b003fe1fe56202sm12072225wmr.33.2023.09.25.04.20.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 04:20:41 -0700 (PDT) Message-ID: <2cc1c03d85153356edd55fc0747a957db3c94ab0.1695640837.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 25 Sep 2023 11:20:30 +0000 Subject: [PATCH v3 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 25 11:20:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 13397667 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 740CFCE7A94 for ; Mon, 25 Sep 2023 11:20:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230440AbjIYLU5 (ORCPT ); Mon, 25 Sep 2023 07:20:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229632AbjIYLUw (ORCPT ); Mon, 25 Sep 2023 07:20:52 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6ABEEDA for ; Mon, 25 Sep 2023 04:20:44 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-31f71b25a99so6044767f8f.2 for ; Mon, 25 Sep 2023 04:20:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695640842; x=1696245642; 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=C2NdqjXQjGZuGWfsJgA4HWO4tO/JY5NHzCNpmJX0fioXgUBMc6Mnrj75tmIgq8qCnQ NvdkhJHDNDw0gKBvnHedVZcGApLntc650D3e42s8mOc44BknquDBcKOMYg4eRqalXcbr WEJ5wf0wNsX4TEDixdkQ5xrtGJGQW04EcBrwi7gO7nf0otXRIVTIoD0XPmfxYAVFjnkd H3TLpj4GX17WRhyZCg37OsiH2mltWGPqIYKgeXUav2hQ4wAB6Um71iHyBi73Zf2eZ5DR eZOncRojBbEX7VmdC9PKAYmoGKBu/EI8CAuz35+elOIHzg9SLZEWw+Xh6Ew7QAg6MSnB POsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695640842; x=1696245642; 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=aouDg9Y7Eo7Q5rrMsEmFwexDZB226W2aT6PIMg+gEYaHpeRP+FQ2c6O7J65+mQAk6i bF6o7exhYZjdhKUz5JusNjEJN3wdg3J2wIpPBGCqg3kqnMXVDrUGY505T4P0tUHUlUHE bKfQgXTBlo/0c8APTik9WyCAvzmHumGrYJiT88nmMgBMSrfgjhdxq3wkGq7r/iET/0bj t3x/B6Cdfvr/qPsyUjIREV8bdVhocQU/V7bLI/epwOITRT3KsMuILQBKW9K3+7EnFnI3 y7p2Dztyv8VIXEOFrUPrBdIq4HPI75zJU6N4WAtShQMAcZZ12zcv7OV58smNiIU9jI3k ACnA== X-Gm-Message-State: AOJu0YwH9wRfNj8hjswS7J8bm4EYjQfXrDcdwavN3wR7WqVooW08MznH oOJgRyhMP4PVZLlqwprX/LgA50/JDic= X-Google-Smtp-Source: AGHT+IHplFHuadg0FYco5V4EZz4eFkK6iw4bi5PD8zpkhYFkrVkvHNYKzQmAp/QnJn9NWJh1nrVtGw== X-Received: by 2002:a5d:4644:0:b0:319:79b4:a8ba with SMTP id j4-20020a5d4644000000b0031979b4a8bamr4823330wrs.41.1695640842592; Mon, 25 Sep 2023 04:20:42 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id r2-20020adfe682000000b0031ff89af0e4sm11540997wrm.99.2023.09.25.04.20.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 04:20:42 -0700 (PDT) Message-ID: <90db3d5d41f8042a28cce02f910e7b6d5904308d.1695640837.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 25 Sep 2023 11:20:31 +0000 Subject: [PATCH v3 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 25 11:20:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 13397669 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 BBD8ACE7A95 for ; Mon, 25 Sep 2023 11:20:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230505AbjIYLVC (ORCPT ); Mon, 25 Sep 2023 07:21:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230045AbjIYLUx (ORCPT ); Mon, 25 Sep 2023 07:20:53 -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 38CD6DF for ; Mon, 25 Sep 2023 04:20:45 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-32008e339adso5768117f8f.2 for ; Mon, 25 Sep 2023 04:20:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695640843; x=1696245643; 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=bDRo0TJWjq9iLivXW2R6osi/4AV20HnnpwU+vpowFBLAHjEXk76HzyoAj7/8sJCFxF LgTWs3fS1H6juk044rovshPEzKhdGFdlsuVeupeKN4alZ29EE2nvb3Qt7sJGj0/yzg9U q5hVPWlFBmLfXWesNNfZHpHEsyVxb741EBwRoTiOcwx+EjAk65x8viVw8NRIIQCuIdZ5 3aIp1bJV6OEIi/1lJdA0ahGnl+QNq0Sg/Zbd2pab5jDYiMoULRGPYWjyU1k4WDaduxvZ o8j4Bbtt5iGEij0ECP1S/vfECyc0TYngqGpyfj/1NL/yPm52SL9B23+ypSkjK80O994s SAIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695640843; x=1696245643; 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=Tue8+yBR3Z9lymt7EGG1VMCjdN5oy2M5umVsSwwOU4VxT4prP5vyLIirQkARMcbulB UW0ef1U3Qpdj+/OsEJ+9xh2dAcqROR2ik+CaDlPCRDoaMAMJ0Z9+TcfGOAsb5yxbQBs5 NbeXjRkMtSxvwWrdVsivRC725ycAchxwIRMhfZYCajcInxmo+/V/pkuHMoFIkMF+0YGw YU3KtmuKDpzGdh+JFEXRbunVu9b4yKVDYyrMIP1DDS2gMsA8fkX4jwf2IgXmJn5B2tZr mQ6G4il1jP/+RtsfFg2Teojs3g3dj4D0YTyqgf7Hc6YTV4QqnOxiwEwP4vrLVe6QgsY/ QplA== X-Gm-Message-State: AOJu0Yzn9PxivpSUo0g0/37MYckLR+2lUWH0Lj+6aZFaHtGEgxOLjM6i XjdVTA1NYCxehBfkhJYCKsB+q3tCF4A= X-Google-Smtp-Source: AGHT+IF32RxmpCJA+qMzYsQUs5e3kjf61xrl7BU6vmXPZd6+ll5e1nnE5D80gAdnZ73qZOQvlHgLhA== X-Received: by 2002:adf:d4d1:0:b0:31f:f9fb:d5bd with SMTP id w17-20020adfd4d1000000b0031ff9fbd5bdmr5826352wrk.68.1695640843481; Mon, 25 Sep 2023 04:20:43 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id bo12-20020a056000068c00b00323287186b2sm2593271wrb.29.2023.09.25.04.20.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 04:20:43 -0700 (PDT) Message-ID: In-Reply-To: References: Date: Mon, 25 Sep 2023 11:20:32 +0000 Subject: [PATCH v3 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 25 11:20:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 13397670 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 64FF3CE7A94 for ; Mon, 25 Sep 2023 11:21:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231157AbjIYLVE (ORCPT ); Mon, 25 Sep 2023 07:21:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230438AbjIYLUy (ORCPT ); Mon, 25 Sep 2023 07:20:54 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B82F6C6 for ; Mon, 25 Sep 2023 04:20:47 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4054496bde3so43171305e9.1 for ; Mon, 25 Sep 2023 04:20:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695640846; x=1696245646; 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=V3dHugFanECtiahS3JZTKYw4mFP2jyH9lHW9yLArRnKlVZ/f2it8p4b9wVAuf3TNqp dvgOXesla6bU8vTTulHQ7IoPYts5AymDVoYDMBiAajCHWOPUa96NSVWy+WZFmmNtCFLA IWZt7a7lcHFuT5M/SY2dM4yfCx5tNMCfuha3r8rZgZ8dqCnZAjtBMzAjBCtVyMyKs44D ZY9xuHIJt1ISzNRVgYjv5Su83yfw2NvAHH6X5Svg9xjzFOErKk70VhkCq4gZSD5mNr5n Bgs5me42VQqN3c9Xa68RNueOX89nmhRamQ32eyuTSTEii1WUKNEHODRV6wh76zydmqdU o5mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695640846; x=1696245646; 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=dGVO5BKcNlkidUBGA18BKXe4fx8lHHfZbDDDXXx9k4bi1LbmxU/7/NFw9NGNo3OMYk 2vwmysPwJ3xvEU46/qWJoJhVCiCxPx7BNoOTubv8YoMWKPUpNMG+t5ngvy68wrP3uIfV 7dEBt+HWO3GvvFCrV86PUA4dmjkLaIlzRlL8iaFhzSimvsAiYHBKxMJedwEdpOKOvquY uHCQz6if44NIrDJhExTEVkpmv+F1IM5eCSZrx0vGQEugec4EafFHqYR1Eex7DhyjEGpj iFP3qHs2/ceCqGYPsVS3XnmP/KGrj3DT7VEOaSwlMggfzvDRpof0trBXnp5a1RlElyDk bSMA== X-Gm-Message-State: AOJu0YycAFZHRe+oKKK8tH92Z4QTQsbpH8f/fcZGf1qnrzwi+clPoULF zGI/yI1GfnAhg/NmyfOB494/f6Cixq4= X-Google-Smtp-Source: AGHT+IE0FponFSjYy9+dajtwvuwfMSqOaxkvCieF8FyJbPTjQ2sedJHObkdPnJ9x2yj0eXkYAbVdvQ== X-Received: by 2002:a7b:ca45:0:b0:405:40c6:2b96 with SMTP id m5-20020a7bca45000000b0040540c62b96mr5360596wml.3.1695640845676; Mon, 25 Sep 2023 04:20:45 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id l10-20020a7bc44a000000b003fed70fb09dsm11950596wmi.26.2023.09.25.04.20.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 04:20:43 -0700 (PDT) Message-ID: In-Reply-To: References: Date: Mon, 25 Sep 2023 11:20:33 +0000 Subject: [PATCH v3 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 25 11:20:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 13397671 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 86594CE7A95 for ; Mon, 25 Sep 2023 11:21:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231160AbjIYLVG (ORCPT ); Mon, 25 Sep 2023 07:21:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230114AbjIYLUz (ORCPT ); Mon, 25 Sep 2023 07:20:55 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76FC7D3 for ; Mon, 25 Sep 2023 04:20:48 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4053c6f0d55so56838235e9.0 for ; Mon, 25 Sep 2023 04:20:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695640847; x=1696245647; 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=SOuHma9yqqtJZORiroQ3rrgh7BrCqyUY9eZwsBUWqZn+pGV0WiOEvMgZxJzgygYOQ8 r5N+fJyIjFJYDgrxWhtz8OjEVYBY0KaciJ2uOTkyVIE7I9MrefuyAwS2iYNiS1GXbEEP Abf31A2yOeVeHZpPiR/Kcuj/6i9qIVt6TPZ498NWZiE+fqjLqOPiGot7WIsvh9mSpKrm 5F+MtFY/eLBLOVJCrgYukjQjNtG84S/rKzIcmONB1D0wd2btIegeBf6oQVeqP3Z1XzCp /etSEXYDSjCktZs5HGPZwhbn3Ioep+VL54HdnCTLwbqI92w/mIQUAnNcnMzPPkMjIhpU Fz4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695640847; x=1696245647; 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=CYSEw+KtFrrnToRcluWv+7AfDz01VblTa1lLP06+QAcicLnI5xa3yIe/wqlWFn/wjI sAprLPEjHOBT7XWIRirNQiRbffQmVuI+q9vL2xJAtjndb9leDTzu6U3f7tMd74RbaMpP Q9AuHhDwv/yU0PyNwWpBvsItrzqrymoJUTFVdipS+v2/e/5za0sX7WEDb/2yZfkzkkTP 59V+SkZU1GZFrqXBK+/cCOMcdYrzLWd4/0jVYoR8UMjJDr4+ckdJbhgvEvLFEJWxC1xV pkDKoa3vSvbjgUwyF8wXCp7m70/aqu/Qk0fYGzZlCuXk7ICgRVxjZ/5GHGON9TGFTv4B nKxA== X-Gm-Message-State: AOJu0Ywoo60XST5WvTeSLKkCrJMnFpKC9f59lAysOHhUUMzkho5SJPPD 4JWeXIW/tfwPoAG6qtDKUMV4z3uI9/4= X-Google-Smtp-Source: AGHT+IGaMfGnxqPDR1B+s6bFyGQbIa2woKESwdtzHPXfG5IgIkRZ81TExhv8E7TMGDUOBnV0O12DHQ== X-Received: by 2002:a05:600c:3658:b0:405:37bb:d93e with SMTP id y24-20020a05600c365800b0040537bbd93emr6347118wmq.9.1695640846743; Mon, 25 Sep 2023 04:20:46 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id u11-20020a7bc04b000000b003fee6e170f9sm11840536wmc.45.2023.09.25.04.20.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 04:20:46 -0700 (PDT) Message-ID: <75a74571fbee7677d0e473a199d99c10da35ba09.1695640837.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 25 Sep 2023 11:20:34 +0000 Subject: [PATCH v3 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 25 11:20:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 13397673 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 1168ACE7A95 for ; Mon, 25 Sep 2023 11:21:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231162AbjIYLVK (ORCPT ); Mon, 25 Sep 2023 07:21:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230460AbjIYLU6 (ORCPT ); Mon, 25 Sep 2023 07:20:58 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2932ADA for ; Mon, 25 Sep 2023 04:20:49 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-31dcf18f9e2so5934957f8f.0 for ; Mon, 25 Sep 2023 04:20:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695640847; x=1696245647; darn=vger.kernel.org; h=cc:to:fcc:content-transfer-encoding:mime-version:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=CDyY9qQi7KqDWV5dNj7AbYxVuBY39f/ATbDI8z43VBk=; b=KtkBfW8Qr1QDBeRuYwewlkvvfaj6k1ijRrqdCvatk0A7uvdJlTWm+T+qK7Im3SwO4m sQBGiszuNZAjgIOc6h1q5f0i18WhKX8V3AeX7q1hg/QCO3JEHRUGbqHO+DQWxAMz3hFP 68wyhOA5v92q+oxJNtiF0bwSedzP5rYc463VDOsNerIamaqrgrx1czxtOHxJnhI6I6T/ 6ySwOchNnZC84qsNz7Y8mDh29g4yV6QdK6NLSv03u1kNcOiG6jP+SmVFc4j3BJyp15vo dxxPpgkXB1K0iwNjfY3f4UvwOoeGEMLrg0HZIXukf/RvIgq+01bD5YUgriS/gjhnwN49 OFvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695640847; x=1696245647; h=cc:to:fcc:content-transfer-encoding:mime-version:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CDyY9qQi7KqDWV5dNj7AbYxVuBY39f/ATbDI8z43VBk=; b=qnBcu59/eGLWA0eSVekQbd+DUQNfOdTpt+AKkBjeeTQc5v8lZOFzPT6L2Ctqoyexxr +mGIa9F5shbeHSx1SFwXBaK//o62Fa4KxBFYwWh3xW4Sn9bFHfdv4RsNTcakiw7ZI6XF uVwgHbDG8AZoNqWV9k4lV3VUWpQISzCsSThg6pT1ikaEsfC+5fHYW7fFUAe0sg29OmEf av++K8iBUpl/QXkMcbP8LKIsinnx8m/KeH6wPMM/uT5F5O2oO7kH9AUZF/QCnjhRdM9e Bra92QKhC/leSVsp5wQO4d0NnHTTOK9ILnATnHRu/B2pwvPRJDChH/b+J/68zekTF1Qu taEA== X-Gm-Message-State: AOJu0YzASIeUT5ONEDPjkgrChaJvYN2MuViJQakRSDq+xGca9kpy8qeq QdcKVdIv9ZHrtrb7NPQjrixWlZpWbXU= X-Google-Smtp-Source: AGHT+IHH6SJKV/AFGVuowLZKjITFi4H/WfGToQ1hfqITrlTcXVcj8pPsYdP4SK9e5vZYRrncJO54/Q== X-Received: by 2002:adf:cd81:0:b0:314:12c:4322 with SMTP id q1-20020adfcd81000000b00314012c4322mr5775161wrj.4.1695640847438; Mon, 25 Sep 2023 04:20:47 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id l16-20020a5d4bd0000000b003216a068d2csm11575453wrt.24.2023.09.25.04.20.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 04:20:47 -0700 (PDT) Message-ID: <0a2d08b91e56aba19e02cd43a55d4c74c40cfe71.1695640837.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 25 Sep 2023 11:20:35 +0000 Subject: [PATCH v3 6/7] cmake: use test names instead of full paths MIME-Version: 1.0 Fcc: Sent 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.suite.` instead. This presents the tests in Visual Studio's Test Explorer in the following form by default (i.e. unless the user changes the view via the "Group by" menu): ◢ ◈ git ◢ ◈ t ◢ ◈ suite ◈ t0000-basic ◈ t0001-init ◈ t0002-gitfile [...] 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..5e0c237dfd4 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.suite.${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.suite.t7112-reset-submodule" PROPERTIES TIMEOUT 4000) endif()#BUILD_TESTING From patchwork Mon Sep 25 11:20:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 13397672 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 31FD1CE7A94 for ; Mon, 25 Sep 2023 11:21:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231191AbjIYLVI (ORCPT ); Mon, 25 Sep 2023 07:21:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230450AbjIYLU5 (ORCPT ); Mon, 25 Sep 2023 07:20:57 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC2B9DF for ; Mon, 25 Sep 2023 04:20:49 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-32329d935d4so1301435f8f.2 for ; Mon, 25 Sep 2023 04:20:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695640848; x=1696245648; 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=a2F3WZpJqC4U8ZhQgsyD+2VJZclnONnsWhqageMddbs=; b=D4xlYnPrsozq6X8zf4wkeDYWGGkg8r1dxSJriNFrWvRqluZUh+5dKzE8b2wQf7U9L7 5VEEi7N4hAttIWXRuNT1OvTUgj9CPpuPXQpkIQG4SNvywxzPpF4u9khlwuU9L7qfgdAx 2RwxQMLODP8icDcCKJB9+BKidLB9Z+K29As1HNAtBSuCcoz80UjWp6qXvIBXsUXDPhKB H39MjDCQlxVaAva8kaN88TtdQuFS3EB0oVvwCmPGXiQC4JOB/76MIylhFgxbp4vJaXrP +rkXqX9u58AhHY/MOWx68/Q6SlfgQ/rmTXGXodKQzeLJWSqb5un5NTy0ZITH4jK77PnS 1nMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695640848; x=1696245648; 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=a2F3WZpJqC4U8ZhQgsyD+2VJZclnONnsWhqageMddbs=; b=ThOou3Go6+f2DqV7uoOn1ROguzR2kF//nKLGsvrxYWTzSEbsjL2lomLsCAQSHwN5ZJ 0cYNhKeuR/kSSc0uxe3HE8d8MvTP51JKqsIuDAOZD8Ssosl5ZuFoFY8HCFLB2ySz/BS0 0KSek3i885Xm5bj1ngDiJGLVF44U3dWR0yewoRfoz42EVWJ0/J4Nfv9FErWFh6gToo1k kV+1prjFQgrg1aGQK+Yz8hclXuuQjEy5P6a958vAbN97JoGtZlEy/F2D88VDw3KDq4SB i3q235pQ0Tq4rE20hU9PEquFuCzlko4NWJ/tCCqgUAiEfQlkR/zgybnQcmjoG1Wu0zPL orWg== X-Gm-Message-State: AOJu0YzvM9YLgUY4v6nt+HeqjY+vms0frCkhFzbKEw58HhjwW9GwNUaT QE2sf47EL5RMYAJCQ1ov9vsJ9o9KBuA= X-Google-Smtp-Source: AGHT+IFgrNy7Ccj1ENnTcCzrFsZgnmdUvsb4PF+LVq1CokFlqPpep2P3RtECtzW4ELdpDjMC2SM4JA== X-Received: by 2002:a5d:5582:0:b0:31f:ffd1:6cf4 with SMTP id i2-20020a5d5582000000b0031fffd16cf4mr5904930wrv.12.1695640848024; Mon, 25 Sep 2023 04:20:48 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id g18-20020a5d5552000000b003196b1bb528sm11666942wrw.64.2023.09.25.04.20.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 04:20:47 -0700 (PDT) Message-ID: <64707240a4eabde1e96446f9314e13248c35ed41.1695640837.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 25 Sep 2023 11:20:36 +0000 Subject: [PATCH v3 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 5e0c237dfd4..d21835ca65c 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 "t.unit-tests.${unit_test}" + COMMAND "./${unit_test}" + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/t/unit-tests) + endif() endforeach() #test-tool