unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#59487] [PATCH 1/2] build-system/dune: Automatically deduce test-target in most cases.
@ 2022-11-22 19:47 raingloom
  2022-11-22 19:47 ` [bug#59488] [PATCH 2/2] gnu: Remove explicit test-target arguments in ocaml.scm raingloom
                   ` (4 more replies)
  0 siblings, 5 replies; 20+ messages in thread
From: raingloom @ 2022-11-22 19:47 UTC (permalink / raw)
  To: 59487; +Cc: 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 | 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





^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2023-01-28 12:24 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-22 19:47 [bug#59487] [PATCH 1/2] build-system/dune: Automatically deduce test-target in most cases raingloom
2022-11-22 19:47 ` [bug#59488] [PATCH 2/2] gnu: Remove explicit test-target arguments in ocaml.scm raingloom
2023-01-28 12:23   ` bug#59488: " Julien Lepiller
2022-11-22 20:26 ` [bug#59487] [PATCH 1/2] build-system/dune: Automatically deduce test-target in most cases Julien Lepiller
2023-01-10 20:24 ` pukkamustard
2023-01-11 17:41   ` Csepp
2023-01-11 17:40 ` [bug#59487] [PATCH v2 " Csepp
2023-01-11 17:40   ` [bug#59487] [PATCH v2 2/2] gnu: Remove explicit test-target arguments in ocaml.scm Csepp
2023-01-12 15:42   ` [bug#59487] [PATCH v2 1/2] build-system/dune: Automatically deduce test-target in most cases pukkamustard
2023-01-12 18:44     ` pukkamustard
2023-01-12 19:39     ` Csepp
2023-01-12 21:20       ` Csepp
2023-01-13 10:54 ` [bug#59487] [PATCH v3 0/6] guix: dune-build-system: Run all tests pukkamustard
2023-01-13 10:54   ` [bug#59487] [PATCH v3 1/6] gnu: Add ocaml-cinaps pukkamustard
2023-01-13 10:54   ` [bug#59487] [PATCH v3 2/6] gnu: ocaml-ppxlib: Clean up inputs pukkamustard
2023-01-13 10:54   ` [bug#59487] [PATCH v3 3/6] gnu: ocaml-cohttp: Run tests pukkamustard
2023-01-13 10:54   ` [bug#59487] [PATCH v3 4/6] guix: dune-build-system: Run all tests pukkamustard
2023-01-13 10:54   ` [bug#59487] [PATCH v3 5/6] guix: dune-build-system: Remove usage of test-target argument pukkamustard
2023-01-13 10:54   ` [bug#59487] [PATCH v3 6/6] gnu: ocaml-ppx-expect: Disable tests pukkamustard
2023-01-15 15:02   ` bug#59487: [PATCH v3 0/6] guix: dune-build-system: Run all tests Julien Lepiller

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).