From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 0K57FEIvwGN7QQEAbAwnHQ (envelope-from ) for ; Thu, 12 Jan 2023 17:03:14 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 0ItsFEIvwGNjRAEA9RJhRA (envelope-from ) for ; Thu, 12 Jan 2023 17:03:14 +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 1B93E1F0E7 for ; Thu, 12 Jan 2023 17:03:00 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFzzp-0005Ww-Nc; Thu, 12 Jan 2023 11:00:05 -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 1pFzzn-0005Ut-HW for guix-patches@gnu.org; Thu, 12 Jan 2023 11:00: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 1pFzzn-0002A3-3L for guix-patches@gnu.org; Thu, 12 Jan 2023 11:00:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pFzzm-0008TM-LG for guix-patches@gnu.org; Thu, 12 Jan 2023 11:00: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. Resent-From: pukkamustard Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 12 Jan 2023 16:00: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: Csepp Cc: julien@lepiller.eu, 59487@debbugs.gnu.org Received: via spool by 59487-submit@debbugs.gnu.org id=B59487.167353917932507 (code B ref 59487); Thu, 12 Jan 2023 16:00:02 +0000 Received: (at 59487) by debbugs.gnu.org; 12 Jan 2023 15:59:39 +0000 Received: from localhost ([127.0.0.1]:48407 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFzzP-0008SF-Ah for submit@debbugs.gnu.org; Thu, 12 Jan 2023 10:59:39 -0500 Received: from mout01.posteo.de ([185.67.36.65]:58479) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFzzN-0008Rz-5l for 59487@debbugs.gnu.org; Thu, 12 Jan 2023 10:59:38 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id BC82A240299 for <59487@debbugs.gnu.org>; Thu, 12 Jan 2023 16:59:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1673539170; bh=cgUBA8aZrMkypghjb/a+tbiM5j9wEJzk4ctmLvoQ7wI=; h=From:To:Cc:Subject:Date:From; b=OsvVRcsxHZpvO6cKhiJehn4+tE3/ovfwCLeUXjUBA14NRhXERQg12Pq0fdrnMgOQc pi++u8zLBpKNlOf8FSebFFhtQZ97ovy662shE1Bvfep+21urCpMwkDzLY6R1B0SycD rltZPMQFUfYFliehJTtuDh4Mc3WrgQlDuyOtc+BNeMixArmAC0IjKs71wlEc/h8rGL Be+Mk1fMczG5NT7yt8XEAgEnmKkgRVmQSdwib0CsYtQeHJhHDyi+LNcPGOGWbyf0ez yU/H1CvlZVArxcS56J0IeF03IdL3yd0f3kjfdxUxCClHgBWjixUML98zi1noXm/Efg Q9KfDVSm1UoSA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Nt8PY3YGfz6tnl; Thu, 12 Jan 2023 16:59:29 +0100 (CET) References: <20230111174003.2227-1-raingloom@riseup.net> From: pukkamustard Date: Thu, 12 Jan 2023 15:42:26 +0000 In-reply-to: <20230111174003.2227-1-raingloom@riseup.net> Message-ID: <86r0vzwxpb.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain 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=1673539380; a=rsa-sha256; cv=none; b=RShxNAK/jiHGz/bK1ARwTGHApgqqdpZofQC5tpIP3YDZ48PJe/vByGWvKN5wO9m39NVFiy +xedgOdZQevoCXsvb5koV5dIyp3UPhjLTev710LwFPMbizYRqNT0HkG5y+capN9nHudued RU1rxwgxbmPjHyqaL3v0WtLXxUQOyvD9gDbjW7iA+Zbru7G86bYi0MwG7Fzx8NoONg3fxV ZEhZLoHiXfK6jWlX4NCBg2fnuDuq6t7hQhm/Rdzw7a6GLQc5TMcXd3d4GNKCSc7rYh0ZO2 mV6X2pxWaQ56fkyn8Xgajt/8kvCA6QGyDmTeQawTcN88IV8cXiNUSk827HvAbg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=OsvVRcsx; 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 (strict)" header.from=posteo.net (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1673539380; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: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=akzNaQkbGNg5TEQX8XCwItZFNcRcW/pg0E39FJpBqXA=; b=usfmhCevscZuT3trq2eOWteI4/a2kS0uzquN+yd2aI0u5YaX8lCbsp5xtU37YfKya73vo0 6awb4dbZRm8YlphlCAtqJGyHi2FtnQtigu3Mzplswcr67yiw1SnnbigMFKSOxMtqPWegTl jBjzPDEIrBFS7nu5lTxOJ8jBC9+pGMd5pkN3HBNpBdhXXtWXYfStT63dgumzKuY4Ar14OY Ibph4Kdypy98gNl5+BU9Cu7EBLbemr62YfJxk5JP1Kkf1zn5Mg1EDrWWvtWAZBXoZ6p33W GDzr8nxUBOCDzhZMrhe6rIz/raOwMXLdwxmk/SiVPDeFjfWvPIIuDCrtmAQlvg== X-Migadu-Spam-Score: -0.70 X-Spam-Score: -0.70 X-Migadu-Queue-Id: 1B93E1F0E7 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=OsvVRcsx; 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 (strict)" header.from=posteo.net (policy=none) X-TUID: z4rZckF0YnjS Thanks for this! I think it is a valuable improvement. Csepp writes: > From: raingloom > > guix/build-system/dune.scm (dune-build): tests? defaults to #f. This should be: "test-target defaults to #f". > + (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) I think what Julien ment (and I agree) is that you can completely drop the checks for the files/directories "tests" or "test" to exist. In your patch, if test-target is #f and "test" or "tests" do not exist, then the we will run: `dune runtest -p package .` but we could (and maybe should) run just: `dune runtest -p package` In fact, we should run this even if the "test" or "tests" directories exist (otherwise we might miss running some tests placed in other directories). So this would be enough: > + (let ((program (if jbuild? "jbuilder" "dune"))) > + (apply invoke program "runtest" > + (append (if test-target (list test-target) '()) > + (if package (list "-p" package) > dune-release-flags) > test-flags))) Thinking of this, maybe we can drop the `test-target` argument completely. wdyt? -pukkamustard