From patchwork Wed Dec 11 10:52:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13903335 Received: from fout-b8-smtp.messagingengine.com (fout-b8-smtp.messagingengine.com [202.12.124.151]) (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 DDF8A1A8410 for ; Wed, 11 Dec 2024 10:53:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733914395; cv=none; b=jAaGQTON3fyqY+Qlr47TQBupedxGhqtf8v+DPl9py4d0+0cgSDro8JxjGObmkxG10AJau5zMm29lTIr7cY7iaMs0MAjosUyyG07fqpJkm86vR18BuDnjeRCnkC22OW1T0LACU/sxJUGbXKVxVSaOrlpEYGk1hUdwBOOnkOYfT+4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733914395; c=relaxed/simple; bh=cHbvpJqkh/AezI2BJTet2V3CTXisrLIKE1V3Ok8Tyrk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lDcilnFVUPzbwSEnQHI6Pr39aE9+HWY7ps4FVfeJaRYxr73sN76aY4y6/x15PNWGf2oJmdtDD0KAfSXMvQ8UPBuvYYsEkKFvYFyWERapxLrczbVdO8N4cHtAyBXvt1LZCE1nu8NsPiTYqEOxvsNjVnBzBV4YfWQbQCEH9XbI+c4= 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=Vj66AQWA; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=TPJwguGV; arc=none smtp.client-ip=202.12.124.151 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="Vj66AQWA"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="TPJwguGV" Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfout.stl.internal (Postfix) with ESMTP id 66373114026F for ; Wed, 11 Dec 2024 05:53:11 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-11.internal (MEProxy); Wed, 11 Dec 2024 05:53:11 -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=1733914391; x=1734000791; bh=Wb81SKAlylxOhqw+0F7gG0BMGEpS87kNjGxaZagH7Q8=; b= Vj66AQWAS9GGwHjPZcVHC3J5N9NCyILMPdOs8xk+cbb9v1PpPGRE2/k6Djr1Vyi1 WIgQiMVJpUt6fLNWWtQJmKJm+crdUSXGEQ8dFDyilvRu0Fgk9yEdHelNt97WiGKt I/1EjYaZleoTyetMz/53mJyBjdhEFKSBA7OREUGFNwtUvnAlFUoQDZk/MIOLoG43 CP2Cjm/lROSyGFoS4+eBSqUCU7rrK6B+Ge7JxPgMr4si5AT57Bwlr+1oD0XrYS5q ATbEJrOfjt6BJ6sign2QLQIixti1QSR82Nw/ljRGDnDvW5RtOYpv3zZcu7N1XcqQ nw/SPvkN9dLwiS0TQHiemg== 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=1733914391; x= 1734000791; bh=Wb81SKAlylxOhqw+0F7gG0BMGEpS87kNjGxaZagH7Q8=; b=T PJwguGVt9ZuE8KmCnaIo5gCvBWiDUR/Nsz6X9jUNsCCTlq7pMIHrvMnDAWTUMUJ4 o5sZO9NEB1fNqWmfWn5Io9op628jCqPB3IPZEoEdVet9pwSMizqGPthNWfNMGKAF SFtOT5rlWp1WbsAB155Rah4OR/SmnPhddEIUQnm4bb2TUh44R1HBsLhw8mmJ3Qbf 0P8xmM1wwoDpsVtOrn+LdMB1Up1iCd5DplP9/t3IK7fHJwnG+LZ79L+fIH+qevmX 2TREL0XeMAEhJ4xeoALzGFnjCFEKLJr1Xir9L1Th5x4+U8YHcrXrcBvqvQ8TY9dz bph89BHtod3hzZ1YMaBAw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrkedtgddvudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephfffufggtg fgkfhfjgfvvefosehtjeertdertdejnecuhfhrohhmpefrrghtrhhitghkucfuthgvihhn hhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrhhnpeffueeiudejvd ekheeuvdekfeffiedvueelteekudehjeetkeegvddugfdtgfeileenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpshesphhkshdrihhmpdhnsg gprhgtphhtthhopedupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehgihhtsehv ghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 11 Dec 2024 05:53:10 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id cd515867 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 11 Dec 2024 10:51:32 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 11 Dec 2024 11:52:32 +0100 Subject: [PATCH 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: <20241211-pks-meson-ci-v1-1-28d18b494374@pks.im> References: <20241211-pks-meson-ci-v1-0-28d18b494374@pks.im> In-Reply-To: <20241211-pks-meson-ci-v1-0-28d18b494374@pks.im> To: git@vger.kernel.org Cc: 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 Wed Dec 11 10:52:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13903336 Received: from fhigh-b1-smtp.messagingengine.com (fhigh-b1-smtp.messagingengine.com [202.12.124.152]) (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 B5D8F1A8413 for ; Wed, 11 Dec 2024 10:53:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.152 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733914396; cv=none; b=Xn3dJN1IWHP/FwSvo43+EBVgX2aEOxroIMu+C/liYTScbsrAvZahvBqhuAa94Q0dYinZSqOBf4KMjLZFPdqMa+FH30K8FRe3LULulA/+r9IVyyNbvB+9x/wypqO1CdJeagN7X6ry10XbOr48CLbb24RM0m30fE/fQbHrJtkHlFk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733914396; c=relaxed/simple; bh=WHYURV58Su3U1JmZPiW+jHa/xbzYdyEvs3gGlCHH4lc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sYgetxd8Kcu5fqDGhYl6Xt5d/5HBGBoL3U63qjld+IMyn7sbIk7eOrF+XRs1tgfreDio6pQI2GAKFNqA1X5UIQyKygNbbME3sANHo9SRTSuF6zRXCaOpzyyV8z7FXv38isDuRD4yFKk3+lVTtwS7x6CgZNiDWlavAP42ToqgROk= 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=sKPv99q1; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=xuLJfUYZ; arc=none smtp.client-ip=202.12.124.152 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="sKPv99q1"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="xuLJfUYZ" Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfhigh.stl.internal (Postfix) with ESMTP id AF190254020F for ; Wed, 11 Dec 2024 05:53:12 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Wed, 11 Dec 2024 05:53:12 -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=1733914392; x=1734000792; bh=kROOqGtySdYgwQ1O2BLWJq6mt1aWC9+fBkgb3TYk6cw=; b= sKPv99q1hLwIdIZwUiZt34+T7/czAdKqoddIZqH5E9mDXTLkkF11q89BdK7MakPB /Wt84UD6G9a/8DVYltIg8FIE6iqxG5m1t8df9bangV+i/X1O+oiHgQkB5nS8WGh7 GQkDAvWSybWjGxY/cexRJB5N66TTxrnw9xe8AlqsDqfAR6ldR8R/QLsHxzIb1D7A wtadSUPOXie61oygn2yHqlPTFA/2LD8zke53+Zgf4PAyuTXN3AWTWAo0g34PO3mf uzaSzf0aJSAhIxk3re8wW7cO7uPYbytLw9iOnpwqFrathIFyTlh0AvwiOCs7FrnZ HwE0TsaZXVn62zcpH+GPwQ== 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=1733914392; x= 1734000792; bh=kROOqGtySdYgwQ1O2BLWJq6mt1aWC9+fBkgb3TYk6cw=; b=x uLJfUYZEyeXJWk2FjmiE28c83ALlSSJpMl1kOX28R5nx2v8TK5NDOz8HvMXTX4Fb XulbqUjJ2r+jCOlLquGj+4StoIMADy5Barzs049bLoUibMCH+qSNadEIOLlSfY+2 1iI9hk1f/tp5D3F4EfKj7XRDDfitQxBEAwd/SJYOwD+M6gcZDoD7bln3HVHfmT3X IUajoTkPpqPar2mUOp4h0gziPCk0LGfJGox1VD9GO8c6q9xt9/d+FYVN1/2dsDUH luX8Yw5BYnZ3x0wh+pE8adNN8Lk1ICO7KCqor4n8yQgGI0xN7cUyOnrSE7tYGqV7 hq4duIhNC3P6PX0hndWVQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrkedtgddvudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephfffufggtg fgkfhfjgfvvefosehtjeertdertdejnecuhfhrohhmpefrrghtrhhitghkucfuthgvihhn hhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrhhnpeffueeiudejvd ekheeuvdekfeffiedvueelteekudehjeetkeegvddugfdtgfeileenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpshesphhkshdrihhmpdhnsg gprhgtphhtthhopedupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehgihhtsehv ghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 11 Dec 2024 05:53:11 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 40871f95 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 11 Dec 2024 10:51:33 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 11 Dec 2024 11:52:33 +0100 Subject: [PATCH 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: <20241211-pks-meson-ci-v1-2-28d18b494374@pks.im> References: <20241211-pks-meson-ci-v1-0-28d18b494374@pks.im> In-Reply-To: <20241211-pks-meson-ci-v1-0-28d18b494374@pks.im> To: git@vger.kernel.org Cc: 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 Wed Dec 11 10:52:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13903339 Received: from fout-b8-smtp.messagingengine.com (fout-b8-smtp.messagingengine.com [202.12.124.151]) (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 A569B1EE7BB for ; Wed, 11 Dec 2024 10:53:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733914397; cv=none; b=dn0eqQoGuZtZXWfP/MVUxdxrDLoQDB6a4ZOQEl4zvlO6lG9La6pIVIUIDdRByPXwGR9Zxzc8uKM/nWcvU6SVuuw0Na68n8v05PUO+4KQlSDD1ad7rhW2FznbfMlePhk3YbW4tthVeAHgnV4SQ9/55Njwbam3W6eni7I/FK1Fq+o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733914397; c=relaxed/simple; bh=1j4n035rafMjR3M7/XHF1VlZ9ALyOWk+hLgNLWT6EsA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ejmwEX7P1v+le7fQhgx3Ebk1PuxlZyGZpOKYFSYAgG57M4eLGNMJzHutr84LgCK/BtS0SnxEgHYPOgvAHBM66NoXmVNDc0E1T2Tegj64FD/rvKIXkSzJ3HC8zan8d3yg7IxB8SkmD7HZH4K3qpHNXzA/Wv8AGWbkfZJ2vi7djDk= 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=OfS7XKPl; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=wsNSSk7a; arc=none smtp.client-ip=202.12.124.151 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="OfS7XKPl"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="wsNSSk7a" Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfout.stl.internal (Postfix) with ESMTP id 393FF114026C for ; Wed, 11 Dec 2024 05:53:13 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Wed, 11 Dec 2024 05:53:13 -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=1733914393; x=1734000793; bh=eKNOXYKuAqQpO6whnuFFWUxWuuqOPApvwbgXN4jeY7M=; b= OfS7XKPlR86tiipXcKuupt8/H/Vg+o24tA9J4NBP6UJ6IXes7zX+L4K3ruL6DV49 rOnJcHkwJVZEaSqA9/vMUi3aC2p52HR1IRiB9AQqhQV0a16435h+P+/65L/EqBX7 WSkPEo7HCdk2e2DDy145Ix8xIvIz1+imRRgVYlPYh0/DljPYUrELXMxWvAyiACJX 0e+NjEY+bZj5bWqaa6wVqtcnZXjJqdOLxtQrjrN8mGTjMYo/R/7ciEDMw7B1Q7Yv oyqCJSW+xbtM0Hif0qoamKVjVULS21gPw+of5ZxtFf4h4H1X2Zlql7fqnnyPSC3g Ge1bexA3OilJjwEPLxiUBg== 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=1733914393; x= 1734000793; bh=eKNOXYKuAqQpO6whnuFFWUxWuuqOPApvwbgXN4jeY7M=; b=w sNSSk7at/rN3x/cH4nwY59XsQ0g0nTNe6mW6YplR/Drjz5SD1HDrWpcIr1INu2pE uTu8C8HTKraN2W/9WntClyth96YKCEYNKscSXkWXzzoOtmytHVFkGWA3qrUAcT6+ SGEEKWM81DXmj3dH5kgUlA8qpmRqff9lnXJq0attX+Rgk+tAtKB0tN6PwLbN5swr MW2bHgKD0beunF20IlJ2FRMopCI0y6++E4Dh1mDcpaSmJcyaCo2uj56z0oc/OyTO OE7Y8KnfamWSrxv9tYp9051vnOFn0iBOyYNzd+9s36+eRlOpO7Dd811s6AWfsYpt cbEBByf4QpnvSqYEPdN1w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrkedtgddvudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephfffufggtg fgkfhfjgfvvefosehtjeertdertdejnecuhfhrohhmpefrrghtrhhitghkucfuthgvihhn hhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrhhnpeffueeiudejvd ekheeuvdekfeffiedvueelteekudehjeetkeegvddugfdtgfeileenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpshesphhkshdrihhmpdhnsg gprhgtphhtthhopedupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehgihhtsehv ghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 11 Dec 2024 05:53:12 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 8e6b5ce9 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 11 Dec 2024 10:51:34 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 11 Dec 2024 11:52:34 +0100 Subject: [PATCH 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: <20241211-pks-meson-ci-v1-3-28d18b494374@pks.im> References: <20241211-pks-meson-ci-v1-0-28d18b494374@pks.im> In-Reply-To: <20241211-pks-meson-ci-v1-0-28d18b494374@pks.im> To: git@vger.kernel.org Cc: X-Mailer: b4 0.14.2 All of the code files for unit tests using the self-grown unit testing framework have 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 Wed Dec 11 10:52:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13903337 Received: from fhigh-b1-smtp.messagingengine.com (fhigh-b1-smtp.messagingengine.com [202.12.124.152]) (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 2AAAA1FA8D7 for ; Wed, 11 Dec 2024 10:53:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.152 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733914397; cv=none; b=eOMNwix/CSncD3/Nw6h0QNANN4/FaK7RTaurIPfuxcy7lO3v+iunDu/nf53WY53r1WTVlm8DQuAqsQh1QHIzvJATjEIPWYiOG4k2LhObKwLFLICF+2rqSQknKl0As/lD5qV9o+enyUoyafrPX+GYSyK/T16UjWhyDACSZO5jvSA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733914397; c=relaxed/simple; bh=AsqO3+IstYL7Qu2AEgwombzM8WvgchgVaQdInE5O/ns=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=E25d7kCBH//hxe5IQMDPVPb4WWN0gF32Yuw9czBXtcf5nbP26RjNWfDmHVbF0bcHNwosrgXSLs8nFGBq31w2c/YJ6mMtB7zTJIoNpN7yv8afp1YNsbIq5SFMzT5pmuPCEUKm8cgnNPrrXjJE7sj/cYKEU41NVdF3Jklq5hKXpm0= 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=T+MOzOQS; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=maOfZft3; arc=none smtp.client-ip=202.12.124.152 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="T+MOzOQS"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="maOfZft3" Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfhigh.stl.internal (Postfix) with ESMTP id EEDB225401F7 for ; Wed, 11 Dec 2024 05:53:13 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Wed, 11 Dec 2024 05:53:14 -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=1733914393; x=1734000793; bh=eP8RwPqxfL+OutVoxXx+Zz8c0vzepC+Vb/djmfC04IA=; b= T+MOzOQSDiZYufs9GNE8Umhj7p2rg280Kw0iLvSNpV9zLOW21Nz9/P6UgTgZmbFl J9AGOaSGawq5Hyq5npLLjqhzdPUbVYb50Q33AckOQYEH0COmJHlSruuapYWxfmAm nARWL4SJDUQ0slAm41sDwv+lfC5IFJoAW0gacJK2hjahc3rsJwbiC3HlBPPtDBt7 /Mn3MCsjAmvgA5tQQ4R505aby+x8kiAJiTCj6wM5iq137+zqITOHbpq/dUgFfCbh k8V9Akp3NuswHYVHafxIkX8vTet+SX/dX13TqbF4tK9FoNQ29yYRV5IgSuyYn1w8 a3sCnlKkJrpkogGKQYReow== 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=1733914393; x= 1734000793; bh=eP8RwPqxfL+OutVoxXx+Zz8c0vzepC+Vb/djmfC04IA=; b=m aOfZft3ffV9oGIs59RCNG+ef1MIpDBDSrvhafN8bwz5wDB7F2gem31gZzjU26Chn EnOQ81Lu/YfdjPg1liF6LaWhp5IQN3BapcIUVPakyJcQXxSbgalnsBI4OXJ3DL8j G4IXa6uRfIdv7ztb1RU1rRk60BQupmi5zySPl8FQ5d5C4DzlHCnnVwjxW7zVFBdS M+siOlSTFB8DjEC/EmMYGD3wM1Z3NhktzyMVNN/jg9YBIupa4wRaBXmHf4fZL7jQ zyOFBNBWn+ha4noy55xGBuBngQeeW4qQsVfP6gMXhBqNC+X7zunTFm2IKwAwZg7w HG5OI8b9k1xz6IOibrZ0A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrkedtgddvudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephfffufggtg fgkfhfjgfvvefosehtjeertdertdejnecuhfhrohhmpefrrghtrhhitghkucfuthgvihhn hhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrhhnpeffueeiudejvd ekheeuvdekfeffiedvueelteekudehjeetkeegvddugfdtgfeileenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpshesphhkshdrihhmpdhnsg gprhgtphhtthhopedupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehgihhtsehv ghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 11 Dec 2024 05:53:12 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id f91a7909 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 11 Dec 2024 10:51:35 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 11 Dec 2024 11:52:35 +0100 Subject: [PATCH 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: <20241211-pks-meson-ci-v1-4-28d18b494374@pks.im> References: <20241211-pks-meson-ci-v1-0-28d18b494374@pks.im> In-Reply-To: <20241211-pks-meson-ci-v1-0-28d18b494374@pks.im> To: git@vger.kernel.org Cc: 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..f1fbc6ae179079f4d5d86f9a60956fad84d0495c 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('Missing tests:\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('Superfluous tests:\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 Wed Dec 11 10:52:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13903338 Received: from fout-b8-smtp.messagingengine.com (fout-b8-smtp.messagingengine.com [202.12.124.151]) (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 64E481EC4EA for ; Wed, 11 Dec 2024 10:53:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733914397; cv=none; b=UewkwvHKbdWTNGbfxSo0loxLmNcPBT1JTcxiYgrH4/omudgKcqOgtA8G+cHgzGoxLWCRPEOCIGzfEAWSRdNbjwbtTLtx9ypGs82PK+V628CQb+RfpWnvNj9OK9rO/hFL/BC5EdUyy7yfFshyE6Z+GvziS3TPnj6C1vIWjW4Xoqo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733914397; c=relaxed/simple; bh=Yzc/njr5uaynkXCRS15MyOWRIZDy3dSgEkDFN96+pvQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XA37f+23uQEnfqwSDq8SLXjZglewgOz1Vvzd+G9EDlH+pkmfjs0Xaew7cNPsyrVxMRrJAifjKX2Xb7MbulZxC4vhw1wMxWznQj08kBk6iuA5QkGBSMEDby+Of7d9NWhPfnYt1wKBGg6F3EpEGHTaKec3LQ9soy6cz9t0UTIWy5w= 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=sEMOTHOs; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=LJayfNCi; arc=none smtp.client-ip=202.12.124.151 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="sEMOTHOs"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="LJayfNCi" Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfout.stl.internal (Postfix) with ESMTP id 3837D1140245 for ; Wed, 11 Dec 2024 05:53:14 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Wed, 11 Dec 2024 05:53:14 -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=1733914394; x=1734000794; bh=r0eOzndW3Xj8C4cTgfC0ANlIv+wG78T0FZwPHIwY+dg=; b= sEMOTHOsyyW0Wtb5nDIqKTeEy6Jnh5mrZAnPP37DC59qeii8OSpxtyqW4uOAjE+o EAmgTMCDVmU0Xy3Z7cpxBRqXY6fEgAaZ7HwyjQ4ftD7sJqGwEfNw5ympel/alvmp 8gPONxzm7fBW+tKBy7JVn8bYNeMENbqjrn8hOCjUilLruL8t3xCrcIJqOat98Y+i OLH2sukSOWgT1T64YIP+R+M98zUtQ09uVLkcPLFPB6q+yLmc0iBzWKiEN7/t2GRh qnZkdzir9hGIbmxF0DGG787KrWKtQuzOb94Mta0i8GdHm33D7N45vp5GMCbS+z1X fQofCe/va98DtM6DtKEqIA== 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=1733914394; x= 1734000794; bh=r0eOzndW3Xj8C4cTgfC0ANlIv+wG78T0FZwPHIwY+dg=; b=L JayfNCiJ1kLrmAdFnaByKosovl9FSH0h3n0Ji0AumIMzaZ6fxxQr6/7A/+XI3WW0 xM/L1FtX4nkiKLoXyiZbu0uonQ7moCvncTUakMXpkEzro02kFhok3746LGmLVR0R vWndxJtQMs/WessaMwM16LBH6tNnv3tCPSdnmD6fxl3PYrYLy9uTstyWJeJTmy/g HcbB3Etda+5vpMMNUicza247GbBiy5J+Oa1WuuYaVe+ru1Ng1uuqSVhojAFHYhPW ZY3iJetxse/hgtbRlamfz1W8Zg5R+Dk9hoziPE0MCYnKrsADtNKTGvEsc0T7ZN2Z bwb10V/teiVBGyVg17TLg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrkedtgddvudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephfffufggtg fgkfhfjgfvvefosehtjeertdertdejnecuhfhrohhmpefrrghtrhhitghkucfuthgvihhn hhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrhhnpeffueeiudejvd ekheeuvdekfeffiedvueelteekudehjeetkeegvddugfdtgfeileenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpshesphhkshdrihhmpdhnsg gprhgtphhtthhopedupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehgihhtsehv ghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 11 Dec 2024 05:53:13 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 42fae122 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 11 Dec 2024 10:51:35 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 11 Dec 2024 11:52:36 +0100 Subject: [PATCH 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: <20241211-pks-meson-ci-v1-5-28d18b494374@pks.im> References: <20241211-pks-meson-ci-v1-0-28d18b494374@pks.im> In-Reply-To: <20241211-pks-meson-ci-v1-0-28d18b494374@pks.im> To: git@vger.kernel.org Cc: 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 Wed Dec 11 10:52:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13903340 Received: from fout-b8-smtp.messagingengine.com (fout-b8-smtp.messagingengine.com [202.12.124.151]) (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 C3D6D1EE7A5 for ; Wed, 11 Dec 2024 10:53:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733914398; cv=none; b=cVsL+0J0EipwnI8qKHGRxZjCI1PENFsvpR3P68HeIj/JFV+oOUgqtJu8Gj2029VMgFM+YBFtERAdUF1tB4eT64yB1S2f6OtAOHB8ysFtgQbxfuimvIc2g/H4jVNHH9AxSeCSrISjWVOZJ0cJmDXkfEWK+r4lS/cUhF5XIFcj3RM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733914398; c=relaxed/simple; bh=PubPMK/xlAbfwqm0gFtI8AC7UTzvva9hi4gTOgGxTCc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PYS6uugfyrJjytAyGm7qlwNd57Sr/Gcf8WKvSy0bkyuXIYnHD0Z+ZEE5ekMENKMTi/H31FkRPFajO4d5ckjhn57mHyU5SB9o+LFgGfqLG7GGZcMYtlVK4O5zqa3zIeBLKblI0rAufGXaQSlckotuRyaunlfX1YQ9sicMi7JPfVM= 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=FKCI2WQq; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=KIUBzmIS; arc=none smtp.client-ip=202.12.124.151 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="FKCI2WQq"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="KIUBzmIS" Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfout.stl.internal (Postfix) with ESMTP id 57CD31140272 for ; Wed, 11 Dec 2024 05:53:14 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Wed, 11 Dec 2024 05:53:14 -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=1733914394; x=1734000794; bh=r5dPuSt4sqmM6+TSZ4KtTwSpUcDDhyCGnxdpl2fd0l0=; b= FKCI2WQqavy9iVDUj8Ou8SM+ddaUCwlhyVbG/rNCFTd6I3viLtn/T5oDaFLp01jh 7aNTO+W5eEzIDRv4PWHmOFvm+Ym1DPG1TOU4/I7/Xw499UMYQ5miFpSxi+O4RMvE yL3cY1wh4gS6CXRvvh5SeqDaRVMnCYaAjqY/4STND4jJ60G+RETmQxmOoakpvU5p NroZu/QCMo6wkf+Q/F+mSVMy3oH5BQ31JWWUf0QyjdBPd2wQZBUMN7oGCcq6q93f Iu/Wbsg6zPxAw0HHrX4ceoyngqi7HsulH0fR4htoTDACGKp5a3EkstKEie/hwaLY IvxNH1IKfyRUnsQng9feRQ== 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=1733914394; x= 1734000794; bh=r5dPuSt4sqmM6+TSZ4KtTwSpUcDDhyCGnxdpl2fd0l0=; b=K IUBzmISsEksuMgCqnu3djUey/0HxKG9MZczXXxTJI27JmW9Fa3i0LUIv0MAXlJ+T ly57YYbvyjGo88LfTPUO4QPVAbi3kgww0k6WuaxYW7Z0LAEhfYifCwldLqQNJNJr s4gGRdAv/NoZ6j8xwRf14hjnTHwdWkCdlq8+eD09/T0LAKIFTJe9JhO8AKgrFt4/ 7rM/eJSZA62Xsq+7x9Aoahnk1tQt/zBwL0P6oZmu4Z4GfZ/ptME7M6w9z9zisfEj K/9jDEYkJuPcuKeCjAnziDZcC5Xjyl60tF3RiwAl9jI9d/ZYduuHy3LnRoHU4GQE fuuLTOS9CFwMekwfVuELg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrkedtgddvudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephfffufggtg fgkfhfjgfvvefosehtkeertdertdejnecuhfhrohhmpefrrghtrhhitghkucfuthgvihhn hhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrhhnpeefhfeugeelhe efjeektdffhedvhfdvteefgfdtudffudevveetgeeuuedtkefhgeenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpshesphhkshdrihhmpdhnsg gprhgtphhtthhopedupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehgihhtsehv ghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 11 Dec 2024 05:53:13 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 93f03aff (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 11 Dec 2024 10:51:36 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 11 Dec 2024 11:52:37 +0100 Subject: [PATCH 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: <20241211-pks-meson-ci-v1-6-28d18b494374@pks.im> References: <20241211-pks-meson-ci-v1-0-28d18b494374@pks.im> In-Reply-To: <20241211-pks-meson-ci-v1-0-28d18b494374@pks.im> To: git@vger.kernel.org Cc: 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" so that the unbuilt version of "git-p4.py" is used that has "#!/usr/bin/env python" as shebang instead of the replaced shebang. 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 | 48 ++++++++++++++------------- t/t9836-git-p4-metadata-encoding-python3.sh | 50 ++++++++++++++--------------- 2 files changed, 50 insertions(+), 48 deletions(-) diff --git a/t/t9835-git-p4-metadata-encoding-python2.sh b/t/t9835-git-p4-metadata-encoding-python2.sh index 036bf79c6674f6f1f0d667c7270674168428ffee..02f9ec09053890a4d41b7dc95644066d6481bbb6 100755 --- a/t/t9835-git-p4-metadata-encoding-python2.sh +++ b/t/t9835-git-p4-metadata-encoding-python2.sh @@ -14,23 +14,25 @@ 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 +83,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 +102,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 +116,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 +128,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 +140,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 +152,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 +164,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 +176,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 +188,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 +203,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 Wed Dec 11 10:52:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13903341 Received: from fout-b8-smtp.messagingengine.com (fout-b8-smtp.messagingengine.com [202.12.124.151]) (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 50D07205E06 for ; Wed, 11 Dec 2024 10:53:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733914398; cv=none; b=fX4KCFI8Ug1T0lw6hh8yO9GS8E4rWRuScjLuugXeHvKvf6/IQj+cixIi/LBpK1hch/0bFPtpddd4Nl47ObJvczfFbnVU6qe3yJPUMuE2SD3AT2z8OKnQ7SLK6GukC1sJ1HHKWz5kE0ECWjXIlw9qOyvg7p8f7kF+5iXOAMeC6+E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733914398; c=relaxed/simple; bh=XSwJkfL8brVX3JDF2SqAIRy395fK4ItTQF+8GaRyRpg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=E6gjkt05vFLOCto41slcuZuQNixh1/Mv73upuxn2eFZ7hKdXUlGds7zG3P8cMRW6xM59fYLe3ctAeIAGdrSx0B14pTbXDpGpJGyG2Z6b0pe+Y2DuLGJuUwuQlHSDBgnDeIPqwiRl/PcvdOS0m01qkuTgSGhQS5oIGwDpRSuI4xw= 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=J+mKtJtg; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=bwlgCt9H; arc=none smtp.client-ip=202.12.124.151 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="J+mKtJtg"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="bwlgCt9H" Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfout.stl.internal (Postfix) with ESMTP id 1C80B1140273 for ; Wed, 11 Dec 2024 05:53:15 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Wed, 11 Dec 2024 05:53:15 -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=1733914394; x=1734000794; bh=GCyrGhhkOfxO/mCdYHzifqxLVUeVVPSSLCeBPI/ZPUk=; b= J+mKtJtgVxIojvuvTcV5iP+AcAJGuGJ8HSa8KjE/3Ag1kzJe1u2oq5oolYM+7zyZ gbJDX+7/Sunk+n/tre8TPuGPXAA1msnCTFzTigWNlp30TJDUiHmMr+FYc/h5HgpS ZmGG9mSDW1jBW2+/XfcBeKiFDowuZ0W1FJQsE0VUqzJWv+RJmeu4iTmAlPpPnZQH A2qZzjMXV40WWYNlk3+awE8poDZYzpAYiJUv8lG3RL6VYa6LOS7os6uAYPHVd+yq esvgEEb9nCWP4fmx/olY7l3p0qpg6uzqhuTGjMQLTptYxjsvLrV/MQ8jigiPtSTP kbKHyQNwKj7m8uRYJF/S8g== 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=1733914394; x= 1734000794; bh=GCyrGhhkOfxO/mCdYHzifqxLVUeVVPSSLCeBPI/ZPUk=; b=b wlgCt9HxZVxdkk0lbqs8CAm89GU9BCtwDSh3AttkobjE99TzI8NV1Zxs+XDy/GPg 1dGp9tCBtEbBoin5Z5qUvV1yqVhdIIwu6tYC/gY1+N2fmPixgtCHDbHJI3cDyOPh ftlpWROkbJOuMmnjeKHxabKnC2395ByXUPZEKNOqIpT08foajbjCC5MP60Z5eq4c sHcORC7Yle+DMvzJtV0vbyScbyjXQmBYutcZSrJ500B5U+MP2AGsx9ggPjyNIVVq ZPG5XVlhpArmJySZZW8LxOtWtoUcib7LxJgLhegVFKMMy6r7ZeqLCLBZhEc2IzMe 7dDZyQ2kqracP4kqb2vxA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrkedtgddvudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephfffufggtg fgkfhfjgfvvefosehtjeertdertdejnecuhfhrohhmpefrrghtrhhitghkucfuthgvihhn hhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrhhnpeffueeiudejvd ekheeuvdekfeffiedvueelteekudehjeetkeegvddugfdtgfeileenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpshesphhkshdrihhmpdhnsg gprhgtphhtthhopedupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehgihhtsehv ghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 11 Dec 2024 05:53:14 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 1a51bc73 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 11 Dec 2024 10:51:37 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 11 Dec 2024 11:52:38 +0100 Subject: [PATCH 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: <20241211-pks-meson-ci-v1-7-28d18b494374@pks.im> References: <20241211-pks-meson-ci-v1-0-28d18b494374@pks.im> In-Reply-To: <20241211-pks-meson-ci-v1-0-28d18b494374@pks.im> To: git@vger.kernel.org Cc: 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. 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 Wed Dec 11 10:52:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13903342 Received: from fout-b8-smtp.messagingengine.com (fout-b8-smtp.messagingengine.com [202.12.124.151]) (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 7AA37208984 for ; Wed, 11 Dec 2024 10:53:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733914399; cv=none; b=elJ4FnLgzYuMLPip1o84x4mb2T1vpOtFh21JhRMumadb251gOrq9PFO/V5f1SCZRy6m/WOJ/TAkLSbA+NlAO2S+Wxr32h423yW59EPuWbcILNfzIZXRZlC4pQU+/DUdS60wkS6liPllKmOrvD3ZHb0KudY4l1ShabTCuUGKQ11c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733914399; c=relaxed/simple; bh=jvJKmqhtVzsJFRfZkkm0mpyp12nTCfCNrfO+1CY4OqQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QemmfxoSsbEQa/1re5z0QGYYzaxm7pXg7DaTIuo4xr7f9UT4wJC6v0izoNeTVRtqmimATEuZJnZUmJ+Yg5dbAxhSkRCw5yQ3K3SEPjfT6/nISNP/K5jRxc2p19ZJ79AV70G0cFBz718Imy7x7xraQm4AJPzmK4OF93FGvo3O7X4= 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=Zw5z8D9Q; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=V0WRc7qV; arc=none smtp.client-ip=202.12.124.151 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="Zw5z8D9Q"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="V0WRc7qV" Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfout.stl.internal (Postfix) with ESMTP id 587EE114026F for ; Wed, 11 Dec 2024 05:53:15 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Wed, 11 Dec 2024 05:53:15 -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=1733914395; x=1734000795; bh=6VPTb2hDuLONgTcQXQmdfS9gVHP09H05lKeiEzRER2Y=; b= Zw5z8D9QAagIH7LeLlTTpF6TO4h4kEkaTVussID3eUDQw+OiSFafXdC1MBg32tAN 8FxPtvcRSsQdOo8MAudwHhtVnRUwUGsVCWmM5MTh9AQGGVxzP3GtdUf9yJJZcFHB DH/4a4lyRkA1audYCsutWQcS7CoNcyK1JXb1WVaTfbl8dtVHHzi/RHGdCO0a7Aor RCSXw7+GNGSmyyWFZHD2NDn4etsMDdpPzXakhR3FgaNk+8PrKlXybcPWZDLTxBg3 C4/WXgHc6lScTP8s8SOliqK0UJcz7VKutsGd6IzGH0CiV6KaKZs2RcGZzCv7v6AA bLz0u6/U4XHiniVlhN9TOw== 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=1733914395; x= 1734000795; bh=6VPTb2hDuLONgTcQXQmdfS9gVHP09H05lKeiEzRER2Y=; b=V 0WRc7qV5jTgt4/UYiIXAzysalzpL0ZlmZW3iyK7lI8O9ecmJ9eYRV4+gyS5ZJUud PRu9YuYD0V2+8zdAKnr+67p3/63jOMNZegNdYsAVZAwioIZeuZCyBAk93xjbRFGX /pwpgbl+1zVP5XXz1bG6g5L+2uMAXUwMZFn6Qya29H1tVZtEJLZIe+fVJPFgqf3C UyUAvtM3vM9AX/Aqe5boVIf+22b8ADOCldqQXBi26v+MZ9KpbWkL1xDqQdv4uti6 WozVWSyYMeT5GrLfy+yEpPQeJm53hVs1EoGJQklu67Yi9PKnL45fBKcRixMtoBqY YXX+dwZDkoWtjvJg3ti+g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrkedtgddvudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecuogfvvgigthfqnhhlhidqqd etfeejfedqtdegucdlhedtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredt redtjeenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkh hsrdhimheqnecuggftrfgrthhtvghrnhepgeeggfelgfekhedvgeffleffkeekheduffef vdehgeeigeduhedukeelieevtdfgnecuffhomhgrihhnpehvvggtthhorhdrtggtnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkhhs rdhimhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoh epghhithesvhhgvghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 11 Dec 2024 05:53:14 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 89e31e0d (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 11 Dec 2024 10:51:38 +0000 (UTC) From: Patrick Steinhardt Date: Wed, 11 Dec 2024 11:52:39 +0100 Subject: [PATCH 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: <20241211-pks-meson-ci-v1-8-28d18b494374@pks.im> References: <20241211-pks-meson-ci-v1-0-28d18b494374@pks.im> In-Reply-To: <20241211-pks-meson-ci-v1-0-28d18b494374@pks.im> To: git@vger.kernel.org Cc: 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 | 9 +++++++++ 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, 49 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..8163aacc8c8715d09f19bd1cc7199532fb5141e2 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,10 @@ test:linux: image: fedora:latest - jobname: linux-musl image: alpine:latest + - jobname: linux-meson + image: ubuntu:latest + CC: gcc + CC_PACKAGE: gcc artifacts: paths: - t/failed-test-artifacts @@ -104,6 +110,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