GNU bug report logs - #59980
[PATCH v2 1/2] build-system/dune: Automatically deduce test-target in most cases.

Previous Next

Package: guix-patches;

Reported by: raingloom <raingloom <at> riseup.net>

Date: Mon, 12 Dec 2022 00:09:02 UTC

Severity: normal

Tags: patch

Done: Julien Lepiller <julien <at> lepiller.eu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 59980 in the body.
You can then email your comments to 59980 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#59980; Package guix-patches. (Mon, 12 Dec 2022 00:09:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to raingloom <raingloom <at> riseup.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 12 Dec 2022 00:09:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: raingloom <raingloom <at> riseup.net>
To: guix-patches <at> gnu.org
Cc: raingloom <raingloom <at> riseup.net>, 59487 <at> debbugs.gnu.org
Subject: [PATCH v2 1/2] build-system/dune: Automatically deduce test-target in
 most cases.
Date: Mon, 12 Dec 2022 00:07:46 +0000
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





Information forwarded to guix-patches <at> gnu.org:
bug#59980; Package guix-patches. (Sat, 28 Jan 2023 12:29:02 GMT) Full text and rfc822 format available.

Message #8 received at 59980 <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: raingloom <raingloom <at> riseup.net>
Cc: 59487-close <at> debbugs.gnu.org, 59980 <at> debbugs.gnu.org
Subject: Re: [bug#59980] [PATCH v2 1/2] build-system/dune: Automatically
 deduce test-target in most cases.
Date: Sat, 28 Jan 2023 13:28:39 +0100
Closing since a similar patch was pushed already. Thanks!




Reply sent to Julien Lepiller <julien <at> lepiller.eu>:
You have taken responsibility. (Sat, 28 Jan 2023 12:30:02 GMT) Full text and rfc822 format available.

Notification sent to raingloom <raingloom <at> riseup.net>:
bug acknowledged by developer. (Sat, 28 Jan 2023 12:30:02 GMT) Full text and rfc822 format available.

Message #13 received at 59980-close <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: raingloom <raingloom <at> riseup.net>
Cc: 59980-close <at> debbugs.gnu.org, 59981-close <at> debbugs.gnu.org
Subject: Re: [bug#59980] [PATCH v2 1/2] build-system/dune: Automatically
 deduce test-target in most cases.
Date: Sat, 28 Jan 2023 13:29:22 +0100
Actually closing the right ones...




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 26 Feb 2023 12:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 31 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.