From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id oMQmBpMnfWNlvQAAbAwnHQ (envelope-from ) for ; Tue, 22 Nov 2022 20:48:35 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id iG1QBZMnfWPPGQAAG6o9tA (envelope-from ) for ; Tue, 22 Nov 2022 20:48:35 +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 B5D6084D6 for ; Tue, 22 Nov 2022 20:48:34 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oxZFU-0004O0-G7; Tue, 22 Nov 2022 14:48: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 1oxZFS-0004N3-Sh for guix-patches@gnu.org; Tue, 22 Nov 2022 14:48:02 -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 1oxZFS-0005po-KX for guix-patches@gnu.org; Tue, 22 Nov 2022 14:48:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oxZFS-0000XC-8C for guix-patches@gnu.org; Tue, 22 Nov 2022 14:48:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59487] [PATCH 1/2] build-system/dune: Automatically deduce test-target in most cases. Resent-From: raingloom Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 22 Nov 2022 19:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59487 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59487@debbugs.gnu.org Cc: raingloom X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16691464691960 (code B ref -1); Tue, 22 Nov 2022 19:48:02 +0000 Received: (at submit) by debbugs.gnu.org; 22 Nov 2022 19:47:49 +0000 Received: from localhost ([127.0.0.1]:52579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxZFF-0000VX-2O for submit@debbugs.gnu.org; Tue, 22 Nov 2022 14:47:49 -0500 Received: from lists.gnu.org ([209.51.188.17]:58004) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxZFD-0000VL-KT for submit@debbugs.gnu.org; Tue, 22 Nov 2022 14:47:48 -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 1oxZFD-0004Lz-Dk for guix-patches@gnu.org; Tue, 22 Nov 2022 14:47:47 -0500 Received: from mx0.riseup.net ([198.252.153.6]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oxZF9-0005U6-ST for guix-patches@gnu.org; Tue, 22 Nov 2022 14:47:46 -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 4NGvtH43BLz9rxw for ; Tue, 22 Nov 2022 19:47:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1669146455; bh=KOrPrVRRbJ9wuWK618gzP/Z9eV0DUpzlQl1JWlD9XdA=; h=From:To:Cc:Subject:Date:From; b=rHVrrayravJKpirH+AAXLl2jhx18exzfobJIQIbZR+uXWBWXuJ0gZ20uF/38lLRc/ hVBVZABny6uLuOX6Pl2JNqyxMF4UWLwwzfwa88IcrsLkHxlcmKwbVlUx/exniOLkiU ebUoeBhyj3zpgO0sfRHdHD2v8sA38QkZzYE73IJc= X-Riseup-User-ID: 46E8C14D0E2B56ECBB778A21436A87928694784B40C4B7F2A8F4668325DE8623 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews2.riseup.net (Postfix) with ESMTPSA id 4NGvtG4z2rz21FS; Tue, 22 Nov 2022 19:47:34 +0000 (UTC) From: raingloom Date: Tue, 22 Nov 2022 20:47:11 +0100 Message-Id: <20221122194712.31515-1-raingloom@riseup.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=198.252.153.6; envelope-from=raingloom@riseup.net; helo=mx0.riseup.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1669146514; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=eHm2kF+MJ6SCtNICTh689hXNiCjSDXRiDi9TK4h6Jco=; b=KN3Ebx7OCk7qXU/Er+L6yHhMZkF0Qv6E3Nn8PKeAsNlSZrwUUm7zdhNfImQjoT+TCPHUz5 C6dRAQuYQXM0O8Pq2EFd1Abd3/GeGikqHJdKBOHo7G3/+iBYuq8WCmVXTFjSICvkLaV1Ta zLIOBx0tYqUM1hJBbJxoV3Putynkfwqzmq5x62oqaW2TPxlaAyTIGSwNoqAi2PvfMarU5a 4Px9taQcsqTk80JmQZH/An52PDUOv072ZwSqyEfImKYGNn9mUtGz0ET29Z1OmPiNSYbGkk ZCGn8BAKK31wmm/JxlFvRUAW5ROwrrp1arAFq7J1QxWU4WfM0qkgcMRK7xh1kQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1669146514; a=rsa-sha256; cv=none; b=bLh4IgVMjxBJbHIr09VylHZFxm05JNsN9RmUKkcEpKTkaukMFicCxcgvg0AmrKAci1fmXH NkPtYBaFwp6ec4haiwd5ZpjaQRuW553H2cA6YnrUjF8nVtxa94kO36y6Cm0lVa8tf4NtnG o9tNA/nVX5P1WbAkCrKTF0m65fUveiE3algTpNBW42lfNH4xKiV0LkDprKTf/JjyxBVSYE KfTXHShZ750c/rnU3/ldXfy/fnM+iuXb0OPIYVysMGUI68d1O1dhglzGKhRclSgumzfIhM cH8xoY7Li/jTtsLoUCYrgpopkrFXkUjRsVc2vyXhffwvVIUlW5H5zNbp7Nmeyw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=riseup.net header.s=squak header.b=rHVrrayr; dmarc=fail reason="SPF not aligned (relaxed)" header.from=riseup.net (policy=none); 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" X-Migadu-Spam-Score: 7.39 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=riseup.net header.s=squak header.b=rHVrrayr; dmarc=fail reason="SPF not aligned (relaxed)" header.from=riseup.net (policy=none); 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" X-Migadu-Queue-Id: B5D6084D6 X-Spam-Score: 7.39 X-Migadu-Scanner: scn0.migadu.com X-TUID: EwVpqfsw40ao 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 | 9 +++++++-- 2 files changed, 8 insertions(+), 3 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..8a3725a4e9 100644 --- a/guix/build/dune-build-system.scm +++ b/guix/build/dune-build-system.scm @@ -42,12 +42,17 @@ (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"))) + (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" test-target (append (if package (list "-p" package) dune-release-flags) -- 2.38.1