From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id PJ1DLQb1vmPyTAEAbAwnHQ (envelope-from ) for ; Wed, 11 Jan 2023 18:42:30 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id SIeVLAb1vmP9FQEA9RJhRA (envelope-from ) for ; Wed, 11 Jan 2023 18:42:30 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BC5F73D71F for ; Wed, 11 Jan 2023 18:42:29 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFf6y-0004Rb-GW; Wed, 11 Jan 2023 12:42:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFf6x-0004R7-1R for guix-patches@gnu.org; Wed, 11 Jan 2023 12:42:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pFf6w-0003TQ-PX for guix-patches@gnu.org; Wed, 11 Jan 2023 12:42:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pFf6w-0003zO-44 for guix-patches@gnu.org; Wed, 11 Jan 2023 12:42:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59487] [PATCH v2 1/2] build-system/dune: Automatically deduce test-target in most cases. References: <20221122194712.31515-1-raingloom@riseup.net> In-Reply-To: <20221122194712.31515-1-raingloom@riseup.net> Resent-From: Csepp Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 11 Jan 2023 17:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59487 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59487@debbugs.gnu.org Cc: pukkamustard@posteo.net, julien@lepiller.eu, raingloom Received: via spool by 59487-submit@debbugs.gnu.org id=B59487.167345888415283 (code B ref 59487); Wed, 11 Jan 2023 17:42:02 +0000 Received: (at 59487) by debbugs.gnu.org; 11 Jan 2023 17:41:24 +0000 Received: from localhost ([127.0.0.1]:43744 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFf6K-0003yQ-06 for submit@debbugs.gnu.org; Wed, 11 Jan 2023 12:41:24 -0500 Received: from mx0.riseup.net ([198.252.153.6]:44040) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFf6G-0003y7-WA for 59487@debbugs.gnu.org; Wed, 11 Jan 2023 12:41:22 -0500 Received: from fews2.riseup.net (fews2-pn.riseup.net [10.0.1.84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.riseup.net", Issuer "R3" (not verified)) by mx0.riseup.net (Postfix) with ESMTPS id 4NsZjC53zlz9t3R; Wed, 11 Jan 2023 17:41:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1673458874; bh=8myVtA7BO+0L3imw092NC/7eC9+S5eFMkhqvikuzLDw=; h=From:To:Cc:Subject:Date:From; b=oE5TTYPbpuGwCR942vt4Q421ZFs6K7/UWV6oKLK82FfbtDZrOr1pdYUsCJs8USKYP 52AIU1NH6HcRqEoAHGzKStv8Ep/ErWR1ZO0uLzEoSCnNSWySGTwIiN03iDQ9gnijn2 36Jew9jZEW6SMax24UHKZp4oZlx9i4rYzlQxhNik= X-Riseup-User-ID: 54FEE4A9EB7EBF7F213A547D3B1BAF8A10EE0DDF9F1D5E593F8EE3E664648FE0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews2.riseup.net (Postfix) with ESMTPSA id 4NsZj970nMz1yZp; Wed, 11 Jan 2023 17:41:01 +0000 (UTC) From: Csepp Date: Wed, 11 Jan 2023 18:40:02 +0100 Message-Id: <20230111174003.2227-1-raingloom@riseup.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1673458950; a=rsa-sha256; cv=none; b=iPvydbRY36hsXqY9HTyZGB/HbHHkYbwFYB4MF/lxU1RoCFX/Gu4yhqLmD3Ev2TOyhwC9A9 jK5spDH1PCqSV1D5QR8ZACrFekkWAfkDrY9+LruO0Ge3uU51TWpIvzrk6Reu1z1UavCJLk RjsrOQd4hZ6xPhWF2RDHjL7FhFraBUDEAo0izd1nuOxFjrXJqMrRcve37n2qxz2Rn6fesH oGYjpaW8a+z+cVXXdFVgFGK3KWODMNXaBZKV5NOh4TFYwjOWYbYmFYOGstM20OWCFT/5VI x3Ep1IIPSxw10+5J0NgrN4hL8DV3EP8sIipQYmW2/SKu6oKPpTh7LQ/N/fcC+A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=riseup.net header.s=squak header.b=oE5TTYPb; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=riseup.net (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1673458950; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=eKyKItEH7Af27AWFoWwI23QQVOxsa9rEDNDh8UN74xM=; b=ZqVbrltAQtM+BeHJX8wqsjOECcJk4rU2REMkvpaz5xSwcMJA5wEVX/Qpy2nflgfaoIRjCT 0rq+Go6JEeIRWsdx4ROxkUKc8xzoxVwyCxY8K5qhNua01DCGSEVRlYovyxzWS+vt0wEd2/ iWdEpdGaKeqmd0nlt5OqUBXOxgSCrsm/laB1EGVUrm6q4JDBjtpffq682JsqpziekL5AhC 9D7dYrmjcw8yb0cs9/e887ckOJAyMfVu28L1yntgADMJhe/xKQpjQ+Mr7ryL5p+1PANC2G rF2UIABlGRQGqwDbIMMmkCU1jH+MkupLGoXuylFVJHmkWLu4SOk9X1bMasQfdw== X-Migadu-Spam-Score: -0.59 X-Spam-Score: -0.59 X-Migadu-Queue-Id: BC5F73D71F X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=riseup.net header.s=squak header.b=oE5TTYPb; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=riseup.net (policy=none) X-TUID: V4NDhb7WmPEO From: raingloom guix/build-system/dune.scm (dune-build): tests? defaults to #f. guix/build/dune-build-system.scm (check): Missing test-target is auto-detected. --- guix/build-system/dune.scm | 2 +- guix/build/dune-build-system.scm | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/guix/build-system/dune.scm b/guix/build-system/dune.scm index 12100fd8e8..b531d3c337 100644 --- a/guix/build-system/dune.scm +++ b/guix/build-system/dune.scm @@ -107,7 +107,7 @@ (define* (dune-build name inputs (dune-release-flags ''()) (tests? #t) (test-flags ''()) - (test-target "test") + (test-target #f) (install-target "install") (validate-runpath? #t) (patch-shebangs? #t) diff --git a/guix/build/dune-build-system.scm b/guix/build/dune-build-system.scm index e9ccc71057..e1337a3f82 100644 --- a/guix/build/dune-build-system.scm +++ b/guix/build/dune-build-system.scm @@ -42,14 +42,20 @@ (define* (build #:key (build-flags '()) (jbuild? #f) build-flags))) #t) -(define* (check #:key (test-flags '()) (test-target "test") tests? +(define* (check #:key (test-flags '()) (test-target #f) tests? (jbuild? #f) (package #f) (dune-release-flags '()) #:allow-other-keys) "Test the given package." (when tests? - (let ((program (if jbuild? "jbuilder" "dune"))) - (apply invoke program "runtest" test-target - (append (if package (list "-p" package) + (let ((program (if jbuild? "jbuilder" "dune")) + (test-target (or test-target + (cond + ((file-exists? "tests") "tests") + ((file-exists? "test") "test") + (else "."))))) + (apply invoke program "runtest" + (append (if test-target (list test-target) '()) + (if package (list "-p" package) dune-release-flags) test-flags)))) #t) -- 2.38.1