From patchwork Fri Dec 13 10:41:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13906850 Received: from fhigh-b7-smtp.messagingengine.com (fhigh-b7-smtp.messagingengine.com [202.12.124.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F6301B415F for ; Fri, 13 Dec 2024 10:41:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.158 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734086497; cv=none; b=q+BENnKK2MvD2+C4r4Oq3VRdUpxOzNb+C96qkEhjQ/B22RI0KFbSZUH57jKUxwoa5mvOi13XYaiVwEXszRPUMrsAVbdlUUmiEacfQAoDru3w1XYGFLTeb3EbNNGjQgjUlEcO5391MF+QttZAFlFUZAUTi834bEZU2cj4oeh3Fy0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734086497; c=relaxed/simple; bh=KrDAZdCwVeWN39rSDZ/gUVt7Wx928VmE4ZVvBgyAMl8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=j2dYj42Kx+da32iQfXRGzx5rYOeJ/zHiKnhEql1k5ytgq0OGoJAtx39Z6z0YS5inLAD9YFM5WYkn/36KsULsOYXiA3jZz+xEpDwSPGVui+d13/ncQf/fhLmIHOGWOIEvT8ARIhicZYxD+4ppB9sMXxNCkrvh+oc4CeWBJZLdy+4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=qR/aRzWh; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=a6lxxLVl; arc=none smtp.client-ip=202.12.124.158 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="qR/aRzWh"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="a6lxxLVl" Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfhigh.stl.internal (Postfix) with ESMTP id 0139C2540113; Fri, 13 Dec 2024 05:41:34 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Fri, 13 Dec 2024 05:41:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1734086494; x=1734172894; bh=7ek473Fs/fmP3pcaWxjMjtFCAgpnaE9VUbgeqRtB8io=; b= qR/aRzWh6SCjhB/RmMp4GRb8g7xXRPTxnd4DagJc0MShj/oAzg8dTroB25PG49Qr Ok8PYdjcAyc8Ls99iu7Yw+h/ZRygpD4q3gdZp6nS3b4GgeM42fklry/ZlRG/QFrN 3cEBnsNYfrDOXllj/povWjsDSM+4h7If8UeGbfnMbMekNZV/AZTeTLfwKa8r4aCQ qupN3ukZAIb35qeITnkmgZovC3FShsDfo3imDK0pM33eevnWHTSdiXt4nwrSux94 26W0oaGeLhnP1LSpeZWqRkMtAo3wnuU7EKsksb2yLzvcfM3n5m0IwV42+YePr9Tz ulhuswIkeBaoaQexJbZonw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1734086494; x= 1734172894; bh=7ek473Fs/fmP3pcaWxjMjtFCAgpnaE9VUbgeqRtB8io=; b=a 6lxxLVlhrVrgehHbiDUp+69KYyphpwrV7kkNl6pU/1w0E96SSeEKxh76ykR6ppG8 S9mfpwtIPYfJ/iKyJ0wF4siV7Jl7ncdkR1hXD/sotlvPpGtUjbwxhu10mnjE87cw fu/IDAvd8s5jhNw/Q6bCkDDpT/eLiYTfosUe3mYePNZ+VR5f3IXlh7k2MQb0pEdi L/PKPzw7ym+NGOTV3uoAKkGIX8nGcH+OlqVHBoC+XC7wxIIbfJOdwPk32eO4BZGF ZVvRgrY7Hr5/1IodjwF4SdkwE61FuHCBTymNSrdVLLZOHNgjyngjBgq1sm+U/EH1 6E38g34dJomEsqXoq/8Vg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrkeejgddukecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredtjeen ucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimh eqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkeduheej teekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepfedpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtohepkhgrrhhthhhikhdrudekkeesghhmrghilhdrtghomh dprhgtphhtthhopehtohhonhesihhothgtlhdrtghomhdprhgtphhtthhopehgihhtsehv ghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 13 Dec 2024 05:41:33 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id a6c89d08 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 13 Dec 2024 10:39:53 +0000 (UTC) From: Patrick Steinhardt Date: Fri, 13 Dec 2024 11:41:16 +0100 Subject: [PATCH v2 1/8] ci/lib: support custom output directories when creating test artifacts Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241213-pks-meson-ci-v2-1-634affccc694@pks.im> References: <20241213-pks-meson-ci-v2-0-634affccc694@pks.im> In-Reply-To: <20241213-pks-meson-ci-v2-0-634affccc694@pks.im> To: git@vger.kernel.org Cc: karthik nayak , Toon Claes X-Mailer: b4 0.14.2 Update `create_failed_test_artifacts ()` so that it can handle arbitrary test output directories. This fixes creation of these artifacts for macOS on GitLab CI, which uses a separate output directory already. This will also be used by our out-of-tree builds with Meson. Signed-off-by: Patrick Steinhardt --- ci/lib.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ci/lib.sh b/ci/lib.sh index 930f98d7228166c37c236beb062b14675fb68ef3..2e7a5f0540b66f24bd0f5744311c2c48b472d63d 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -180,9 +180,9 @@ handle_failed_tests () { } create_failed_test_artifacts () { - mkdir -p t/failed-test-artifacts + mkdir -p "${TEST_OUTPUT_DIRECTORY:-t}"/failed-test-artifacts - for test_exit in t/test-results/*.exit + for test_exit in "${TEST_OUTPUT_DIRECTORY:-t}"/test-results/*.exit do test 0 != "$(cat "$test_exit")" || continue @@ -191,11 +191,11 @@ create_failed_test_artifacts () { printf "\\e[33m\\e[1m=== Failed test: ${test_name} ===\\e[m\\n" echo "The full logs are in the 'print test failures' step below." echo "See also the 'failed-tests-*' artifacts attached to this run." - cat "t/test-results/$test_name.markup" + cat "${TEST_OUTPUT_DIRECTORY:-t}/test-results/$test_name.markup" - trash_dir="t/trash directory.$test_name" - cp "t/test-results/$test_name.out" t/failed-test-artifacts/ - tar czf t/failed-test-artifacts/"$test_name".trash.tar.gz "$trash_dir" + trash_dir="${TEST_OUTPUT_DIRECTORY:-t}/trash directory.$test_name" + cp "${TEST_OUTPUT_DIRECTORY:-t}/test-results/$test_name.out" "${TEST_OUTPUT_DIRECTORY:-t}"/failed-test-artifacts/ + tar czf "${TEST_OUTPUT_DIRECTORY:-t}/failed-test-artifacts/$test_name.trash.tar.gz" "$trash_dir" done } From patchwork Fri Dec 13 10:41:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13906851 Received: from fout-b6-smtp.messagingengine.com (fout-b6-smtp.messagingengine.com [202.12.124.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4F4481BB6B8 for ; Fri, 13 Dec 2024 10:41:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.149 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734086498; cv=none; b=Av5TBprlb06xZukrVpowPEzurD7NcICt4kEMFABOucZGi2wiKmqoXQJ0dBoJhv4V0Tu2id3blwWBsnBoEf4iwJfzDPTn11T16ggqX+HDTz+Cna2pDuSUBkHojcUy/4iRM7sklhTBpIDQDB5UhqdXWp4RvU5yHdoxMhGSfTUWyqI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734086498; c=relaxed/simple; bh=2bmg5NkD1ixBASsbLLpKnmCcxrwiERIr44CDFLV9U80=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MZXi0nFifs9Z3p50HFpO4fBa7xyHucXZm/dSUSnwFP6uVBNPblPkdcpwH6SxFpJXVEVm4aRJV82kJZ2aoUZxQ1Zq6+OAgXfP4Cbvkc695Ew569UKPKLEr0BfdDnfoD/p6dK9Z9YktFH9IS2rYLYy/ENSc76d9n8eorma1+qANyg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=nT/MXn8p; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=scmXgsPP; arc=none smtp.client-ip=202.12.124.149 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="nT/MXn8p"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="scmXgsPP" Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfout.stl.internal (Postfix) with ESMTP id 61AAF11401EC; Fri, 13 Dec 2024 05:41:36 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Fri, 13 Dec 2024 05:41:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1734086496; x=1734172896; bh=yvMLNkt/JLszeH+3M5ZItNzbBp4Kbu1DLgpAavvqj3I=; b= nT/MXn8p+rsLMOGCPXAp4iVX0EiOFkTOMSW4ZZvPplB4OC0I8MdMSKbn8NCWIDxR 1aVsJDFjPWxP3xtnprj6UKP+gcZaZX+TZBHITgJDdffYJPhg527o6NkmxBLeUJ0O sRjjqwhvkxK7RostTWOp9viz238o++tNTZmdqEmjhIU6fzeuzjutuSSpx4iyMiOq A0c4fipRCE4w3jE7JW/Lct+D0MFkLa0nG3I8zoiUcqmuf5gpEh3cXsPkDcrU32PA X6KGpmuKenpaxyjdc38PNhlbJFc0G/TTxX0VOXKVKt0lAFcdcRlikkUa+MnQCyE6 EGrsGdQzNGPTuQ5Qk/nY7Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1734086496; x= 1734172896; bh=yvMLNkt/JLszeH+3M5ZItNzbBp4Kbu1DLgpAavvqj3I=; b=s cmXgsPP07gb1wiwOloTwZ2i6NBY6ilKPt37QUoNk7NgRQcuhu7cGgM0YfSjT736/ 0vqGLnEF3gWfDFPcWsQOpQXqzOweivkjrdDkzNtt+QixKfRT5KcGlfao+iDTr6ZH hCu/iyU+2YvhtUvkOWEiJnbWz8D6u2qqQkruzaSVYLf4hqbUa47vj/c/2VJ/8Tre rsJEiS9f27+NV0rFPq00aMLrxtQr5TkOQ1h5uSAVNKAIgiULY3azB/U8/tNWF5+F eyOwyLxbHyngtrM1MExU0gI10jaaqT4TX5/ledRyweNlfMWFf8ryu09r5NGSkdvc Z1O/RCrCVFb5nfiUpc8Cw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrkeejgddukecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredtjeen ucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimh eqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkeduheej teekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepfedpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtohepkhgrrhhthhhikhdrudekkeesghhmrghilhdrtghomh dprhgtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohep thhoohhnsehiohhttghlrdgtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 13 Dec 2024 05:41:35 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 37f3ec84 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 13 Dec 2024 10:39:54 +0000 (UTC) From: Patrick Steinhardt Date: Fri, 13 Dec 2024 11:41:17 +0100 Subject: [PATCH v2 2/8] Makefile: drop -DSUPPRESS_ANNOTATED_LEAKS Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241213-pks-meson-ci-v2-2-634affccc694@pks.im> References: <20241213-pks-meson-ci-v2-0-634affccc694@pks.im> In-Reply-To: <20241213-pks-meson-ci-v2-0-634affccc694@pks.im> To: git@vger.kernel.org Cc: karthik nayak , Toon Claes X-Mailer: b4 0.14.2 The -DSUPPRESS_ANNOTATED_LEAKS preprocessor directive was used to enable our `UNLEAK()` macro in the past, which marks memory as still-reachable so that the leak sanitizer does not complain. Starting with 52c7dbd036 (git-compat-util: drop now-unused `UNLEAK()` macro, 2024-11-20) this macro has been removed, and thus the preprocessor directive is not required anymore, either. Drop it. Signed-off-by: Patrick Steinhardt --- Makefile | 1 - meson.build | 1 - 2 files changed, 2 deletions(-) diff --git a/Makefile b/Makefile index 06f01149ecf399ae4bb1932188a007948d767283..2506f3b7e3377ab1a376338c86a727b2ae92a6e9 100644 --- a/Makefile +++ b/Makefile @@ -1490,7 +1490,6 @@ ifneq ($(filter undefined,$(SANITIZERS)),) BASIC_CFLAGS += -DSHA1DC_FORCE_ALIGNED_ACCESS endif ifneq ($(filter leak,$(SANITIZERS)),) -BASIC_CFLAGS += -DSUPPRESS_ANNOTATED_LEAKS BASIC_CFLAGS += -O0 SANITIZE_LEAK = YesCompiledWithIt endif diff --git a/meson.build b/meson.build index 0dccebcdf16b07650d943e53643f0e09e2975cc9..1af25af5cc1e718a4e50fb14274a36f811506219 100644 --- a/meson.build +++ b/meson.build @@ -712,7 +712,6 @@ else build_options_config.set('SANITIZE_ADDRESS', '') endif if get_option('b_sanitize').contains('leak') - libgit_c_args += '-DSUPPRESS_ANNOTATED_LEAKS' build_options_config.set('SANITIZE_LEAK', 'YesCompiledWithIt') else build_options_config.set('SANITIZE_LEAK', '') From patchwork Fri Dec 13 10:41:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13906852 Received: from fout-b6-smtp.messagingengine.com (fout-b6-smtp.messagingengine.com [202.12.124.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C31B61C1AA9 for ; Fri, 13 Dec 2024 10:41:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.149 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734086500; cv=none; b=VCbdOt3BMjbAxUNCjxaLCH6/UrE97gnjVj8OjWk7rjRp1Vige9qMCddexHXxEfMLwTiJATjrIeOm6LBZ5AMre55jqs7p63UIIlrlneAWwDfpDX6COQa8nt9hsSQJD9KEHimE9Q9Alh3htQLzRLNFyYNXGz/NIx6GG9UyvopsHQI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734086500; c=relaxed/simple; bh=JfQN+apR2upH93Pj7iBvgAxUVYpRBmqNod0Ij2qbapk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nULwA504Vkp/7UGOFHBVTfzVZpPiPcRINz/BfLHW/Xid1EEUCAEhajrzJuK5H1z7vdHa8CuY6TLB6pz+DsqkDnlQPJNQUKjd6pi67OES+K2+TWs0MXVv63URoM5B8MMhQqaqcl7X6ma9T4w4gK4KyMZXPD9ikNbrpxslk1hlZWE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=Uuxb6rLn; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=NM1J8cEJ; arc=none smtp.client-ip=202.12.124.149 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="Uuxb6rLn"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="NM1J8cEJ" Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfout.stl.internal (Postfix) with ESMTP id DB92311401E7; Fri, 13 Dec 2024 05:41:37 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Fri, 13 Dec 2024 05:41:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1734086497; x=1734172897; bh=+kVRtqQRDJ0/6fFfpQp8mD3oEkcGjWe2OMWDwqGCd84=; b= Uuxb6rLnzLtzTssqtKq/bQ8xXvENXFsNFiLuP1aszKZrpuOnUqHhauJEwUKq+j/s A6ofTnFGkzXOXmVIZEpi/VI2/ZjDfIP+z5IOqzAUTi+4J7WB3U8iJb9hJjzANhz8 PJhB5DEkerIFFSAx/XCPATME2slpj8JNfmNeOGqxRVJE3prLOsUTZSdYTzLBiOj5 hVWDCjEKu+sieTQ4DvoF9+VUDrAF7kD98IpueetOo0tsKTB1E4Ntth+NPP70vvyM QWF+10c8jYd0lPiLAiLo7RF8/E8RR6NvYVr9myi89QyMmzlhoGPutDjACHJc84YY B8uySG9hjJjmq2M67Y6okw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1734086497; x= 1734172897; bh=+kVRtqQRDJ0/6fFfpQp8mD3oEkcGjWe2OMWDwqGCd84=; b=N M1J8cEJ+LwE0jlIJd2KaIUq6lbvBcAD/3+32pbiFwthkl6p5CnOi9dQ5qykDv0GP lobUGnzbce+M8vbx5ISMho1zJP6k+FFMkHgWed/QZFg3omhUvWB4xSbtSlTUuIXe +i6e9wHELtQIQwm/6iffLCVxGrZXwzWqtnl4grsCFo0elW6LEc1JjZaJ0heC0+7A Wzqk5m0JiuFDwK2y4tgzsQvKFej217FSiTED802gEwFDqpMYhdNFmSwi6FF4mgbW 5YFUrqM2vOJaklNxkqvAYbARnPVoZ2xiPhy/L5oPKuagBwkEXw+BAO5fcgdNY8Xm WuNS7rJb9XwRgtaUBlUVA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrkeejgddukecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredtjeen ucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimh eqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkeduheej teekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepfedpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtohepthhoohhnsehiohhttghlrdgtohhmpdhrtghpthhtoh epghhithesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehkrghrthhhihhk rddukeeksehgmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 13 Dec 2024 05:41:36 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id a17deec2 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 13 Dec 2024 10:39:55 +0000 (UTC) From: Patrick Steinhardt Date: Fri, 13 Dec 2024 11:41:18 +0100 Subject: [PATCH v2 3/8] t/unit-tests: rename clar-based unit tests to have a common prefix Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241213-pks-meson-ci-v2-3-634affccc694@pks.im> References: <20241213-pks-meson-ci-v2-0-634affccc694@pks.im> In-Reply-To: <20241213-pks-meson-ci-v2-0-634affccc694@pks.im> To: git@vger.kernel.org Cc: karthik nayak , Toon Claes X-Mailer: b4 0.14.2 All of the code files for unit tests using the self-grown unit testing framework have a "t-" prefix to their name. This makes it easy to identify them and use globbing in our Makefile and in other places. On the other hand though, our clar-based unit tests have no prefix at all and thus cannot easily be discerned from other files in the unit test directory. Introduce a new "u-" prefix for clar-based unit tests. This prefix will be used in a subsequent commit to easily identify such tests. Signed-off-by: Patrick Steinhardt --- Makefile | 4 ++-- t/meson.build | 4 ++-- t/unit-tests/generate-clar-decls.sh | 5 ++++- t/unit-tests/{ctype.c => u-ctype.c} | 0 t/unit-tests/{strvec.c => u-strvec.c} | 0 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 2506f3b7e3377ab1a376338c86a727b2ae92a6e9..6eafaf174aaa380ad8e6a86f75d003eb6c058fb3 100644 --- a/Makefile +++ b/Makefile @@ -1344,8 +1344,8 @@ THIRD_PARTY_SOURCES += sha1dc/% THIRD_PARTY_SOURCES += $(UNIT_TEST_DIR)/clar/% THIRD_PARTY_SOURCES += $(UNIT_TEST_DIR)/clar/clar/% -CLAR_TEST_SUITES += ctype -CLAR_TEST_SUITES += strvec +CLAR_TEST_SUITES += u-ctype +CLAR_TEST_SUITES += u-strvec CLAR_TEST_PROG = $(UNIT_TEST_BIN)/unit-tests$(X) CLAR_TEST_OBJS = $(patsubst %,$(UNIT_TEST_DIR)/%.o,$(CLAR_TEST_SUITES)) CLAR_TEST_OBJS += $(UNIT_TEST_DIR)/clar/clar.o diff --git a/t/meson.build b/t/meson.build index 13fe854ba0a18f9b83dbc48651f581198042ffd3..9e676e69363ed6311426500d98fe281e30d26bcb 100644 --- a/t/meson.build +++ b/t/meson.build @@ -1,6 +1,6 @@ clar_test_suites = [ - 'unit-tests/ctype.c', - 'unit-tests/strvec.c', + 'unit-tests/u-ctype.c', + 'unit-tests/u-strvec.c', ] clar_sources = [ diff --git a/t/unit-tests/generate-clar-decls.sh b/t/unit-tests/generate-clar-decls.sh index 688e0885f4f28182c3afe19c067b6d59dcacccfc..3b315c64b3711bfccc5941852a0782e02cee82f0 100755 --- a/t/unit-tests/generate-clar-decls.sh +++ b/t/unit-tests/generate-clar-decls.sh @@ -11,6 +11,9 @@ shift for suite in "$@" do - sed -ne "s/^\(void test_$(basename "${suite%.c}")__[a-zA-Z_0-9][a-zA-Z_0-9]*(void)\)$/extern \1;/p" "$suite" || + suite_name=$(basename "$suite") + suite_name=${suite_name%.c} + suite_name=${suite_name#u-} + sed -ne "s/^\(void test_${suite_name}__[a-zA-Z_0-9][a-zA-Z_0-9]*(void)\)$/extern \1;/p" "$suite" || exit 1 done >"$OUTPUT" diff --git a/t/unit-tests/ctype.c b/t/unit-tests/u-ctype.c similarity index 100% rename from t/unit-tests/ctype.c rename to t/unit-tests/u-ctype.c diff --git a/t/unit-tests/strvec.c b/t/unit-tests/u-strvec.c similarity index 100% rename from t/unit-tests/strvec.c rename to t/unit-tests/u-strvec.c From patchwork Fri Dec 13 10:41:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13906853 Received: from fhigh-b7-smtp.messagingengine.com (fhigh-b7-smtp.messagingengine.com [202.12.124.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D2D81C3BEE for ; Fri, 13 Dec 2024 10:41:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.158 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734086501; cv=none; b=jOQWlhrEn3vx1ACx5MPR8RuCSGhaEzUhzJPSZtiKoNpTVdbjeYnPx5kgMY8EGp/hFUBL+ZBUMOhuakUZuGR6UdHd6iJtLkWc+uQgQ0vBeRk+WQ09khCM2NFYEhm1P+8hOOciejrUtzmqeTR1s/UVzzwaHbJFtwCXqyHcmeRbqFI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734086501; c=relaxed/simple; bh=KOUC7fhPHQgcCZtFz0bOOvhhbGmqWBFtXGhYv002YcI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Jt9rJ06+Q4dsX2d37LebxeVcnXMockMa0d8FCndMqrzL7G/cmh0AarOgHyBYr8GQPiUYdX42E+ppSviqv5e2wEogMWO/kOoZD+AJWpkx2wBRi/8rgqJ3eKD0o6xzQEQ/Y54Vh4sHaYVw3usprxmeRLROjsuU5hct5bBRrj5q+Cc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=QXjtEj90; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Lpgtnqa9; arc=none smtp.client-ip=202.12.124.158 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="QXjtEj90"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Lpgtnqa9" Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfhigh.stl.internal (Postfix) with ESMTP id 69B3D254012D; Fri, 13 Dec 2024 05:41:39 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-09.internal (MEProxy); Fri, 13 Dec 2024 05:41:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1734086499; x=1734172899; bh=HHGoKoUlaA1DCr1psJdTZ6LJQzlNbz4dcfCxp9vZ4BQ=; b= QXjtEj90HUpD6kbSbD8FC66R/Co1mXWW/6JaEW5lSrKPfHb1/2/XdxVYSnXSK79M yixeNp0odXXWpNjJraeSRNJ3HrJkqoGIBCuqdu0grayRfHZnakRYvclfp2gfo1Sw r1zcbiyP8paWLG1jGfFEGKrSl2lc9cQoTqy18EIScAIIIH75vu4/ghrudApe7RVy i+tdTpyApO8kf4JjMmtN9sNEuEyH+w61zE3CtmzDXXx91520OheWd0I9Keqvmz1b TgH87GGTjwteJ7qEVSNPpsgkoqFr6Kzj0ihk0zPCLMlHgd0LEU85QrEDNz6bEgW1 x/KlRl+Wlw7fCFOmcFbTCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1734086499; x= 1734172899; bh=HHGoKoUlaA1DCr1psJdTZ6LJQzlNbz4dcfCxp9vZ4BQ=; b=L pgtnqa9xFhDeDVd6nexvrSv93P4EdMFzxeSY90KtuHbpf2AxBXX5RBLdjz62/EPU 2M/x22kU5W/IidMJqN9z/ziPeJNVcJxhV6k8btLb4CLyAZZ+HGXQxQcknsOc2r6w DiEeXBpZfCPiYjNvFcpHSYBXgTpd82bki/kBJcMgThUgDj2EcdGkx+/WOgK1v/a8 rtfPc3a5ZtEF7u9BSSXHLww7bPrfqPc4VnfJEaSAnLnj+spW1egyb4GKPMykJSCK kOCUnc7gFE2WfE1YzUbVU14jd9Zh8VjLrw0C3TL6gi/hbaG3b24JvZU8JIb5nRbD gkCbVKJuKyVycl4wtkKrA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrkeejgddulecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredtjeen ucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimh eqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkeduheej teekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepfedpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtohepghhithesvhhgvghrrdhkvghrnhgvlhdrohhrghdprh gtphhtthhopehtohhonhesihhothgtlhdrtghomhdprhgtphhtthhopehkrghrthhhihhk rddukeeksehgmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 13 Dec 2024 05:41:38 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id eb26f2ea (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 13 Dec 2024 10:39:56 +0000 (UTC) From: Patrick Steinhardt Date: Fri, 13 Dec 2024 11:41:19 +0100 Subject: [PATCH v2 4/8] meson: detect missing tests at configure time Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241213-pks-meson-ci-v2-4-634affccc694@pks.im> References: <20241213-pks-meson-ci-v2-0-634affccc694@pks.im> In-Reply-To: <20241213-pks-meson-ci-v2-0-634affccc694@pks.im> To: git@vger.kernel.org Cc: karthik nayak , Toon Claes X-Mailer: b4 0.14.2 It is quite easy for the list of integration tests to go out-of-sync without anybody noticing. Introduce a new configure-time check that verifies that all tests are wired up properly. Signed-off-by: Patrick Steinhardt --- t/meson.build | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/t/meson.build b/t/meson.build index 9e676e69363ed6311426500d98fe281e30d26bcb..602ebfe6a260211eb2083e5808058852ca86e7a0 100644 --- a/t/meson.build +++ b/t/meson.build @@ -1092,6 +1092,42 @@ integration_tests = [ 't9903-bash-prompt.sh', ] +# Sanity check that we are not missing any tests present in 't/'. This check +# only runs once at configure time and is thus best-effort, only. It is +# sufficient to catch missing test suites in our CI though. +foreach glob, tests : { + 't[0-9][0-9][0-9][0-9]-*.sh': integration_tests, + 'unit-tests/t-*.c': unit_test_programs, + 'unit-tests/u-*.c': clar_test_suites, +} + actual_tests = run_command(shell, '-c', 'ls ' + glob, + check: true, + env: script_environment, + ).stdout().strip().split('\n') + + if tests != actual_tests + missing_tests = [ ] + foreach actual_test : actual_tests + if actual_test not in tests + missing_tests += actual_test + endif + endforeach + if missing_tests.length() > 0 + error('Test files found, but not configured:\n\n - ' + '\n - '.join(missing_tests)) + endif + + superfluous_tests = [ ] + foreach integration_test : tests + if integration_test not in actual_tests + superfluous_tests += integration_test + endif + endforeach + if superfluous_tests.length() > 0 + error('Test files configured, but not found:\n\n - ' + '\n - '.join(superfluous_tests)) + endif + endif +endforeach + # GIT_BUILD_DIR needs to be Unix-style without drive prefixes as it get added # to the PATH variable. And given that drive prefixes contain a colon we'd # otherwise end up with a broken PATH if we didn't convert it. From patchwork Fri Dec 13 10:41:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13906854 Received: from fhigh-b7-smtp.messagingengine.com (fhigh-b7-smtp.messagingengine.com [202.12.124.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 282DA1C3C0D for ; Fri, 13 Dec 2024 10:41:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.158 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734086504; cv=none; b=RtseRreY7l2yMZPiXMcoHuRhba0qiAk6HvjnYzwQVPgLbsaCHhnc6mxYYgJnPmVv7mICLqAs67Z06DcmaxJSMJDoM3hk4llOX2ISqe1Bf+rSHQsqeWka8/NO1CnoYshYmQIUHXmJHJ67YdMbYz8Jt3Z4xQORJs6kRmrB9JCxtK4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734086504; c=relaxed/simple; bh=atjj90Rhux641+xOnSs3M8yiqvXM7oc/9Fec4RUIS/E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=q14jp/fYoJKgLWsMcEWjzJbAHiOS53gpVAjhsHIZ6VUz2nIPeZsHHj1fyr4i0nXG9NI4iAmV69PNvEHEj2Va+/6+SlkYs6ZBPUbRvXulG27j/3PTxUMydL5JGT6b16Sh9ym7QWWze41JRS1qeMCncjRIXnKieLpeF2xpR1x8jnw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=SKi0JgEt; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Vuk8buuH; arc=none smtp.client-ip=202.12.124.158 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="SKi0JgEt"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Vuk8buuH" Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfhigh.stl.internal (Postfix) with ESMTP id E0F6F2540131; Fri, 13 Dec 2024 05:41:40 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Fri, 13 Dec 2024 05:41:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1734086500; x=1734172900; bh=aCAdCno6eatn93mkrN3OeSCeuMcXNxumFw8afk7n6tU=; b= SKi0JgEtglAM9drI6xplCbaey0vA74ncbCQDeo/c6R5PR999Gm0ZVXyXm/YPK6b3 8tb1xaVl+hRk64orw4g5hA4oszIqJ+tBTucnLx0S48NeWA5f5bP2V2wKLHgRyTE5 eY8XwyDk3Osq3B+NaFWwXc4gb3ucJ2ouRFd4bEAB3s6OrJW2gkW6BR+5FwiE8x2N Ubqlk2ibIp/TAHXcAtvcheOfthZRaJzNMxptc+4QK1kA06c2VsiT6H6jDgRHkF16 0uUnnA1FQ/xo18cU8nLvSWoKZxv7d5LKLZxxQKsVYzsa+0xVSYEYT1kIgstZ4Zu4 ezRP4hmW5SZK36TJCBwJXg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1734086500; x= 1734172900; bh=aCAdCno6eatn93mkrN3OeSCeuMcXNxumFw8afk7n6tU=; b=V uk8buuHwLu6I1cPF2ypZaP/yIHrVxnsRYjoxZa+k2i5wm2tWRaFO/iCfd0kSI4F8 DShN74SuU8aaYn9UyQjuJtsRDn9y/XA7IBGbQz6vkItq9YUPtX/r8AkLPVD6CKHf 7wKqtrcyb5JMfLwUFisYqHof2RaOW+h1EeBSc6RfrSgcX7t73ejdWuQJMslmiJ+8 OkobXe+Z6Mkl/juttpP7ch2xtcs4FFSPaqrG3kiaWQbCOnaieuR9Mz5Kmwp82SFp w2CPtoyxbRwUWhV3wTWnoPFfHYPj7QZwr8cfDDcUnfyLzA4mu7SKc8i5XHT7Y8gP BsKV5V2jsF6PHuJHscdJg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrkeejgddukecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredtjeen ucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimh eqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkeduheej teekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrg hilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepfedpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtohepkhgrrhhthhhikhdrudekkeesghhmrghilhdrtghomh dprhgtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohep thhoohhnsehiohhttghlrdgtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 13 Dec 2024 05:41:39 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id abf30361 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 13 Dec 2024 10:39:57 +0000 (UTC) From: Patrick Steinhardt Date: Fri, 13 Dec 2024 11:41:20 +0100 Subject: [PATCH v2 5/8] Makefile: detect missing Meson tests Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241213-pks-meson-ci-v2-5-634affccc694@pks.im> References: <20241213-pks-meson-ci-v2-0-634affccc694@pks.im> In-Reply-To: <20241213-pks-meson-ci-v2-0-634affccc694@pks.im> To: git@vger.kernel.org Cc: karthik nayak , Toon Claes X-Mailer: b4 0.14.2 In the preceding commit, we have introduced consistency checks to Meson to detect any discrepancies with missing or extraneous tests in its build instructions. These checks only get executed in Meson though, so any users of our Makefiles wouldn't be alerted of the fact that they have to modify the Meson build instructions in case they add or remove any tests. Add a comparable test target to our Makefile to plug this gap. Signed-off-by: Patrick Steinhardt --- t/Makefile | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/t/Makefile b/t/Makefile index 131ffd778fe00864fae1f5750269615556c6cdea..290fb03ff011d39c31c5073c796aa6f4dc966283 100644 --- a/t/Makefile +++ b/t/Makefile @@ -59,7 +59,7 @@ CHAINLINTSUPPRESS = GIT_TEST_EXT_CHAIN_LINT=0 && export GIT_TEST_EXT_CHAIN_LINT all:: $(DEFAULT_TEST_TARGET) -test: pre-clean check-chainlint $(TEST_LINT) +test: pre-clean check-chainlint check-meson $(TEST_LINT) $(CHAINLINTSUPPRESS) $(MAKE) aggregate-results-and-cleanup failed: @@ -114,6 +114,22 @@ check-chainlint: { $(CHAINLINT) --emit-all '$(CHAINLINTTMP_SQ)'/tests >'$(CHAINLINTTMP_SQ)'/actual || true; } && \ diff -u '$(CHAINLINTTMP_SQ)'/expect '$(CHAINLINTTMP_SQ)'/actual +check-meson: + @# awk acts up when trying to match single quotes, so we use \047 instead. + @printf "%s\n" \ + "integration_tests t[0-9][0-9][0-9][0-9]-*.sh" \ + "unit_test_programs unit-tests/t-*.c" \ + "clar_test_suites unit-tests/u-*.c" | \ + while read -r variable pattern; do \ + meson_tests=$$(awk "/^$$variable = \[\$$/ {flag=1 ; next } /^]$$/ { flag=0 } flag { gsub(/^ \047/, \"\"); gsub(/\047,\$$/, \"\"); print }" meson.build) && \ + actual_tests=$$(ls $$pattern) && \ + if test "$$meson_tests" != "$$actual_tests"; then \ + echo "Meson tests differ from actual tests:"; \ + diff -u <(echo "$$meson_tests") <(echo "$$actual_tests"); \ + exit 1; \ + fi; \ + done + test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax \ test-lint-filenames ifneq ($(GIT_TEST_CHAIN_LINT),0) From patchwork Fri Dec 13 10:41:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13906855 Received: from fout-b6-smtp.messagingengine.com (fout-b6-smtp.messagingengine.com [202.12.124.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 346D41C3C10 for ; Fri, 13 Dec 2024 10:41:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.149 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734086505; cv=none; b=k3SprOt/YROx4qb1h3wvY/W9+Ax3sHaJm12Yu2yPiBfY8dqFevx5tyl67AiK95R1zg/9MOUXDgK/NymyqGy9xbqIx7qTsn9JAfVsC8M0Ifn0dr9Ir9QxEdv2aV+uoe/pia/BIaLqeCqDDfTS/tog34np+SrhaVjQUaocbaCJK3Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734086505; c=relaxed/simple; bh=W16MNM5afe7/zTN7GaQ2ggQiF3MXsT44PyT4lEN6vRA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XYczY2t5lyQCGTNVnEt4siJj2wcP1fm6iliVIUaQE/2S7j5oWTcLVjx87Bgw0K8sfRhw5s/lIxdQzHzfQi6l8wKz99Obrdjqdw2PBaNCDwvg9wSqBi1N94zcY3q6XUWKz3/079US3OSSao99ro/M7TbvsIUSjaOS/hTzrGwRRGg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=w0hfPjht; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=lgSIgWzu; arc=none smtp.client-ip=202.12.124.149 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="w0hfPjht"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="lgSIgWzu" Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfout.stl.internal (Postfix) with ESMTP id 4DE0611401E2; Fri, 13 Dec 2024 05:41:42 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Fri, 13 Dec 2024 05:41:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1734086502; x=1734172902; bh=tyOpExDIk4uqeEC7bqZtX4Z27RZXqTQ5aB0l6+zdnGw=; b= w0hfPjhtSyXpXXHnLFumv65eGcKIZIQ2FuxvmhVmPpamFgAjf5oePWbGkXwHfqRy FmX3IciJm5MPy12feCF8w2esDTNnp3bLtqrU+UE2HvlCzycpK+70QlTooVX3YfnE qnfdc7VWLNehVtvda2h2kP+/NxcMR4cc1vPD8sQ6NYA6qSpn8zhinX2RH0R8RQv8 vyQLoFmrVFRRITfzLQWgz5xLhJg0gxzq496A1xsGmOj+VkVM7Ht8CUHoyHkgsvMD Zk9DvL0HgUdUfYKOGJxFRhsVSFc7Iu2toqEjSoKNJMsPlqy7K5fi6KlZOUVg9cjp 0NLrjJyBApZgZJyH0Akz+A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1734086502; x= 1734172902; bh=tyOpExDIk4uqeEC7bqZtX4Z27RZXqTQ5aB0l6+zdnGw=; b=l gSIgWzuoTPPGuadOcni7Y/dDRHdn4x8rnkqwXj5TPFg7MFC/52VMdX/21Rjb9zhU 4B/LTJwS568qMwkOR8QSpIMQ+P5NpYmfnP3ePfojIuDLrwgu339jx0mV33UGGYk8 9dPp1b5/my6yms7iR+paSs3OiaLv5JApnpL3yV1z5LaApNhdGytddz9mpjYaI7e3 2wIXdeMqFjznu/NJvVN9GQLN31TIhYtMHkSLDBjOcW9ailq5m3dTceRrUrAQlC6U duT4EWv4u6NcvqZIBW+G0Sl7Nk2FBpMhwGzQsxcJINZW/euDmWxa3wn6/Yy9ZaeR vDCbZjUx/TAalHgGQ8G+Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrkeejgddulecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthekredtredtjeen ucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimh eqnecuggftrfgrthhtvghrnhepfefhueegleehfeejkedtffehvdfhvdetfefgtdduffdu veevteegueeutdekhfegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepfedpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtohepghhithesvhhgvghrrdhkvghrnhgvlhdrohhrghdprh gtphhtthhopehtohhonhesihhothgtlhdrtghomhdprhgtphhtthhopehkrghrthhhihhk rddukeeksehgmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 13 Dec 2024 05:41:41 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 884f9568 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 13 Dec 2024 10:39:57 +0000 (UTC) From: Patrick Steinhardt Date: Fri, 13 Dec 2024 11:41:21 +0100 Subject: [PATCH v2 6/8] t: fix out-of-tree tests for some git-p4 tests Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241213-pks-meson-ci-v2-6-634affccc694@pks.im> References: <20241213-pks-meson-ci-v2-0-634affccc694@pks.im> In-Reply-To: <20241213-pks-meson-ci-v2-0-634affccc694@pks.im> To: git@vger.kernel.org Cc: karthik nayak , Toon Claes X-Mailer: b4 0.14.2 Both t9835 and t9836 exercise git-p4, but one exercises Python 2 whereas the other one uses Python 3. These tests do not exercise "git p4", but instead they use "git p4.py". This calls the unbuilt version of "git-p4.py" that still has the "#!/usr/bin/env python" shebang, which allows the test to modify which Python version comes first in $PATH, making it possible to force a Python version. But "git-p4.py" is not in our PATH during out-of-tree builds, and thus we cannot locate "git-p4.py". The tests thus break with CMake and Meson. Fix this by instead manually setting up script wrappers that invoke the respective Python interpreter directly. Signed-off-by: Patrick Steinhardt --- t/t9835-git-p4-metadata-encoding-python2.sh | 50 ++++++++++++++--------------- t/t9836-git-p4-metadata-encoding-python3.sh | 50 ++++++++++++++--------------- 2 files changed, 50 insertions(+), 50 deletions(-) diff --git a/t/t9835-git-p4-metadata-encoding-python2.sh b/t/t9835-git-p4-metadata-encoding-python2.sh index 036bf79c6674f6f1f0d667c7270674168428ffee..6116f806f631157aca7de6dbd33dcd94bbefb8aa 100755 --- a/t/t9835-git-p4-metadata-encoding-python2.sh +++ b/t/t9835-git-p4-metadata-encoding-python2.sh @@ -8,29 +8,29 @@ failing, and produces maximally sane output in git.' . ./lib-git-p4.sh -python_target_version='2' - ############################### ## SECTION REPEATED IN t9836 ## ############################### -# Please note: this test calls "git-p4.py" rather than "git-p4", because the -# latter references a specific path so we can't easily force it to run under -# the python version we need to. - -python_major_version=$(python -V 2>&1 | cut -c 8) -python_target_binary=$(which python$python_target_version) -if ! test "$python_major_version" = "$python_target_version" && test "$python_target_binary" +# These tests are specific to Python 2. Write a custom script that executes +# git-p4 directly with the Python 2 interpreter to ensure that we use that +# version even if Git was compiled with Python 3. +python_target_binary=$(which python2) +if test -n "$python_target_binary" then mkdir temp_python - PATH="$(pwd)/temp_python:$PATH" && export PATH - ln -s $python_target_binary temp_python/python + PATH="$(pwd)/temp_python:$PATH" + export PATH + + write_script temp_python/git-p4-python2 <<-EOF + exec "$python_target_binary" "$(git --exec-path)/git-p4" "\$@" + EOF fi -python_major_version=$(python -V 2>&1 | cut -c 8) -if ! test "$python_major_version" = "$python_target_version" +git p4-python2 >err +if ! grep 'valid commands' err then - skip_all="skipping python$python_target_version-specific git p4 tests; python$python_target_version not available" + skip_all="skipping python2 git p4 tests; python2 not available" test_done fi @@ -81,14 +81,14 @@ test_expect_success 'init depot' ' test_expect_success 'clone non-utf8 repo with strict encoding' ' test_when_finished cleanup_git && test_when_finished remove_user_cache && - test_must_fail git -c git-p4.metadataDecodingStrategy=strict p4.py clone --dest="$git" //depot@all 2>err && + test_must_fail git -c git-p4.metadataDecodingStrategy=strict p4-python2 clone --dest="$git" //depot@all 2>err && grep "Decoding perforce metadata failed!" err ' test_expect_success 'check utf-8 contents with passthrough strategy' ' test_when_finished cleanup_git && test_when_finished remove_user_cache && - git -c git-p4.metadataDecodingStrategy=passthrough p4.py clone --dest="$git" //depot@all && + git -c git-p4.metadataDecodingStrategy=passthrough p4-python2 clone --dest="$git" //depot@all && ( cd "$git" && git log >actual && @@ -100,7 +100,7 @@ test_expect_success 'check utf-8 contents with passthrough strategy' ' test_expect_success 'check latin-1 contents corrupted in git with passthrough strategy' ' test_when_finished cleanup_git && test_when_finished remove_user_cache && - git -c git-p4.metadataDecodingStrategy=passthrough p4.py clone --dest="$git" //depot@all && + git -c git-p4.metadataDecodingStrategy=passthrough p4-python2 clone --dest="$git" //depot@all && ( cd "$git" && git log >actual && @@ -114,7 +114,7 @@ test_expect_success 'check latin-1 contents corrupted in git with passthrough st test_expect_success 'check utf-8 contents with fallback strategy' ' test_when_finished cleanup_git && test_when_finished remove_user_cache && - git -c git-p4.metadataDecodingStrategy=fallback p4.py clone --dest="$git" //depot@all && + git -c git-p4.metadataDecodingStrategy=fallback p4-python2 clone --dest="$git" //depot@all && ( cd "$git" && git log >actual && @@ -126,7 +126,7 @@ test_expect_success 'check utf-8 contents with fallback strategy' ' test_expect_success 'check latin-1 contents with fallback strategy' ' test_when_finished cleanup_git && test_when_finished remove_user_cache && - git -c git-p4.metadataDecodingStrategy=fallback p4.py clone --dest="$git" //depot@all && + git -c git-p4.metadataDecodingStrategy=fallback p4-python2 clone --dest="$git" //depot@all && ( cd "$git" && git log >actual && @@ -138,7 +138,7 @@ test_expect_success 'check latin-1 contents with fallback strategy' ' test_expect_success 'check cp-1252 contents with fallback strategy' ' test_when_finished cleanup_git && test_when_finished remove_user_cache && - git -c git-p4.metadataDecodingStrategy=fallback p4.py clone --dest="$git" //depot@all && + git -c git-p4.metadataDecodingStrategy=fallback p4-python2 clone --dest="$git" //depot@all && ( cd "$git" && git log >actual && @@ -150,7 +150,7 @@ test_expect_success 'check cp-1252 contents with fallback strategy' ' test_expect_success 'check cp850 contents parsed with correct fallback' ' test_when_finished cleanup_git && test_when_finished remove_user_cache && - git -c git-p4.metadataDecodingStrategy=fallback -c git-p4.metadataFallbackEncoding=cp850 p4.py clone --dest="$git" //depot@all && + git -c git-p4.metadataDecodingStrategy=fallback -c git-p4.metadataFallbackEncoding=cp850 p4-python2 clone --dest="$git" //depot@all && ( cd "$git" && git log >actual && @@ -162,7 +162,7 @@ test_expect_success 'check cp850 contents parsed with correct fallback' ' test_expect_success 'check cp850-only contents escaped when cp1252 is fallback' ' test_when_finished cleanup_git && test_when_finished remove_user_cache && - git -c git-p4.metadataDecodingStrategy=fallback p4.py clone --dest="$git" //depot@all && + git -c git-p4.metadataDecodingStrategy=fallback p4-python2 clone --dest="$git" //depot@all && ( cd "$git" && git log >actual && @@ -174,7 +174,7 @@ test_expect_success 'check cp850-only contents escaped when cp1252 is fallback' test_expect_success 'check cp-1252 contents on later sync after clone with fallback strategy' ' test_when_finished cleanup_git && test_when_finished remove_user_cache && - git -c git-p4.metadataDecodingStrategy=fallback p4.py clone --dest="$git" //depot@all && + git -c git-p4.metadataDecodingStrategy=fallback p4-python2 clone --dest="$git" //depot@all && ( cd "$cli" && P4USER=cp1252_author && @@ -186,7 +186,7 @@ test_expect_success 'check cp-1252 contents on later sync after clone with fallb ( cd "$git" && - git p4.py sync --branch=master && + git p4-python2 sync --branch=master && git log p4/master >actual && grep "sœme more cp-1252 tæxt" actual && @@ -201,7 +201,7 @@ test_expect_success 'check cp-1252 contents on later sync after clone with fallb test_expect_success 'passthrough (latin-1 contents corrupted in git) is the default with python2' ' test_when_finished cleanup_git && test_when_finished remove_user_cache && - git -c git-p4.metadataDecodingStrategy=passthrough p4.py clone --dest="$git" //depot@all && + git -c git-p4.metadataDecodingStrategy=passthrough p4-python2 clone --dest="$git" //depot@all && ( cd "$git" && git log >actual && diff --git a/t/t9836-git-p4-metadata-encoding-python3.sh b/t/t9836-git-p4-metadata-encoding-python3.sh index 63350dc4b5c6262480cd0be8fd88fba714c55428..5e5217a66b4fdb3c7fcf073a50952c7e9009e9fe 100755 --- a/t/t9836-git-p4-metadata-encoding-python3.sh +++ b/t/t9836-git-p4-metadata-encoding-python3.sh @@ -8,29 +8,29 @@ failing, and produces maximally sane output in git.' . ./lib-git-p4.sh -python_target_version='3' - ############################### ## SECTION REPEATED IN t9835 ## ############################### -# Please note: this test calls "git-p4.py" rather than "git-p4", because the -# latter references a specific path so we can't easily force it to run under -# the python version we need to. - -python_major_version=$(python -V 2>&1 | cut -c 8) -python_target_binary=$(which python$python_target_version) -if ! test "$python_major_version" = "$python_target_version" && test "$python_target_binary" +# These tests are specific to Python 3. Write a custom script that executes +# git-p4 directly with the Python 3 interpreter to ensure that we use that +# version even if Git was compiled with Python 2. +python_target_binary=$(which python3) +if test -n "$python_target_binary" then mkdir temp_python - PATH="$(pwd)/temp_python:$PATH" && export PATH - ln -s $python_target_binary temp_python/python + PATH="$(pwd)/temp_python:$PATH" + export PATH + + write_script temp_python/git-p4-python3 <<-EOF + exec "$python_target_binary" "$(git --exec-path)/git-p4" "\$@" + EOF fi -python_major_version=$(python -V 2>&1 | cut -c 8) -if ! test "$python_major_version" = "$python_target_version" +git p4-python3 >err +if ! grep 'valid commands' err then - skip_all="skipping python$python_target_version-specific git p4 tests; python$python_target_version not available" + skip_all="skipping python3 git p4 tests; python3 not available" test_done fi @@ -81,14 +81,14 @@ test_expect_success 'init depot' ' test_expect_success 'clone non-utf8 repo with strict encoding' ' test_when_finished cleanup_git && test_when_finished remove_user_cache && - test_must_fail git -c git-p4.metadataDecodingStrategy=strict p4.py clone --dest="$git" //depot@all 2>err && + test_must_fail git -c git-p4.metadataDecodingStrategy=strict p4-python3 clone --dest="$git" //depot@all 2>err && grep "Decoding perforce metadata failed!" err ' test_expect_success 'check utf-8 contents with passthrough strategy' ' test_when_finished cleanup_git && test_when_finished remove_user_cache && - git -c git-p4.metadataDecodingStrategy=passthrough p4.py clone --dest="$git" //depot@all && + git -c git-p4.metadataDecodingStrategy=passthrough p4-python3 clone --dest="$git" //depot@all && ( cd "$git" && git log >actual && @@ -100,7 +100,7 @@ test_expect_success 'check utf-8 contents with passthrough strategy' ' test_expect_success 'check latin-1 contents corrupted in git with passthrough strategy' ' test_when_finished cleanup_git && test_when_finished remove_user_cache && - git -c git-p4.metadataDecodingStrategy=passthrough p4.py clone --dest="$git" //depot@all && + git -c git-p4.metadataDecodingStrategy=passthrough p4-python3 clone --dest="$git" //depot@all && ( cd "$git" && git log >actual && @@ -114,7 +114,7 @@ test_expect_success 'check latin-1 contents corrupted in git with passthrough st test_expect_success 'check utf-8 contents with fallback strategy' ' test_when_finished cleanup_git && test_when_finished remove_user_cache && - git -c git-p4.metadataDecodingStrategy=fallback p4.py clone --dest="$git" //depot@all && + git -c git-p4.metadataDecodingStrategy=fallback p4-python3 clone --dest="$git" //depot@all && ( cd "$git" && git log >actual && @@ -126,7 +126,7 @@ test_expect_success 'check utf-8 contents with fallback strategy' ' test_expect_success 'check latin-1 contents with fallback strategy' ' test_when_finished cleanup_git && test_when_finished remove_user_cache && - git -c git-p4.metadataDecodingStrategy=fallback p4.py clone --dest="$git" //depot@all && + git -c git-p4.metadataDecodingStrategy=fallback p4-python3 clone --dest="$git" //depot@all && ( cd "$git" && git log >actual && @@ -138,7 +138,7 @@ test_expect_success 'check latin-1 contents with fallback strategy' ' test_expect_success 'check cp-1252 contents with fallback strategy' ' test_when_finished cleanup_git && test_when_finished remove_user_cache && - git -c git-p4.metadataDecodingStrategy=fallback p4.py clone --dest="$git" //depot@all && + git -c git-p4.metadataDecodingStrategy=fallback p4-python3 clone --dest="$git" //depot@all && ( cd "$git" && git log >actual && @@ -150,7 +150,7 @@ test_expect_success 'check cp-1252 contents with fallback strategy' ' test_expect_success 'check cp850 contents parsed with correct fallback' ' test_when_finished cleanup_git && test_when_finished remove_user_cache && - git -c git-p4.metadataDecodingStrategy=fallback -c git-p4.metadataFallbackEncoding=cp850 p4.py clone --dest="$git" //depot@all && + git -c git-p4.metadataDecodingStrategy=fallback -c git-p4.metadataFallbackEncoding=cp850 p4-python3 clone --dest="$git" //depot@all && ( cd "$git" && git log >actual && @@ -162,7 +162,7 @@ test_expect_success 'check cp850 contents parsed with correct fallback' ' test_expect_success 'check cp850-only contents escaped when cp1252 is fallback' ' test_when_finished cleanup_git && test_when_finished remove_user_cache && - git -c git-p4.metadataDecodingStrategy=fallback p4.py clone --dest="$git" //depot@all && + git -c git-p4.metadataDecodingStrategy=fallback p4-python3 clone --dest="$git" //depot@all && ( cd "$git" && git log >actual && @@ -174,7 +174,7 @@ test_expect_success 'check cp850-only contents escaped when cp1252 is fallback' test_expect_success 'check cp-1252 contents on later sync after clone with fallback strategy' ' test_when_finished cleanup_git && test_when_finished remove_user_cache && - git -c git-p4.metadataDecodingStrategy=fallback p4.py clone --dest="$git" //depot@all && + git -c git-p4.metadataDecodingStrategy=fallback p4-python3 clone --dest="$git" //depot@all && ( cd "$cli" && P4USER=cp1252_author && @@ -186,7 +186,7 @@ test_expect_success 'check cp-1252 contents on later sync after clone with fallb ( cd "$git" && - git p4.py sync --branch=master && + git p4-python3 sync --branch=master && git log p4/master >actual && grep "sœme more cp-1252 tæxt" actual && @@ -202,7 +202,7 @@ test_expect_success 'check cp-1252 contents on later sync after clone with fallb test_expect_success 'fallback (both utf-8 and cp-1252 contents handled) is the default with python3' ' test_when_finished cleanup_git && test_when_finished remove_user_cache && - git p4.py clone --dest="$git" //depot@all && + git p4-python3 clone --dest="$git" //depot@all && ( cd "$git" && git log >actual && From patchwork Fri Dec 13 10:41:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13906856 Received: from fhigh-b7-smtp.messagingengine.com (fhigh-b7-smtp.messagingengine.com [202.12.124.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E4311BD01D for ; Fri, 13 Dec 2024 10:41:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.158 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734086506; cv=none; b=B/awrtjF4YQ/NAoMTDumQoBsoYBGoQVY/0t1Ug9xsNVUjLw6hmV8YIUEyCCItvqrhSU8N1AMaNfelrbryimJqmfo/BWbOk2s7qedQxVBfv7k6qUFYw87j42YX0/qbokGZLKQoeTujn3kkEkvSAikfSDgoMHYJO+kX7yb3kVwLSM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734086506; c=relaxed/simple; bh=pFYNSeOC0dZqV3ncVHV3bXz+YI+syTJwIvF2qXoUjCk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gxB8evnntEIPsVEtpNuWMByjO95GzlTEKqZHrMC4Z6V5U90i5lCkC9Y5JadXKDXA5hZIegokC6+dYj04NZCLMwSZDRPf0V/C5HgZ7NYiaEmoPf6sNeUYsMUYdjulBgFulS928RI4tgLsElS+dm6awpwJRMhZ5OMnZIKQuR2WtXk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=zJuse075; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=T3zqRDGS; arc=none smtp.client-ip=202.12.124.158 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="zJuse075"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="T3zqRDGS" Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfhigh.stl.internal (Postfix) with ESMTP id B03EB2540206; Fri, 13 Dec 2024 05:41:43 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Fri, 13 Dec 2024 05:41:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1734086503; x=1734172903; bh=dlHdCt4FzOcIHjkhZFlN3njsmNnitRwFO8z3dlpI+Ic=; b= zJuse075tA3e6tiad5QPtxb82YZOEwrv4UyvrDn5cOCR3bH7ALlIaDVrhRE+7zBy YzrfL8tdp3Q7hwCLUXqbahvkPUExDmPsdIBuv5i3q+iMEV8BXaUbgPNLipHw+m3Y 2Ugt87bUN1FDfZ5/v4Q5KlQEjD9OD7TYkKm8qSOZzOc2jLpxq+UYbdC1zj7zORCk HoZv8opW4T9KbcMmIHK8T5wa/qOfv/vlea9U5YT7CD898AhZleBJR1Rxclhdf2dX O5CtINIMYd5zBgFgF8tXLwbhvWAqLcPbMeelBILWLCqeJxWwcuhyNAT5d73Z/PqO cwcmtzzmaZTMR+rsNA788Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1734086503; x= 1734172903; bh=dlHdCt4FzOcIHjkhZFlN3njsmNnitRwFO8z3dlpI+Ic=; b=T 3zqRDGSJ3HrTOXG+267YXVQ44cU5ZI8Jl6fcihagzLgzTGOJSuwWoGDNzHzdSBlD Re1lWvzt2/hZNgCCS0xOxW5RTVsFxCUIi1xIlbN7CmkysbZhI6ESgKPbtotmlPn7 OgoNkVJF0NocxrwuL9JoG5TmbrRipWTDGtl6ccoSx75X7OYL7v2TvE6sYJHVjQ1B 0hv/gcmrc1gzhkhmzV2gkJmdNhsM48SHmrkCD2MQxJBBK6NZPkXc1fE24TY6Y1Yu unxmCjrkxT8WZ6TZrShZg5UvghwTpiGyHJAVi/knEB1luSpWJ8L/Jx6p/NYoVW+p JfvDprhzRDp6noguCpx4w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrkeejgddukecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredtjeen ucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimh eqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkeduheej teekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrg hilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepfedpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtohepthhoohhnsehiohhttghlrdgtohhmpdhrtghpthhtoh epghhithesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehkrghrthhhihhk rddukeeksehgmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 13 Dec 2024 05:41:42 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 8e6a619b (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 13 Dec 2024 10:39:58 +0000 (UTC) From: Patrick Steinhardt Date: Fri, 13 Dec 2024 11:41:22 +0100 Subject: [PATCH v2 7/8] t: introduce compatibility options to clar-based tests Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241213-pks-meson-ci-v2-7-634affccc694@pks.im> References: <20241213-pks-meson-ci-v2-0-634affccc694@pks.im> In-Reply-To: <20241213-pks-meson-ci-v2-0-634affccc694@pks.im> To: git@vger.kernel.org Cc: karthik nayak , Toon Claes X-Mailer: b4 0.14.2 Our unit tests that don't yet use the clar unit testing framework ignore any option that they do not understand. It is thus fine to just pass test options we set up globally to those unit tests as they are simply ignored. This makes our life easier because we don't have to special case those options with Meson, where test options are set up globally via `meson test --test-args=`. But our clar-based unit testing framework is way stricter here and will fail in case it is passed an unknown option. Stub out these options with no-ops to make our life a bit easier. Note that this also requires us to remove the `-x` short option for `--exclude`. This is because `-x` has another meaning in our integration tests, as it enables shell tracing. I doubt there are a lot of people out there using it as we only got a small hand full of clar tests in the first place. So better change it now so that we can in the long run improve compatibility between the two different test drivers. Signed-off-by: Patrick Steinhardt --- parse-options.h | 12 ++++++++++++ t/unit-tests/unit-test.c | 19 ++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/parse-options.h b/parse-options.h index f0801d4532a175b65783689f2a68fb56da2c8e87..d01361ca97fd7227a0005b5c447d954fea472ca0 100644 --- a/parse-options.h +++ b/parse-options.h @@ -353,6 +353,18 @@ struct option { .callback = parse_opt_noop_cb, \ } +static char *parse_options_noop_ignored_value MAYBE_UNUSED; +#define OPT_NOOP_ARG(s, l) { \ + .type = OPTION_CALLBACK, \ + .short_name = (s), \ + .long_name = (l), \ + .value = &parse_options_noop_ignored_value, \ + .argh = "ignored", \ + .help = N_("no-op (backward compatibility)"), \ + .flags = PARSE_OPT_HIDDEN, \ + .callback = parse_opt_noop_cb, \ +} + #define OPT_ALIAS(s, l, source_long_name) { \ .type = OPTION_ALIAS, \ .short_name = (s), \ diff --git a/t/unit-tests/unit-test.c b/t/unit-tests/unit-test.c index a474cdcfd351d9d624178a769329252237f951b7..fa8818842a42478c7a8fa6f6ecbee0777bdf472f 100644 --- a/t/unit-tests/unit-test.c +++ b/t/unit-tests/unit-test.c @@ -18,8 +18,25 @@ int cmd_main(int argc, const char **argv) N_("immediately exit upon the first failed test")), OPT_STRING_LIST('r', "run", &run_args, N_("suite[::test]"), N_("run only test suite or individual test ")), - OPT_STRING_LIST('x', "exclude", &exclude_args, N_("suite"), + OPT_STRING_LIST(0, "exclude", &exclude_args, N_("suite"), N_("exclude test suite ")), + /* + * Compatibility wrappers so that we don't have to filter + * options understood by integration tests. + */ + OPT_NOOP_NOARG('d', "debug"), + OPT_NOOP_NOARG(0, "github-workflow-markup"), + OPT_NOOP_NOARG(0, "no-bin-wrappers"), + OPT_NOOP_ARG(0, "root"), + OPT_NOOP_ARG(0, "stress"), + OPT_NOOP_NOARG(0, "tee"), + OPT_NOOP_NOARG(0, "with-dashes"), + OPT_NOOP_ARG(0, "valgrind"), + OPT_NOOP_ARG(0, "valgrind-only"), + OPT_NOOP_NOARG('v', "verbose"), + OPT_NOOP_NOARG('V', "verbose-log"), + OPT_NOOP_ARG(0, "verbose-only"), + OPT_NOOP_NOARG('x', NULL), OPT_END(), }; struct strvec args = STRVEC_INIT; From patchwork Fri Dec 13 10:41:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13906857 Received: from fhigh-b7-smtp.messagingengine.com (fhigh-b7-smtp.messagingengine.com [202.12.124.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 306521BE871 for ; Fri, 13 Dec 2024 10:41:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.158 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734086506; cv=none; b=BcTSkUlK2yFt6qoOdPgnGEHamRLXCkzwG2uo9eF+9CDJe3I+ltIo89+mtsOiauWKNzHcpWGckRJAJb6SveOMRuQp7iBa8CsAUgO9+LmYneRudPJ5k8uDkJQH1Tjo5vgtEPv7IBZjfgVfEv4yk6r4/bGQJoWNleJFJ3VY7D+zxg0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734086506; c=relaxed/simple; bh=jpfM8pNAc2OiSVHzl26aAgDdFoDK1N+B3sRHWkAqDBM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=O3uHRfoEsyPtVnZDIXp2DF6+U+m1iJnHbs4wAEvJ80gl1TWfnVvvjc8SFamwE6tkrepsVefsA5sLUwBSgxBlGI8gT+vStCUe8D+zwc+gpcV/ojZ3H7ZwPql7MBTycSBesoVzUFUwkrRsKzI7URo9bp4jm2hztk/7NosPWYUiNko= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=FRPXB6wx; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=D1Yq5TiC; arc=none smtp.client-ip=202.12.124.158 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="FRPXB6wx"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="D1Yq5TiC" Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfhigh.stl.internal (Postfix) with ESMTP id 4487F254012D; Fri, 13 Dec 2024 05:41:44 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Fri, 13 Dec 2024 05:41:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1734086504; x=1734172904; bh=u04CwWXfm3wp+XSyBW3F5Q5GOAZbkBK+ELESMDztEGk=; b= FRPXB6wx36de9oT0mm6m2c2TKHIB4EEPWv+tneuwwLX8QB/quYxukf2hzguq0xmQ f/vsB389Ml9BhyS9OC98MgQneR70cPfnuoHX6z2Z+b4FTseFnR5jI3e6G+JCSKvu aW71eHqN6J9Ws/DfIcqN98bgS5YWu9gEXKpflRtNy8nQDA0MfN5GZ5TcjxtCw0Em tQd5SPz4TJJslR0ETURR7rg+m7G1Zi1iJseoZyZpGWbmQGvElmueDuJvT+mv5L5C vLMgyNxXPkT9v9Vq8vIUydYcSGb+eR/8B6djku+Cxl97QLDtYx9O6GNJEuJF16OP /1ABzBo+MRrhdkt3cPeNGQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1734086504; x= 1734172904; bh=u04CwWXfm3wp+XSyBW3F5Q5GOAZbkBK+ELESMDztEGk=; b=D 1Yq5TiCtM0/xvlfVExb7ViLNDWhSEL1ILVF8hSug/FV0YF9c4jfSAFx9rEdjQg1H YaArLhHitpY14+0vpuyw5G45QjsOlcP0b/MaDEsOhgf2j4xkZZ/BQzdSYoetJe/r h1hAr9iza6b2fqxkN4SF6hlHIAxFpom0F/cGMWtm4sf8SWHMzDLlKk/SsMvbf5IU PXkWDYjplfu3JTRzQt+1dPgoyntBwYIOmPhS35yqS9SdKDfZbYcNPJuj8qyZh1Y5 AvL8Gpq7DDaNZ2/7CIq6pZr3lbaP3CkilcL22jEyUsZmQlsZydI+axX+ACmS6Smt bPHlwBi+pSAOTi1luU4qw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrkeejgddulecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredtjeen ucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimh eqnecuggftrfgrthhtvghrnhepgeeggfelgfekhedvgeffleffkeekheduffefvdehgeei geduhedukeelieevtdfgnecuffhomhgrihhnpehvvggtthhorhdrtggtnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimhdp nhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepghhith esvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehkrghrthhhihhkrddukeek sehgmhgrihhlrdgtohhmpdhrtghpthhtohepthhoohhnsehiohhttghlrdgtohhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 13 Dec 2024 05:41:43 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 15f5d946 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 13 Dec 2024 10:39:59 +0000 (UTC) From: Patrick Steinhardt Date: Fri, 13 Dec 2024 11:41:23 +0100 Subject: [PATCH v2 8/8] ci: wire up Meson builds Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241213-pks-meson-ci-v2-8-634affccc694@pks.im> References: <20241213-pks-meson-ci-v2-0-634affccc694@pks.im> In-Reply-To: <20241213-pks-meson-ci-v2-0-634affccc694@pks.im> To: git@vger.kernel.org Cc: karthik nayak , Toon Claes X-Mailer: b4 0.14.2 Wire up CI builds for both GitLab and GitHub that use the Meson build system. While the setup is mostly trivial, one gotcha is the test output directory used to be in "t/", but now it is contained in the build directory. To unify the logic across Makefile- and Meson-based builds we explicitly set up the `TEST_OUTPUT_DIRECTORY` variable so that it is the same for both build systems. Signed-off-by: Patrick Steinhardt --- .github/workflows/main.yml | 7 +++++++ .gitlab-ci.yml | 8 ++++++++ ci/install-dependencies.sh | 7 +++++++ ci/lib.sh | 2 +- ci/print-test-failures.sh | 2 +- ci/run-build-and-tests.sh | 31 ++++++++++++++++++++++++------- 6 files changed, 48 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 808ddc19b8a799abc414c6d6ba078a6e5be6bdfb..c231419abc670fb0bd096c2dce63fd1b66ab14b7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -286,6 +286,9 @@ jobs: - jobname: osx-gcc cc: gcc-13 pool: macos-13 + - jobname: osx-meson + cc: clang + pool: macos-13 - jobname: linux-gcc-default cc: gcc pool: ubuntu-latest @@ -298,11 +301,15 @@ jobs: - jobname: linux-asan-ubsan cc: clang pool: ubuntu-latest + - jobname: linux-meson + cc: gcc + pool: ubuntu-latest env: CC: ${{matrix.vector.cc}} CC_PACKAGE: ${{matrix.vector.cc_package}} jobname: ${{matrix.vector.jobname}} distro: ${{matrix.vector.pool}} + TEST_OUTPUT_DIRECTORY: ${{github.workspace}}/t runs-on: ${{matrix.vector.pool}} steps: - uses: actions/checkout@v4 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a1bc92893f27d6dd404133686b71c8061e55618c..3eec72ddc666f593521058b5f38eb6220f42ce0f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,6 +20,7 @@ test:linux: - saas-linux-medium-amd64 variables: CUSTOM_PATH: "/custom" + TEST_OUTPUT_DIRECTORY: "/tmp/test-output" before_script: - ./ci/install-dependencies.sh script: @@ -31,6 +32,7 @@ test:linux: if test "$CI_JOB_STATUS" != 'success' then sudo --preserve-env --set-home --user=builder ./ci/print-test-failures.sh + mv "$TEST_OUTPUT_DIRECTORY"/failed-test-artifacts t/ fi parallel: matrix: @@ -67,6 +69,9 @@ test:linux: image: fedora:latest - jobname: linux-musl image: alpine:latest + - jobname: linux-meson + image: ubuntu:latest + CC: gcc artifacts: paths: - t/failed-test-artifacts @@ -104,6 +109,9 @@ test:osx: - jobname: osx-reftable image: macos-13-xcode-14 CC: clang + - jobname: osx-meson + image: macos-14-xcode-15 + CC: clang artifacts: paths: - t/failed-test-artifacts diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh index d020cb7aa5ef64e8cb9e4c580064a84f4b3d1bfb..d1cb9fa8785388b3674fcea4dd682abc0725c968 100755 --- a/ci/install-dependencies.sh +++ b/ci/install-dependencies.sh @@ -58,6 +58,7 @@ ubuntu-*|ubuntu32-*|debian-*) make libssl-dev libcurl4-openssl-dev libexpat-dev wget sudo default-jre \ tcl tk gettext zlib1g-dev perl-modules liberror-perl libauthen-sasl-perl \ libemail-valid-perl libio-pty-perl libio-socket-ssl-perl libnet-smtp-ssl-perl libdbd-sqlite3-perl libcgi-pm-perl \ + libpcre2-dev meson ninja-build pkg-config \ ${CC_PACKAGE:-${CC:-gcc}} $PYTHON_PACKAGE case "$distro" in @@ -90,6 +91,12 @@ macos-*) sudo xattr -d com.apple.quarantine "$CUSTOM_PATH/p4" "$CUSTOM_PATH/p4d" 2>/dev/null || true rm helix-core-server.tgz + case "$jobname" in + osx-meson) + brew install meson ninja pcre2 + ;; + esac + if test -n "$CC_PACKAGE" then BREW_PACKAGE=${CC_PACKAGE/-/@} diff --git a/ci/lib.sh b/ci/lib.sh index 2e7a5f0540b66f24bd0f5744311c2c48b472d63d..b436f855414226df7f27a1b5ce95702f227d0c53 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -236,7 +236,7 @@ then CC="${CC_PACKAGE:-${CC:-gcc}}" DONT_SKIP_TAGS=t handle_failed_tests () { - echo "FAILED_TEST_ARTIFACTS=t/failed-test-artifacts" >>$GITHUB_ENV + echo "FAILED_TEST_ARTIFACTS=${TEST_OUTPUT_DIRECTORY:-t}/failed-test-artifacts" >>$GITHUB_ENV create_failed_test_artifacts return 1 } diff --git a/ci/print-test-failures.sh b/ci/print-test-failures.sh index b1f80aeac345dd70746b02b6ca1b5282a0c2a4aa..655687dd827e5b3e4d4879803b0d4499e7751380 100755 --- a/ci/print-test-failures.sh +++ b/ci/print-test-failures.sh @@ -46,7 +46,7 @@ do ;; github-actions) mkdir -p failed-test-artifacts - echo "FAILED_TEST_ARTIFACTS=t/failed-test-artifacts" >>$GITHUB_ENV + echo "FAILED_TEST_ARTIFACTS=${TEST_OUTPUT_DIRECTORY:t}/failed-test-artifacts" >>$GITHUB_ENV cp "${TEST_EXIT%.exit}.out" failed-test-artifacts/ tar czf failed-test-artifacts/"$test_name".trash.tar.gz "$trash_dir" continue diff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh index 2e28d02b20f2469afddc4e04fdbd18465babb1ef..c4a41bba0b84df57f6e60aeac2de29dbc0e27dc1 100755 --- a/ci/run-build-and-tests.sh +++ b/ci/run-build-and-tests.sh @@ -48,12 +48,29 @@ pedantic) ;; esac -group Build make -if test -n "$run_tests" -then - group "Run tests" make test || - handle_failed_tests -fi -check_unignored_build_artifacts +case "$jobname" in +*-meson) + group "Configure" meson setup build . \ + --warnlevel 2 --werror \ + --wrap-mode nofallback + group "Build" meson compile -C build -- + if test -n "$run_tests" + then + group "Run tests" meson test -C build --print-errorlogs --test-args="$GIT_TEST_OPTS" || ( + ./t/aggregate-results.sh "${TEST_OUTPUT_DIRECTORY:-t}/test-results" + handle_failed_tests + ) + fi + ;; +*) + group Build make + if test -n "$run_tests" + then + group "Run tests" make test || + handle_failed_tests + fi + ;; +esac +check_unignored_build_artifacts save_good_tree