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
  2022-11-22 20:26 ` [bug#59487] [PATCH 1/2] build-system/dune: Automatically deduce test-target in most cases Julien Lepiller
  0 siblings, 2 replies; 3+ 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] 3+ messages in thread

* [bug#59488] [PATCH 2/2] gnu: Remove explicit test-target arguments in ocaml.scm.
  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 ` raingloom
  2022-11-22 20:26 ` [bug#59487] [PATCH 1/2] build-system/dune: Automatically deduce test-target in most cases Julien Lepiller
  1 sibling, 0 replies; 3+ messages in thread
From: raingloom @ 2022-11-22 19:47 UTC (permalink / raw)
  To: 59488; +Cc: raingloom

gnu/packages/ocaml.scm: Delete test-target if it's ".", "test", or "tests".
---
 gnu/packages/ocaml.scm | 129 +++++++++++------------------------------
 1 file changed, 33 insertions(+), 96 deletions(-)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 96659632bf..cc41fc1648 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -603,8 +603,6 @@ (define-public ocaml-cudf
                (base32
                 "1lvrmpscbk1kjv5ag5bzlzv520xk5zw2haf6q7chvz98gcm9g0hk"))))
     (build-system dune-build-system)
-    (arguments
-     '(#:test-target "."))
     (propagated-inputs (list ocaml-extlib))
     (native-inputs (list ocaml-ounit2))
     (home-page "https://www.mancoosi.org/cudf/")
@@ -794,8 +792,7 @@ (define-public opam
                 "1mw535zsw7xlvpgwnk1dan76z3f7lh5imlg0s6kdyhfg0iqisjd7"))))
     (build-system dune-build-system)
     (arguments
-     `(#:test-target "."
-       #:phases
+     `(#:phases
        (modify-phases %standard-phases
          (add-before 'build 'pre-build
            (lambda* (#:key inputs make-flags #:allow-other-keys)
@@ -1629,8 +1626,6 @@ (define-public ocaml-qcheck
        (sha256
         (base32 "0g3r8lrw6fsdphgpnp08saxyxk1vd3chpmb564ir2qnsp716vz6z"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "."))
     (propagated-inputs
      (list ocaml-alcotest ocaml-ounit))
     (native-inputs
@@ -1674,8 +1669,6 @@ (define-public ocaml-qtest
                (base32
                 "04ghjshh6104xyglm0db9kv90m62qla5f4bfrlndv6dsvgw3rdjl"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "tests"))
     (propagated-inputs
      `(("ounit" ,ocaml-ounit)
        ("qcheck" ,ocaml-qcheck)))
@@ -1701,8 +1694,6 @@ (define-public ocaml-stringext
                (base32
                 "1m09cmn3vrk3gdm60fb730qsygcfyxsyv7gl9xfzck08q1x2x9qx"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "."))
     (native-inputs
      `(("ocamlbuild" ,ocamlbuild)
        ("qtest" ,ocaml-qtest)))
@@ -1942,8 +1933,7 @@ (define-public ocaml4.07-ppx-tools-versioned
                   "07lnj4yzwvwyh5fhpp1dxrys4ddih15jhgqjn59pmgxinbnddi66"))))
       (build-system dune-build-system)
       (arguments
-       `(#:test-target "."
-         #:package "ppx_tools_versioned"))
+       `(#:package "ppx_tools_versioned"))
       (propagated-inputs
        (list ocaml-migrate-parsetree))
       (properties `((upstream-name . "ppx_tools_versioned")))
@@ -2062,8 +2052,7 @@ (define-public ocaml-result
                 "166laj8qk7466sdl037c6cjs4ac571hglw4l5qpyll6df07h6a7q"))))
     (build-system dune-build-system)
     (arguments
-     `(#:test-target "."
-       #:dune ,dune-bootstrap))
+     `(#:dune ,dune-bootstrap))
     (properties `((ocaml4.09-variant . ,(delay ocaml4.09-result))))
     (home-page "https://github.com/janestreet/result")
     (synopsis "Compatibility Result module")
@@ -2077,8 +2066,7 @@ (define-public ocaml4.09-result
     (inherit ocaml-result)
     (name "ocaml4.09-result")
     (arguments
-     `(#:test-target "."
-       #:dune ,ocaml4.09-dune-bootstrap
+     `(#:dune ,ocaml4.09-dune-bootstrap
        #:ocaml ,ocaml-4.09
        #:findlib ,ocaml4.09-findlib))))
  
@@ -2215,8 +2203,7 @@ (define-public ocaml-csv
          "0y2hlqlmqs7r4y5mfzc5qdv7gdp3wxbwpz458vf7fj4593vg94cf"))))
     (build-system dune-build-system)
     (arguments
-     `(#:package "csv"
-       #:test-target "."))
+     `(#:package "csv"))
     (home-page "https://github.com/Chris00/ocaml-csv")
     (synopsis "Pure OCaml functions to read and write CSV")
     (description
@@ -2454,7 +2441,6 @@ (define-public ocaml-alcotest
     (build-system dune-build-system)
     (arguments
      `(#:package "alcotest"
-       #:test-target "."
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'fix-test-format
@@ -2499,8 +2485,7 @@ (define-public ocaml4.07-alcotest
                  (base32
                   "1frwi185z4aadmaf0vp8xk5227nyg7nmh28ijj5l7ncjr5slvhz8"))))
       (arguments
-       `(#:package "alcotest"
-         #:test-target "."))
+       `(#:package "alcotest"))
       (properties '()))))
 
 (define-public ocaml-ppx-tools
@@ -2573,8 +2558,6 @@ (define-public ocaml-ssl
         (sha256 (base32
                   "1bg5vagklq6yfxsvcnj2i76xis8hb59088hkic82smyrxdjd1kjs"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "."))
     (native-inputs
      (list autoconf automake ocaml-alcotest which))
     (propagated-inputs (list openssl))
@@ -2905,8 +2888,7 @@ (define-public ocaml-gen
                 "1z5nw5wljvcqp8q07h336bbvf9paynia0jsdh4486hlkbmr1ask1"))))
     (build-system dune-build-system)
     (arguments
-     `(#:package "gen"
-       #:test-target "."))
+     `(#:package "gen"))
     (propagated-inputs
      (list ocaml-odoc ocaml-seq))
     (native-inputs
@@ -3166,8 +3148,6 @@ (define-public ocaml-ocp-indent
          (base32
           "1dvcl108ir9nqkk4mjm9xhhj4p9dx9bmg8bnms54fizs1x3x8ar3"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "tests"))
     (propagated-inputs
      (list ocaml-cmdliner))
     (home-page "https://www.typerex.org/ocp-indent.html")
@@ -3391,7 +3371,6 @@ (define-public ocaml-benchmark
         (sha256
          (base32 "0d0vdfjgjzf1y6wkd714d8b0piv1z9qav5ahsapynqzk4b4ahhnp"))))
     (build-system dune-build-system)
-    (arguments `(#:test-target "tests"))
     (home-page "https://github.com/Chris00/ocaml-benchmark")
     (synopsis "Benchmark running times of code")
     (description
@@ -3708,8 +3687,6 @@ (define-public ocaml-re
        (sha256
         (base32 "1g0vmpx6ylv8m0w77zarn215pgb4czc6gcpb2fi5da1s307zwr0w"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "."))
     (propagated-inputs
      (list ocaml-seq))
     (native-inputs
@@ -3732,8 +3709,7 @@ (define-public ocaml4.07-re
     (package
       (inherit ocaml-re)
       (arguments
-       `(#:test-target "."
-         #:phases
+       `(#:phases
          (modify-phases %standard-phases
            (add-after 'unpack 'fix-dune-version
              (lambda _
@@ -3754,8 +3730,6 @@ (define-public ocaml-ocplib-endian
                 "1klj4g451s7m5r8bxmwc1rpvngpqdm40csnx9smgc06pwy2fax2c"))
               (file-name (git-file-name name version))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "tests"))
     (native-inputs
      `(("cppo" ,ocaml-cppo)))
     (home-page "https://github.com/OCamlPro/ocplib-endian")
@@ -3782,8 +3756,7 @@ (define-public ocaml-cstruct
                 "0dpbirs6lzp0bclr3wcw407jjspll7iy66z18zks3mjccvlxd21w"))))
     (build-system dune-build-system)
     (arguments
-     `(#:package "cstruct"
-       #:test-target "."))
+     `(#:package "cstruct"))
     (propagated-inputs
      (list ocaml-bigarray-compat))
     (native-inputs
@@ -3826,8 +3799,6 @@ (define-public ocaml-hex
                (base32
                 "0xnl5wxd2qrba7phm3mdrjwd2kk26kb17dv94ciwp49ljcj28qc1"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "."))
     (propagated-inputs
      `(("ocaml-bigarray-compat" ,ocaml-bigarray-compat)
        ("cstruct" ,ocaml-cstruct)))
@@ -3851,8 +3822,7 @@ (define-public ocaml-ezjsonm
         (base32 "004knljxqxn9zq0rnq7q7wxl4nwlzydm8p9f5cqkl8il5yl5zkjm"))))
     (build-system dune-build-system)
     (arguments
-     `(#:package "ezjsonm"
-       #:test-target "."))
+     `(#:package "ezjsonm"))
     (native-inputs (list ocaml-alcotest js-of-ocaml node))
     (propagated-inputs (list ocaml-jsonm ocaml-uutf ocaml-sexplib0 ocaml-hex))
     (home-page "https://github.com/mirage/ezjsonm/")
@@ -3879,8 +3849,7 @@ (define-public ocaml-uri
         (base32
          "1bgkc66cq00mgnkz3i535srwzwc4cpdsv0mly5dzvvq33451xwf0"))))
     (build-system dune-build-system)
-    (arguments '(#:package "uri"
-                 #:test-target "."))
+    (arguments '(#:package "uri"))
     (propagated-inputs
      (list ocaml-stringext ocaml-angstrom))
     (native-inputs
@@ -3906,8 +3875,7 @@ (define-public ocaml4.07-uri
         (base32 "1ppbav41mszpjcl0zi3fyg958cxyfs57i7kvha4ds9ydn89bjmrh"))))
     (build-system dune-build-system)
     (arguments
-     `(#:test-target "."
-       #:phases
+     `(#:phases
        (modify-phases %standard-phases
          (add-before 'build 'update-deprecated
            (lambda _
@@ -4330,8 +4298,6 @@ (define-public ocaml-zed
            ocaml-uucp
            ocaml-uuseg
            ocaml-odoc))
-    (arguments
-     `(#:test-target "."))
     (properties `((ocaml4.07-variant . ,(delay ocaml4.07-zed))))
     (synopsis "Abstract engine for text edition in OCaml")
     (description
@@ -4379,8 +4345,6 @@ (define-public ocaml-lambda-term
                (base32
                 "1pkamblc6h0rsbk901cqn3xr9gqa3g8wrwyx5zryaqvb2xpbhp8b"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "."))
     (propagated-inputs
      (list ocaml-logs
            ocaml-lwt
@@ -4434,8 +4398,6 @@ (define-public ocaml-utop
        (sha256
         (base32 "1pcix3h9f7is06581iax4i08zkd6sv8y5hy1vvxhqhcsd9z0qfl3"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "."))
     (native-inputs
      (list ocaml-cppo))
     (propagated-inputs
@@ -4490,8 +4452,6 @@ (define-public ocaml-ansiterminal
                (base32
                 "052qnc23vmxp90yympjz9q6lhqw98gs1yvb3r15kcbi1j678l51h"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "tests"))
     (properties `((upstream-name . "ANSITerminal")))
     (home-page "https://github.com/Chris00/ANSITerminal")
     (synopsis
@@ -4843,8 +4803,6 @@ (define-public ocaml-bindlib
         (base32
          "1viyws3igy49hfaj4jaiwm4iggck9zdn7r3g6kh1n4zxphqk57yk"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "."))
     (native-inputs
      (list ocamlbuild ocaml-findlib))
     (home-page "https://rlepigre.github.io/ocaml-bindlib/")
@@ -4871,8 +4829,6 @@ (define-public ocaml-earley
         (base32
          "1vi58zdxchpw6ai0bz9h2ggcmg8kv57yk6qbx82lh47s5wb3mz5y"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "."))
     (propagated-inputs
      (list ocaml-stdlib-shims))
     (synopsis "Parsing library based on Earley Algorithm")
@@ -4897,8 +4853,6 @@ (define-public ocaml-timed
                 "1aqmkpjv5jk95lc2m3qyyrhw8ra7n9wj8pv3bfc83l737zv0hjn1"))
               (file-name (git-file-name name version))))
     (build-system dune-build-system)
-    (arguments
-     '(#:test-target "."))
     (synopsis "Timed references for imperative state")
     (description "Timed references for imperative state.  This module provides
 an alternative type for references (or mutable cells) supporting undo/redo
@@ -4963,8 +4917,7 @@ (define-public ocaml-yojson
          "1habsh00ihjhk1g1csxqg3hj8izk5zvgc7wm579wyjw35vzcmwr1"))))
     (build-system dune-build-system)
     (arguments
-     `(#:test-target "."
-       #:package "yojson"))
+     `(#:package "yojson"))
     (propagated-inputs (list ocaml-seq))
     (native-inputs (list ocaml-alcotest ocaml-cppo))
     (synopsis "Low-level JSON library for OCaml")
@@ -5050,8 +5003,7 @@ (define-public ocaml-gsl
          "1l5zkkkg8sglsihrbf10ivq9s8xzl1y6ag89i4jqpnmi4m43fy34"))))
     (build-system dune-build-system)
     (arguments
-     `(#:test-target "."
-       #:phases
+     `(#:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'fix-gsl-directory
            (lambda* (#:key inputs #:allow-other-keys)
@@ -5421,8 +5373,6 @@ (define-public ocaml-ppx-deriving
         (base32
          "1wqcnw4wi6pfjjhixpakckm03dpj990259za432804471a6spm2j"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "."))
     (propagated-inputs
      (list ocaml-ppx-derivers ocaml-ppxlib ocaml-result))
     (native-inputs
@@ -6468,7 +6418,6 @@ (define-public ocaml-ppx-cold
      (janestreet-origin "ppx_cold" version
                         "13gqmfw2sq80anag9bwpm35600l1fnfn7mh9cbj1291k84rsx7wb"))
     (build-system dune-build-system)
-    (arguments `(#:test-target "tests"))
     (propagated-inputs
      (list ocaml-base ocaml-ppxlib))
     (properties `((upstream-name . "ppx_cold")))
@@ -6630,8 +6579,6 @@ (define-public ocaml-ppx-typerep-conv
         (sha256
           (base32 "1q1lzykpm83ra4l5jh4rfddhd3c96kx4s4rvx0w4b51z1qk56zam"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "."))
     (propagated-inputs (list ocaml-base ocaml-typerep ocaml-ppxlib))
     (properties `((upstream-name . "ppx_typerep_conv")
                   (ocaml4.07-variant . ,(delay ocaml4.07-ppx-typerep-conv))))
@@ -6697,8 +6644,6 @@ (define-public ocaml-ppx-stable
        (sha256
         (base32 "1as0v0x8c9ilyhngax55lvwyyi4a2wshyan668v0f2s1608cwb1l"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "tests"))
     (propagated-inputs (list ocaml-base ocaml-ppxlib))
     (properties `((upstream-name . "ppx_stable")))
     (home-page "https://github.com/janestreet/ppx_stable")
@@ -6716,8 +6661,6 @@ (define-public ocaml-ppx-base
       "ppx_base" version
       "181w7y2has8jsrqdsvd08q5nhnkx523vwsk3lg0cjix55qssvfyn"))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "."))
     (propagated-inputs
      (list ocaml-ppx-compare
            ocaml-ppx-cold
@@ -6873,8 +6816,6 @@ (define-public ocaml-ppx-disable-unused-warnings
         (sha256
           (base32 "0sb5i4v7p9df2bxk66rjs30k9fqdrwsq1jgykjv6wyrx2d9bv955"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "tests"))
     (propagated-inputs (list ocaml-base ocaml-ppxlib))
     (properties `((upstream-name . "ppx_disable_unused_warnings")))
     (home-page "https://github.com/janestreet/ppx_disable_unused_warnings")
@@ -6897,8 +6838,6 @@ (define-public ocaml-ppx-jane
         (sha256
           (base32 "1p6847gdfnnj6qpa4yh57s6wwpsl7rfgy0q7993chz24h9mhz5lk"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "."))
     (propagated-inputs
       (list ocaml-base-quickcheck
             ocaml-ppx-assert
@@ -7091,8 +7030,7 @@ (define-public ocaml4.07-jane-street-headers
                 "0afhzm08l9v883fhpqqh2lmy7az609pxif40bp7x1sk8c0yszqsh"))))
     (build-system dune-build-system)
     (arguments
-     `(#:test-target "."
-       #:ocaml ,ocaml-4.07
+     `(#:ocaml ,ocaml-4.07
        #:findlib ,ocaml4.07-findlib
        #:dune ,ocaml4.07-dune))
     (home-page "https://github.com/janestreet/jane-street-headers")
@@ -7565,8 +7503,7 @@ (define-public ocaml4.07-bisect-ppx
       (native-inputs
        `(("ocaml-ounit2" ,ocaml-ounit2)))
       (arguments
-       `(#:test-target "."
-         ;; tests require git and network
+       `(;; tests require git and network
          #:tests? #f))
       (properties '((upstream-name . "bisect_ppx"))))))
 
@@ -7707,8 +7644,6 @@ (define-public ocaml-fftw3
         (base32
          "07ljbin9dsclsqh24p7haqjccz1w828sf5xfwlzl298d4a6zsbhs"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "tests"))
     (propagated-inputs
      (list fftw fftwf))
     (native-inputs
@@ -7768,8 +7703,6 @@ (define-public ocaml-cairo2
                (base32
                 "06ag9b88ihhr7yd3s9l0ac7ysig02fmlmsswybbsvz71ni0mb105"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "tests"))
     (inputs
      `(("cairo" ,cairo)
        ("gtk+-2" ,gtk+-2)
@@ -7941,7 +7874,18 @@ (define-public lablgtk3
     (build-system dune-build-system)
     (arguments
      `(#:package "lablgtk3"
-       #:test-target "."))
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'make-writable
+           (lambda _
+             (for-each (lambda (file)
+                         (chmod file #o644))
+                       (find-files "." "."))))
+         (add-before 'build 'set-version
+           (lambda _
+             (substitute* "dune-project"
+               (("\\(name lablgtk3\\)")
+                (string-append "(name lablgtk3)\n(version " ,version ")"))))))))
     (propagated-inputs
      (list ocaml-cairo2 ocaml-camlp-streams))
     (inputs
@@ -7966,8 +7910,7 @@ (define-public ocaml-lablgtk3-sourceview3
     (propagated-inputs (list lablgtk3))
     (native-inputs (list gtksourceview-3 pkg-config))
     (arguments
-     `(#:package "lablgtk3-sourceview3"
-       #:test-target "."))
+     `(#:package "lablgtk3-sourceview3"))
     (synopsis "OCaml interface to GTK+ gtksourceview library")
     (description "This package provides the lablgtk interface to the
 GTK+ gtksourceview library.")))
@@ -8228,8 +8171,6 @@ (define-public ocaml-bigstringaf
         (base32
          "188j9awxg99vrp2l3rqfmdxdazq5xrjmg1wf62vfqsks9sff6wqx"))))
     (build-system dune-build-system)
-    (arguments
-     '(#:test-target "."))
     (propagated-inputs
      (list ocaml-bigarray-compat))
     (native-inputs
@@ -8361,8 +8302,7 @@ (define-public ocaml-angstrom
     (build-system dune-build-system)
     (arguments
      ;; Only build the base angstrom package.
-     '(#:package "angstrom"
-       #:test-target "."))
+     '(#:package "angstrom"))
     (propagated-inputs
      (list ocaml-bigstringaf))
     (native-inputs
@@ -8409,8 +8349,7 @@ (define-public ocaml-uri-sexp
     (inherit ocaml-uri)
     (name "ocaml-uri-sexp")
     (arguments
-     '(#:package "uri-sexp"
-       #:test-target "."))
+     '(#:package "uri-sexp"))
     (propagated-inputs
       (list ocaml-uri ocaml-ppx-sexp-conv ocaml-sexplib0))
     (native-inputs (list ocaml-ounit))
@@ -8468,8 +8407,8 @@ (define-public js-of-ocaml
         (base32 "0iyhl9z57j53j2jvyqcwmxhbvy23l6g80aa0abmlgwam14yskspf"))))
     (build-system dune-build-system)
     (arguments
-     `(#:tests? #f ;tests assume ocaml 4.13
-       #:test-target "."))
+     ;;tests assume ocaml 4.13
+     `(#:tests? #f))
     (propagated-inputs
      (list ocaml-ppxlib
            ocaml-uchar
@@ -8568,8 +8507,6 @@ (define-public ocaml-crowbar
         (base32
          "11f3kiw58g8njx15akx16xcplzvzdw9y6c4jpyfxylkxws4g0f6j"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "."))
     (propagated-inputs
      (list ocaml-ocplib-endian
            ocaml-cmdliner
-- 
2.38.1





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

* [bug#59487] [PATCH 1/2] build-system/dune: Automatically deduce test-target in most cases.
  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
@ 2022-11-22 20:26 ` Julien Lepiller
  1 sibling, 0 replies; 3+ messages in thread
From: Julien Lepiller @ 2022-11-22 20:26 UTC (permalink / raw)
  To: raingloom; +Cc: 59487

Hi!

This LGTM, but maybe put test-target inside the cond too, so we can
remove the or?

I've looked at how opam does things, and this seems to be the norm:

["dune" "runtest" "-p" name "-j" jobs]

Maybe this would work better:

(apply invoke program "runtest"
       (append (if test-target (list test-target) '())
               ...))

WDYT?

Le Tue, 22 Nov 2022 20:47:11 +0100,
raingloom <raingloom@riseup.net> a écrit :

> 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)





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

end of thread, other threads:[~2022-11-22 20:27 UTC | newest]

Thread overview: 3+ 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
2022-11-22 20:26 ` [bug#59487] [PATCH 1/2] build-system/dune: Automatically deduce test-target in most cases 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).