From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 mLkEImdiwGPAOAAAbAwnHQ (envelope-from ) for ; Thu, 12 Jan 2023 20:41:27 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 3SX0IWdiwGOt8AAAauVa8A (envelope-from ) for ; Thu, 12 Jan 2023 20:41:27 +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 3ABF1133FD for ; Thu, 12 Jan 2023 20:41:27 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pG3Rl-0000gs-PP; Thu, 12 Jan 2023 14:41:09 -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 1pG3Rh-0000gZ-VV for guix-patches@gnu.org; Thu, 12 Jan 2023 14:41:05 -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 1pG3Re-0003tG-TP for guix-patches@gnu.org; Thu, 12 Jan 2023 14:41:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pG3Re-0008Fn-Ej for guix-patches@gnu.org; Thu, 12 Jan 2023 14:41: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: Csepp Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 12 Jan 2023 19:41: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: pukkamustard Cc: julien@lepiller.eu, Csepp , 59487@debbugs.gnu.org Received: via spool by 59487-submit@debbugs.gnu.org id=B59487.167355246031711 (code B ref 59487); Thu, 12 Jan 2023 19:41:02 +0000 Received: (at 59487) by debbugs.gnu.org; 12 Jan 2023 19:41:00 +0000 Received: from localhost ([127.0.0.1]:48644 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pG3Rc-0008FO-2t for submit@debbugs.gnu.org; Thu, 12 Jan 2023 14:41:00 -0500 Received: from mx1.riseup.net ([198.252.153.129]:35606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pG3RZ-0008F5-Sc for 59487@debbugs.gnu.org; Thu, 12 Jan 2023 14:40:58 -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 mx1.riseup.net (Postfix) with ESMTPS id 4NtFK00bJNzDrc5; Thu, 12 Jan 2023 19:40:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1673552452; bh=orUvSX3lgn+DQ6BUT0uNpi7+avRzonvZXJDy9UkxLBM=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=jr0kyKRrzKl7i6EfypMIAxZtwsH4sYx4feh0vMpu2woTXTL0UjWRLMYlb7aosvq4a 5s1DlVwcE8eNJkFsPXdcnfnJv4oPjJyuQZcWRoelI4KcyIj1wFQqeSivxG0/vQGFyk xpYblNnD1hjUF22ED3s0D+p9dWV8zFv+ReKYIOOU= X-Riseup-User-ID: 84EECACB410AE88F7FBEF261B6D3546D54B720F3CE343A7E76A6D5A350AB0FEB Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews2.riseup.net (Postfix) with ESMTPSA id 4NtFJz1FjJz1yQc; Thu, 12 Jan 2023 19:40:50 +0000 (UTC) References: <20230111174003.2227-1-raingloom@riseup.net> <86r0vzwxpb.fsf@posteo.net> From: Csepp Date: Thu, 12 Jan 2023 20:39:48 +0100 In-reply-to: <86r0vzwxpb.fsf@posteo.net> Message-ID: <86mt6npmmb.fsf@riseup.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-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=riseup.net header.s=squak header.b=jr0kyKRr; 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-Seal: i=1; s=key1; d=yhetil.org; t=1673552487; a=rsa-sha256; cv=none; b=rmaZzMraKlyE9YQnK6EFuAFjQBi1NQqTiYDEwqIxrWqfe9N1go2gQAuE8D7j+LVR/XJkGe rfgSuG7oQozlVxsK9F3PoWBXIRq8nbk473P4u5TLC3DMP0Hi60pP+NBHpcCiAHSkI3f1Vt ZUI7IfELd3Zei80kVe9DYbDGvbMBRH/yqcmhuBSRIEdyoQPmstMD8QmEXL+1wvkV0DOu0H IUnveiHYoQDWCNeEjtdMl/3JwJm57RTkHvaG4P57iaw7IzVHCWOvf5cuTMCtHV1qH+/+5u pWX8DrT4tjwuxzHJUpF/Gkee21EGUD2/WPgoiZg+rRg62r5UGx/czVwyQ6Xv9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1673552487; 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=R03BBsrtxPUblJHqZCv2DX2MTqAKKT+yM0GTg6uHOO4=; b=q+BF6GOQKSVhh5h6eFttEquanJZs7Q3O2ubsoYMKJOlyet/Pr3lfANjCqFMpECdM3vbURx +f9WETh3amnqNuJTzL2+x/Ta5medneiGIZZx0Lp3b7gqccra5xjosPqkG696EsOZiGwtRd Gkq1NepqBOscwKXzyGfRKcONGrpE81STGSdTmnIt0CdlPnkGAbjILXQgIWAwVFlSx0wYY4 s67C8qCSk9/LzM27zTv1yDUBWgIybZVAToYmWiEMVTMSSPYSOqRUzLsLxnMcwBPI/Xi7RZ jY3nSI8vKJ6uqCrniw9ZWNAPA2mXMNL92QnuUBx9P2XCN5/FM3acTmQAn1f/bw== X-Migadu-Queue-Id: 3ABF1133FD X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=riseup.net header.s=squak header.b=jr0kyKRr; 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-Migadu-Spam-Score: -1.00 X-Spam-Score: -1.00 X-TUID: LNUVMwoVvq6v pukkamustard writes: > 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 Hmm, makes sense. I'll test what complete removal does.