all messages for Guix-related lists mirrored at yhetil.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

* [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
  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
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 20+ 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] 20+ 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
  2023-01-10 20:24 ` pukkamustard
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 20+ 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] 20+ 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 ` [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-13 10:54 ` [bug#59487] [PATCH v3 0/6] guix: dune-build-system: Run all tests pukkamustard
  4 siblings, 1 reply; 20+ messages in thread
From: pukkamustard @ 2023-01-10 20:24 UTC (permalink / raw)
  To: raingloom; +Cc: Julien Lepiller, 59487


Hi! Sorry, I missed these patches and only found them after realizing
that your Mirage patches require these.

I'm having trouble applying the second patch (of V2), maybe there have
been changes that cause conflicts? Could you rebase on master or just
resend the V2 patches to 59487@debbugs.gnu.org? Maybe with a short
comment if and how they address Julien's suggestion?

-pukkamustard

raingloom <raingloom@riseup.net> writes:

> 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] 20+ messages in thread

* [bug#59487] [PATCH v2 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
                   ` (2 preceding siblings ...)
  2023-01-10 20:24 ` pukkamustard
@ 2023-01-11 17:40 ` 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-13 10:54 ` [bug#59487] [PATCH v3 0/6] guix: dune-build-system: Run all tests pukkamustard
  4 siblings, 2 replies; 20+ messages in thread
From: Csepp @ 2023-01-11 17:40 UTC (permalink / raw)
  To: 59487; +Cc: pukkamustard, julien, raingloom

From: raingloom <raingloom@riseup.net>

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





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

* [bug#59487] [PATCH v2 2/2] gnu: Remove explicit test-target arguments in ocaml.scm.
  2023-01-11 17:40 ` [bug#59487] [PATCH v2 " Csepp
@ 2023-01-11 17:40   ` Csepp
  2023-01-12 15:42   ` [bug#59487] [PATCH v2 1/2] build-system/dune: Automatically deduce test-target in most cases pukkamustard
  1 sibling, 0 replies; 20+ messages in thread
From: Csepp @ 2023-01-11 17:40 UTC (permalink / raw)
  To: 59487; +Cc: pukkamustard, julien, raingloom

From: raingloom <raingloom@riseup.net>

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 5109cd052a..c3a586f091 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -664,8 +664,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/")
@@ -855,8 +853,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)
@@ -1699,8 +1696,6 @@ (define-public ocaml-qcheck
        (sha256
         (base32 "1r0m5p1dd06lbgfxqdpl1ya4vb8252z7hqkvdi9k444g4rx2ay3p"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "."))
     (propagated-inputs
      (list ocaml-alcotest ocaml-ounit ocaml-ppxlib))
     (native-inputs
@@ -1744,8 +1739,6 @@ (define-public ocaml-qtest
                (base32
                 "04ghjshh6104xyglm0db9kv90m62qla5f4bfrlndv6dsvgw3rdjl"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "tests"))
     (propagated-inputs
      `(("ounit" ,ocaml-ounit)
        ("qcheck" ,ocaml-qcheck)))
@@ -1771,8 +1764,6 @@ (define-public ocaml-stringext
                (base32
                 "1m09cmn3vrk3gdm60fb730qsygcfyxsyv7gl9xfzck08q1x2x9qx"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "."))
     (native-inputs
      `(("ocamlbuild" ,ocamlbuild)
        ("qtest" ,ocaml-qtest)))
@@ -2047,8 +2038,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")))
@@ -2167,8 +2157,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))
                   (ocaml5.0-variant . ,(delay ocaml5.0-result))))
     (home-page "https://github.com/janestreet/result")
@@ -2183,8 +2172,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))))
 
@@ -2331,8 +2319,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
@@ -2570,7 +2557,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
@@ -2615,8 +2601,7 @@ (define-public ocaml4.07-alcotest
                  (base32
                   "1frwi185z4aadmaf0vp8xk5227nyg7nmh28ijj5l7ncjr5slvhz8"))))
       (arguments
-       `(#:package "alcotest"
-         #:test-target "."))
+       `(#:package "alcotest"))
       (properties '()))))
 
 (define-public ocaml-ppx-tools
@@ -2689,8 +2674,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))
@@ -3243,8 +3226,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
@@ -3504,8 +3486,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")
@@ -3729,7 +3709,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
@@ -4070,8 +4049,6 @@ (define-public ocaml-re
        (sha256
         (base32 "1g0vmpx6ylv8m0w77zarn215pgb4czc6gcpb2fi5da1s307zwr0w"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "."))
     (propagated-inputs
      (list ocaml-seq))
     (native-inputs
@@ -4094,8 +4071,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 _
@@ -4116,8 +4092,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")
@@ -4144,8 +4118,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
@@ -4188,8 +4161,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)))
@@ -4213,8 +4184,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/")
@@ -4241,8 +4211,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
@@ -4268,8 +4237,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 _
@@ -4692,8 +4660,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
@@ -4741,8 +4707,6 @@ (define-public ocaml-lambda-term
                (base32
                 "1pkamblc6h0rsbk901cqn3xr9gqa3g8wrwyx5zryaqvb2xpbhp8b"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "."))
     (propagated-inputs
      (list ocaml-logs
            ocaml-lwt
@@ -4796,8 +4760,6 @@ (define-public ocaml-utop
        (sha256
         (base32 "1pcix3h9f7is06581iax4i08zkd6sv8y5hy1vvxhqhcsd9z0qfl3"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "."))
     (native-inputs
      (list ocaml-cppo))
     (propagated-inputs
@@ -4852,8 +4814,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
@@ -5233,8 +5193,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/")
@@ -5261,8 +5219,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")
@@ -5287,8 +5243,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
@@ -5353,8 +5307,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")
@@ -5504,8 +5457,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)
@@ -5898,8 +5850,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
@@ -6945,7 +6895,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")))
@@ -7130,8 +7079,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))))
@@ -7197,8 +7144,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")
@@ -7216,8 +7161,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
@@ -7373,8 +7316,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")
@@ -7397,8 +7338,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
@@ -7591,8 +7530,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")
@@ -8065,8 +8003,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"))))))
 
@@ -8205,8 +8142,6 @@ (define-public ocaml-fftw3
         (base32
          "07ljbin9dsclsqh24p7haqjccz1w828sf5xfwlzl298d4a6zsbhs"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "tests"))
     (propagated-inputs
      (list fftw fftwf))
     (native-inputs
@@ -8266,8 +8201,6 @@ (define-public ocaml-cairo2
                (base32
                 "06ag9b88ihhr7yd3s9l0ac7ysig02fmlmsswybbsvz71ni0mb105"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "tests"))
     (inputs
      `(("cairo" ,cairo)
        ("gtk+-2" ,gtk+-2)
@@ -8439,7 +8372,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
@@ -8464,8 +8408,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.")))
@@ -8727,8 +8670,6 @@ (define-public ocaml-bigstringaf
         (base32
          "188j9awxg99vrp2l3rqfmdxdazq5xrjmg1wf62vfqsks9sff6wqx"))))
     (build-system dune-build-system)
-    (arguments
-     '(#:test-target "."))
     (propagated-inputs
      (list ocaml-bigarray-compat))
     (native-inputs
@@ -8860,8 +8801,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
@@ -8908,8 +8848,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))
@@ -8967,8 +8906,8 @@ (define-public js-of-ocaml
         (base32 "14ig69iyc9yzniclfsc6cz9g9zqp96bs66y6dy4rzrm78s81w6i1"))))
     (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
@@ -9092,8 +9031,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] 20+ messages in thread

* [bug#59487] [PATCH 1/2] build-system/dune: Automatically deduce test-target in most cases.
  2023-01-10 20:24 ` pukkamustard
@ 2023-01-11 17:41   ` Csepp
  0 siblings, 0 replies; 20+ messages in thread
From: Csepp @ 2023-01-11 17:41 UTC (permalink / raw)
  To: pukkamustard; +Cc: Julien Lepiller, raingloom, 59487


pukkamustard <pukkamustard@posteo.net> writes:

> Hi! Sorry, I missed these patches and only found them after realizing
> that your Mirage patches require these.
>
> I'm having trouble applying the second patch (of V2), maybe there have
> been changes that cause conflicts? Could you rebase on master or just
> resend the V2 patches to 59487@debbugs.gnu.org? Maybe with a short
> comment if and how they address Julien's suggestion?
>
> -pukkamustard

Sent a rebased V2 just now.  The runtest invocation looks like Julien's
suggestion, so I think I addressed it.




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

* [bug#59487] [PATCH v2 1/2] build-system/dune: Automatically deduce test-target in most cases.
  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   ` pukkamustard
  2023-01-12 18:44     ` pukkamustard
  2023-01-12 19:39     ` Csepp
  1 sibling, 2 replies; 20+ messages in thread
From: pukkamustard @ 2023-01-12 15:42 UTC (permalink / raw)
  To: Csepp; +Cc: julien, 59487


Thanks for this! I think it is a valuable improvement.

Csepp <raingloom@riseup.net> writes:

> From: raingloom <raingloom@riseup.net>
>
> 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




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

* [bug#59487] [PATCH v2 1/2] build-system/dune: Automatically deduce test-target in most cases.
  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
  1 sibling, 0 replies; 20+ messages in thread
From: pukkamustard @ 2023-01-12 18:44 UTC (permalink / raw)
  To: Csepp; +Cc: julien, 59487


pukkamustard <pukkamustard@posteo.net> writes:

> Thinking of this, maybe we can drop the `test-target` argument
> completely. wdyt?

Yeah, I'm pretty sure we should drop the test-target argument. I don't
see any reason why it should be used with the dune build-system.

The two remaining packages that have a test-target that is not "test",
"tests" or "." (and do not have tests disabled):

- ocaml-frontc: Builds as expected when test-target is removed.
- ocaml-cohttp: test-target points to a test helper library, not the
  tests themselves. Removing the test-target runs the tests, which
  currently fail.

-pukkamustard




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

* [bug#59487] [PATCH v2 1/2] build-system/dune: Automatically deduce test-target in most cases.
  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
  1 sibling, 1 reply; 20+ messages in thread
From: Csepp @ 2023-01-12 19:39 UTC (permalink / raw)
  To: pukkamustard; +Cc: julien, Csepp, 59487


pukkamustard <pukkamustard@posteo.net> writes:

> Thanks for this! I think it is a valuable improvement.
>
> Csepp <raingloom@riseup.net> writes:
>
>> From: raingloom <raingloom@riseup.net>
>>
>> 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.




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

* [bug#59487] [PATCH v2 1/2] build-system/dune: Automatically deduce test-target in most cases.
  2023-01-12 19:39     ` Csepp
@ 2023-01-12 21:20       ` Csepp
  0 siblings, 0 replies; 20+ messages in thread
From: Csepp @ 2023-01-12 21:20 UTC (permalink / raw)
  To: pukkamustard; +Cc: julien, Csepp, 59487


Csepp <raingloom@riseup.net> writes:

> pukkamustard <pukkamustard@posteo.net> writes:
>
>> Thanks for this! I think it is a valuable improvement.
>>
>> Csepp <raingloom@riseup.net> writes:
>>
>>> From: raingloom <raingloom@riseup.net>
>>>
>>> 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.

Well ocaml-ppxlib fails and I should be working my MirageOS thesis
stuff, so I'll leave this up to you.  Or I'll get back to it once I
figure out how cross-toolchains are supposed to work.




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

* [bug#59487] [PATCH v3 0/6] guix: dune-build-system: Run all tests.
  2022-11-22 19:47 [bug#59487] [PATCH 1/2] build-system/dune: Automatically deduce test-target in most cases raingloom
                   ` (3 preceding siblings ...)
  2023-01-11 17:40 ` [bug#59487] [PATCH v2 " Csepp
@ 2023-01-13 10:54 ` pukkamustard
  2023-01-13 10:54   ` [bug#59487] [PATCH v3 1/6] gnu: Add ocaml-cinaps pukkamustard
                     ` (6 more replies)
  4 siblings, 7 replies; 20+ messages in thread
From: pukkamustard @ 2023-01-13 10:54 UTC (permalink / raw)
  To: 59487; +Cc: pukkamustard, julien, raingloom

This removes the usage of the `test-target` argument from dune-build-system
completely. Dune automatically finds tests for packages being built. The
previous test-target was limiting the search of tests to specific folders. In
some cases the wrong folders.

I could not systematically check all affected packages, but have fixed tests
for some (these are packages for which previously we were not running tests).

-pukkamustard

pukkamustard (5):
  gnu: Add ocaml-cinaps.
  gnu: ocaml-ppxlib: Clean up inputs.
  gnu: ocaml-cohttp: Run tests.
  guix: dune-build-system: Run all tests.
  gnu: ocaml-ppx-expect: Disable tests.

raingloom (1):
  guix: dune-build-system: Remove usage of test-target argument.

 gnu/packages/ocaml.scm           | 209 +++++++++++++------------------
 guix/build/dune-build-system.scm |   4 +-
 2 files changed, 86 insertions(+), 127 deletions(-)


base-commit: 9ad5c3deeaebfb6f953579992a082d8327730611
-- 
2.38.1





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

* [bug#59487] [PATCH v3 1/6] gnu: Add ocaml-cinaps.
  2023-01-13 10:54 ` [bug#59487] [PATCH v3 0/6] guix: dune-build-system: Run all tests pukkamustard
@ 2023-01-13 10:54   ` pukkamustard
  2023-01-13 10:54   ` [bug#59487] [PATCH v3 2/6] gnu: ocaml-ppxlib: Clean up inputs pukkamustard
                     ` (5 subsequent siblings)
  6 siblings, 0 replies; 20+ messages in thread
From: pukkamustard @ 2023-01-13 10:54 UTC (permalink / raw)
  To: 59487; +Cc: pukkamustard, julien, raingloom

* gnu/packages/ocaml.scm (ocaml-cinaps): New variable.
---
 gnu/packages/ocaml.scm | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 5109cd052a..b37cfa4681 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -5939,6 +5939,36 @@ (define-public ocaml-ppx-derivers
 as part of the same ocaml-migrate-parsetree driver.")
     (license license:bsd-3)))
 
+(define-public ocaml-cinaps
+  ;; The commit removes the unused dependency of ocaml-ppx-jane. We need to
+  ;; use this as we would otherwise have a dependency loop between
+  ;; ocaml-ppxlib and ocaml-ppx-jane.
+  (let ((commit "d974bb2db3ab1ab14e81f989b5bdb609462bff47")
+        (revision "0"))
+    (package
+      (name "ocaml-cinaps")
+      (version (git-version "0.15.1" revision commit))
+      (home-page "https://github.com/ocaml-ppx/cinaps")
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url home-page)
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32
+           "00kb04vqlnk1pynqjhna5qhn8790ab17baxf4na5py1l1h1js8qx"))))
+      (build-system dune-build-system)
+      (propagated-inputs (list ocaml-re))
+      (synopsis "Trivial metaprogramming tool for OCaml")
+      (description
+       "Cinaps is a trivial Metaprogramming tool using the OCaml toplevel.  It is based
+on the same idea as expectation tests.  The user write some OCaml code inside
+special comments and cinaps make sure that what follows is what is printed by
+the OCaml code.")
+      (license license:expat))))
+
 (define-public ocaml-ppxlib
   (package
     (name "ocaml-ppxlib")
-- 
2.38.1





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

* [bug#59487] [PATCH v3 2/6] gnu: ocaml-ppxlib: Clean up inputs.
  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   ` pukkamustard
  2023-01-13 10:54   ` [bug#59487] [PATCH v3 3/6] gnu: ocaml-cohttp: Run tests pukkamustard
                     ` (4 subsequent siblings)
  6 siblings, 0 replies; 20+ messages in thread
From: pukkamustard @ 2023-01-13 10:54 UTC (permalink / raw)
  To: 59487; +Cc: pukkamustard, julien, raingloom

* gnu/packages/ocaml.scm (ocaml-ppxlib):
  [propagated-inputs] Remove unused inputs.
  [native-inputs] Move test dependencies from propagated-inputs here and add
  ocaml-cinaps.
---
 gnu/packages/ocaml.scm | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index b37cfa4681..1507405f7e 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -6003,14 +6003,14 @@ (define-public ocaml-ppxlib
                (("  \"(Some ppx-es.*)\")" _ m)
                 (string-append " \"" m "\"."))))))))
     (propagated-inputs
-     (list ocaml-base
-           ocaml-compiler-libs
-           ocaml-migrate-parsetree
-           ocaml-stdlib-shims
+     (list ocaml-compiler-libs
            ocaml-ppx-derivers
-           ocaml-stdio
-           ocaml-result
-           ocaml-sexplib0))
+           ocaml-sexplib0
+           ocaml-stdlib-shims))
+    (native-inputs
+     (list ocaml-stdio
+           ocaml-cinaps
+           ocaml-base))
     (properties `((ocaml4.07-variant . ,(delay ocaml4.07-ppxlib))))
     (synopsis
      "Base library and tools for ppx rewriters")
-- 
2.38.1





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

* [bug#59487] [PATCH v3 3/6] gnu: ocaml-cohttp: Run tests.
  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   ` pukkamustard
  2023-01-13 10:54   ` [bug#59487] [PATCH v3 4/6] guix: dune-build-system: Run all tests pukkamustard
                     ` (3 subsequent siblings)
  6 siblings, 0 replies; 20+ messages in thread
From: pukkamustard @ 2023-01-13 10:54 UTC (permalink / raw)
  To: 59487; +Cc: pukkamustard, julien, raingloom

Tests were not being run as test-target was pointing to a testing library and
not tests.

- gnu/package/ocaml.scm (ocaml-cohttp): [arguments]: Remove test-target.
  [native-inputs]: Add ocaml-crowbar.
---
 gnu/packages/ocaml.scm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 1507405f7e..1ed837eccd 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -8961,9 +8961,7 @@ (define-public ocaml-cohttp
           (base32
             "074xis3wmr76gadh1ffmfzjfx13mw4kr2s6rkwqwzcl6l85n9x2z"))))
     (build-system dune-build-system)
-    (arguments
-     '(#:package "cohttp"
-       #:test-target "cohttp_test/src"))
+    (arguments '(#:package "cohttp"))
     (propagated-inputs
       (list ocaml-re
             ocaml-uri
@@ -8973,7 +8971,10 @@ (define-public ocaml-cohttp
             ocaml-stringext
             ocaml-base64))
     (native-inputs
-      (list ocaml-fmt ocaml-jsonm ocaml-alcotest))
+     (list ocaml-fmt
+           ocaml-jsonm
+           ocaml-alcotest
+           ocaml-crowbar))
     (home-page "https://github.com/mirage/ocaml-cohttp")
     (synopsis "OCaml library for HTTP clients and servers")
     (description
-- 
2.38.1





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

* [bug#59487] [PATCH v3 4/6] guix: dune-build-system: Run all tests.
  2023-01-13 10:54 ` [bug#59487] [PATCH v3 0/6] guix: dune-build-system: Run all tests pukkamustard
                     ` (2 preceding siblings ...)
  2023-01-13 10:54   ` [bug#59487] [PATCH v3 3/6] gnu: ocaml-cohttp: Run tests pukkamustard
@ 2023-01-13 10:54   ` pukkamustard
  2023-01-13 10:54   ` [bug#59487] [PATCH v3 5/6] guix: dune-build-system: Remove usage of test-target argument pukkamustard
                     ` (2 subsequent siblings)
  6 siblings, 0 replies; 20+ messages in thread
From: pukkamustard @ 2023-01-13 10:54 UTC (permalink / raw)
  To: 59487; +Cc: pukkamustard, julien, raingloom

* guix/build/dune-build-system.scm (check): Do not use test-target argument
and let dune run all tests for a given package.
---
 guix/build/dune-build-system.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/guix/build/dune-build-system.scm b/guix/build/dune-build-system.scm
index e9ccc71057..f311cd37f1 100644
--- a/guix/build/dune-build-system.scm
+++ b/guix/build/dune-build-system.scm
@@ -42,13 +42,13 @@ (define* (build #:key (build-flags '()) (jbuild? #f)
                    build-flags)))
   #t)
 
-(define* (check #:key (test-flags '()) (test-target "test") tests?
+(define* (check #:key (test-flags '()) 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
+      (apply invoke program "runtest"
              (append (if package (list "-p" package)
                          dune-release-flags)
                      test-flags))))
-- 
2.38.1





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

* [bug#59487] [PATCH v3 5/6] guix: dune-build-system: Remove usage of test-target argument.
  2023-01-13 10:54 ` [bug#59487] [PATCH v3 0/6] guix: dune-build-system: Run all tests pukkamustard
                     ` (3 preceding siblings ...)
  2023-01-13 10:54   ` [bug#59487] [PATCH v3 4/6] guix: dune-build-system: Run all tests pukkamustard
@ 2023-01-13 10:54   ` 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
  6 siblings, 0 replies; 20+ messages in thread
From: pukkamustard @ 2023-01-13 10:54 UTC (permalink / raw)
  To: 59487; +Cc: julien, raingloom

From: raingloom <raingloom@riseup.net>

gnu/packages/ocaml.scm: Remove test-target argument from packages built with
dune-build-system.

Co-authored: pukkamustard <pukkamustard@posteo.net>
---
 gnu/packages/ocaml.scm | 153 +++++++++++------------------------------
 1 file changed, 39 insertions(+), 114 deletions(-)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 1ed837eccd..371c3ebb71 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -664,8 +664,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/")
@@ -855,8 +853,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)
@@ -1628,8 +1625,7 @@ (define-public ocaml-frontc
                 "1mi1vh4qgscnb470qwidccaqd068j1bqlz6pf6wddk21paliwnqb"))))
     (build-system dune-build-system)
     (arguments
-     `(#:test-target "test.t"
-       #:phases
+     `(#:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'make-writable
            (lambda _
@@ -1699,8 +1695,6 @@ (define-public ocaml-qcheck
        (sha256
         (base32 "1r0m5p1dd06lbgfxqdpl1ya4vb8252z7hqkvdi9k444g4rx2ay3p"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "."))
     (propagated-inputs
      (list ocaml-alcotest ocaml-ounit ocaml-ppxlib))
     (native-inputs
@@ -1744,8 +1738,6 @@ (define-public ocaml-qtest
                (base32
                 "04ghjshh6104xyglm0db9kv90m62qla5f4bfrlndv6dsvgw3rdjl"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "tests"))
     (propagated-inputs
      `(("ounit" ,ocaml-ounit)
        ("qcheck" ,ocaml-qcheck)))
@@ -1771,8 +1763,6 @@ (define-public ocaml-stringext
                (base32
                 "1m09cmn3vrk3gdm60fb730qsygcfyxsyv7gl9xfzck08q1x2x9qx"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "."))
     (native-inputs
      `(("ocamlbuild" ,ocamlbuild)
        ("qtest" ,ocaml-qtest)))
@@ -2047,8 +2037,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")))
@@ -2167,8 +2156,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))
                   (ocaml5.0-variant . ,(delay ocaml5.0-result))))
     (home-page "https://github.com/janestreet/result")
@@ -2183,8 +2171,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))))
 
@@ -2193,8 +2180,7 @@ (define-public ocaml5.0-result
     (inherit ocaml-result)
     (name "ocaml5.0-result")
     (arguments
-     `(#:test-target "."
-       #:dune ,ocaml5.0-dune-bootstrap
+     `(#:dune ,ocaml5.0-dune-bootstrap
        #:ocaml ,ocaml-5.0
        #:findlib ,ocaml5.0-findlib))))
  
@@ -2331,8 +2317,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
@@ -2570,7 +2555,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
@@ -2615,8 +2599,7 @@ (define-public ocaml4.07-alcotest
                  (base32
                   "1frwi185z4aadmaf0vp8xk5227nyg7nmh28ijj5l7ncjr5slvhz8"))))
       (arguments
-       `(#:package "alcotest"
-         #:test-target "."))
+       `(#:package "alcotest"))
       (properties '()))))
 
 (define-public ocaml-ppx-tools
@@ -2689,8 +2672,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))
@@ -2760,7 +2741,6 @@ (define-public ocaml-optint
         (sha256 (base32
                  "1qj32bcw1in7s6raxdvbmjr3lvj99iwv98x1ar9cwxp4zf8ybfss"))))
     (build-system dune-build-system)
-    (arguments `(#:test-target "."))
     (native-inputs (list ocaml-crowbar ocaml-monolith ocaml-fmt))
     (synopsis "Efficient integer types on 64-bit architectures for OCaml")
     (description
@@ -2811,8 +2791,7 @@ (define ocaml-eio
        (sha256 (base32
                 "118raxdwv6pn5b152ffdhmwdi0l4wlwflcj2nmckfmm7v1z2fq4s"))))
     (build-system dune-build-system)
-    (arguments `(#:package "eio"
-                 #:test-target "."))
+    (arguments `(#:package "eio"))
     (propagated-inputs (list ocaml-bigstringaf
                              ocaml-cstruct
                              ocaml-lwt
@@ -2837,8 +2816,7 @@ (define ocaml-eio-luv
   (package
     (inherit ocaml-eio)
     (name "ocaml-eio-luv")
-    (arguments `(#:package "eio_luv"
-                 #:test-target "."))
+    (arguments `(#:package "eio_luv"))
     (propagated-inputs (list ocaml-eio ocaml-luv))
     (native-inputs (list ocaml-mdx))
     (synopsis "Libuv-based backend for Ocaml Eio")
@@ -2863,7 +2841,6 @@ (define-public ocaml-uring
         (sha256 (base32
                  "0k70y7nb2wrk2yql0pwnrhsp1x7k9ld4gd8iihbv6r34kcm3a5m1"))))
     (build-system dune-build-system)
-    (arguments `(#:test-target "."))
     (propagated-inputs
      (list ocaml-cstruct
            ocaml-fmt
@@ -2884,8 +2861,7 @@ (define ocaml-eio-linux
   (package
     (inherit ocaml-eio)
     (name "ocaml-eio-linux")
-    (arguments `(#:package "eio_linux"
-                 #:test-target "."))
+    (arguments `(#:package "eio_linux"))
     (propagated-inputs
      (list ocaml-eio
            ocaml-uring
@@ -2908,7 +2884,6 @@ (define ocaml-eio-main
     (inherit ocaml-eio)
     (name "ocaml-eio-main")
     (arguments `(#:package "eio_main"
-                 #:test-target "."
                  ;; tests require network
                  #:tests? #f))
     (propagated-inputs
@@ -3243,8 +3218,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
@@ -3504,8 +3478,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")
@@ -3729,7 +3701,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
@@ -4070,8 +4041,6 @@ (define-public ocaml-re
        (sha256
         (base32 "1g0vmpx6ylv8m0w77zarn215pgb4czc6gcpb2fi5da1s307zwr0w"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "."))
     (propagated-inputs
      (list ocaml-seq))
     (native-inputs
@@ -4094,8 +4063,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 _
@@ -4116,8 +4084,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")
@@ -4144,8 +4110,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
@@ -4188,8 +4153,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)))
@@ -4213,8 +4176,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/")
@@ -4241,8 +4203,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
@@ -4268,8 +4229,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 _
@@ -4624,8 +4584,7 @@ (define-public ocaml-camomile
                 "0chn7ldqb3wyf95yhmsxxq65cif56smgz1mhhc7m0dpwmyq1k97h"))))
     (build-system dune-build-system)
     (arguments
-     `(#:test-target "camomile-test"
-       #:tests? #f ; Tests fail, see https://github.com/yoriyuki/Camomile/issues/82
+     `(#:tests? #f ; Tests fail, see https://github.com/yoriyuki/Camomile/issues/82
        #:phases
        (modify-phases %standard-phases
          (add-before 'build 'fix-usr-share
@@ -4692,8 +4651,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
@@ -4741,8 +4698,6 @@ (define-public ocaml-lambda-term
                (base32
                 "1pkamblc6h0rsbk901cqn3xr9gqa3g8wrwyx5zryaqvb2xpbhp8b"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "."))
     (propagated-inputs
      (list ocaml-logs
            ocaml-lwt
@@ -4796,8 +4751,6 @@ (define-public ocaml-utop
        (sha256
         (base32 "1pcix3h9f7is06581iax4i08zkd6sv8y5hy1vvxhqhcsd9z0qfl3"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "."))
     (native-inputs
      (list ocaml-cppo))
     (propagated-inputs
@@ -4852,8 +4805,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
@@ -5078,8 +5029,6 @@ (define-public dedukti
         (base32
          "1dsr3s88kgmcg3najhc29cwfvsxa2plvjws1127fz75kmn15np28"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "tests"))
     (inputs (list gmp ocaml-cmdliner ocaml-z3 z3))
     (native-inputs (list ocaml-menhir))
     (synopsis "Proof-checker for the λΠ-calculus modulo theory, an extension of
@@ -5233,8 +5182,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/")
@@ -5261,8 +5208,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")
@@ -5287,8 +5232,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
@@ -5353,8 +5296,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")
@@ -5504,8 +5446,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)
@@ -5898,8 +5839,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
@@ -6975,7 +6914,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")))
@@ -7160,8 +7098,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))))
@@ -7227,8 +7163,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")
@@ -7246,8 +7180,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
@@ -7403,8 +7335,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")
@@ -7427,8 +7357,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
@@ -7621,8 +7549,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")
@@ -8095,8 +8022,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"))))))
 
@@ -8235,8 +8161,6 @@ (define-public ocaml-fftw3
         (base32
          "07ljbin9dsclsqh24p7haqjccz1w828sf5xfwlzl298d4a6zsbhs"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "tests"))
     (propagated-inputs
      (list fftw fftwf))
     (native-inputs
@@ -8296,8 +8220,6 @@ (define-public ocaml-cairo2
                (base32
                 "06ag9b88ihhr7yd3s9l0ac7ysig02fmlmsswybbsvz71ni0mb105"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:test-target "tests"))
     (inputs
      `(("cairo" ,cairo)
        ("gtk+-2" ,gtk+-2)
@@ -8469,7 +8391,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
@@ -8494,8 +8427,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.")))
@@ -8757,8 +8689,6 @@ (define-public ocaml-bigstringaf
         (base32
          "188j9awxg99vrp2l3rqfmdxdazq5xrjmg1wf62vfqsks9sff6wqx"))))
     (build-system dune-build-system)
-    (arguments
-     '(#:test-target "."))
     (propagated-inputs
      (list ocaml-bigarray-compat))
     (native-inputs
@@ -8890,8 +8820,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
@@ -8938,8 +8867,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))
@@ -8998,8 +8926,8 @@ (define-public js-of-ocaml
         (base32 "14ig69iyc9yzniclfsc6cz9g9zqp96bs66y6dy4rzrm78s81w6i1"))))
     (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
@@ -9072,7 +9000,6 @@ (define-public ocaml-monolith
         (base32
          "1b6jj4ivl9ni8kba7wls4xsqdy8nm7q9mnx9347jvb99dmmlj5mc"))))
     (build-system dune-build-system)
-    (arguments `(#:test-target "."))
     (propagated-inputs (list ocaml-afl-persistent ocaml-pprint ocaml-seq))
     (home-page "https://gitlab.inria.fr/fpottier/monolith")
     (synopsis "Framework for testing an OCaml library using afl-fuzz")
@@ -9123,8 +9050,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] 20+ messages in thread

* [bug#59487] [PATCH v3 6/6] gnu: ocaml-ppx-expect: Disable tests.
  2023-01-13 10:54 ` [bug#59487] [PATCH v3 0/6] guix: dune-build-system: Run all tests pukkamustard
                     ` (4 preceding siblings ...)
  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   ` pukkamustard
  2023-01-15 15:02   ` bug#59487: [PATCH v3 0/6] guix: dune-build-system: Run all tests Julien Lepiller
  6 siblings, 0 replies; 20+ messages in thread
From: pukkamustard @ 2023-01-13 10:54 UTC (permalink / raw)
  To: 59487; +Cc: pukkamustard, julien, raingloom

Tests require a package that would cause a cyclic dependency.

* gnu/packages/ocaml.scm (ocaml-ppx-expect): Disable tests.
---
 gnu/packages/ocaml.scm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 371c3ebb71..a8412a6903 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -6981,6 +6981,9 @@ (define-public ocaml-ppx-expect
         (base32
          "134dl5qhjxsj2mcmrx9f3m0iys0n5mjfpz9flj8zn8d2jir43776"))))
     (build-system dune-build-system)
+    (arguments
+     ;; Cyclic dependency with ocaml-ppx-jane
+     `(#:tests? #f))
     (propagated-inputs
      (list ocaml-base
            ocaml-ppx-here
-- 
2.38.1





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

* bug#59487: [PATCH v3 0/6] guix: dune-build-system: Run all tests.
  2023-01-13 10:54 ` [bug#59487] [PATCH v3 0/6] guix: dune-build-system: Run all tests pukkamustard
                     ` (5 preceding siblings ...)
  2023-01-13 10:54   ` [bug#59487] [PATCH v3 6/6] gnu: ocaml-ppx-expect: Disable tests pukkamustard
@ 2023-01-15 15:02   ` Julien Lepiller
  6 siblings, 0 replies; 20+ messages in thread
From: Julien Lepiller @ 2023-01-15 15:02 UTC (permalink / raw)
  To: pukkamustard; +Cc: raingloom, 59487-done

I was able to check the dependents, so pushed to master as
7686b68f6bb1ae5dc206178805c32bceceea3743 -
79bf3b54a64e304a29334b5029c24d942d9dc051.

Note that I moved patches around, to have the last one before removing
test-target. I merged patches 3, 4 and 5 because intermediate states
would have failing packages otherwise. Also, patch 5 had unrelated
changes to lablgtk3 which I droped, because the package still builds.
If that was intentional, please send a new patch for that :)

I also listed all modified packages in the commit message, and removed
the Co-authored line which listed the author already.

Thanks!




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

* bug#59488: [PATCH 2/2] gnu: Remove explicit test-target arguments in ocaml.scm.
  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   ` Julien Lepiller
  0 siblings, 0 replies; 20+ messages in thread
From: Julien Lepiller @ 2023-01-28 12:23 UTC (permalink / raw)
  To: raingloom; +Cc: 59488-close

Closing since a similar patch was already pushed. Thanks.




^ permalink raw reply	[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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.