(lang dune 3.18)
(name testo)
(version 0.4.0)
(using menhir 2.1)

; Generate the opam files used to install dependencies.
;
(generate_opam_files)

; Default attributes of opam packages
(license "ISC")
(source (github mjambon/testo))
(homepage "https://github.com/mjambon/testo")
(maintainers "Martin Jambon <martin@mjambon.com>")
(authors
  "Martin Jambon"
  "Gabriel Jaldon"
)

; Opam packages

(package
  (name testo-diff)
  (synopsis "Pure-OCaml diff implementation")
  (description "\
This is a pure-OCaml implementation for computing line-by-line diffs.
The current implementation uses an algorithm similar to gestalt pattern
matching ported to OCaml by Gabriel Jaldon from Paul Butler's
Python implementation.
See https://github.com/paulgb/simplediff")
  (depends
    (ocaml (>= 4.08.0))
    ppx_deriving
  )
  (maintenance_intent "(latest)")
)

(package
  (name testo-util)
  (synopsis "Modules shared by testo, testo-lwt, etc")
  (description "\
Testo is a test framework for OCaml.")
  (depends
    (ocaml (>= 4.08.0))
    fpath
    (re (>= 1.10.0))
    ppx_deriving
    (testo-diff (= :version))
  )
  (maintenance_intent "(latest)")
)

(package
  (name testo)
  (synopsis "Test framework for OCaml")
  (description "\
Testo is a test framework for OCaml providing new subcommands for capturing,
checking, and approving the output of tests.")
  (depends
    (ocaml (>= 4.08.0))
    (alcotest :with-test)
    (cmdliner (>= 1.1.0))
    fpath
    (odoc (and (>= 3.1.0) :with-doc))
    (re (>= 1.10.0))
    (testo-util (= :version))

    ; Development-only
    (ocamlformat (and (and (>= 0.28.0) (< 0.29.0)) :with-dev-setup))
    (utop :with-dev-setup)
  )
  (maintenance_intent "(latest)")
)

(package
  (name testo-lwt)
  (synopsis "Test framework for OCaml, Lwt variant")
  (description "\
Use this if the tests return Lwt promises and you can't make them synchronous
because 'Lwt_main.run' is not supported by your platform e.g. JavaScript.")
  (depends
    (lwt (>= 5.6.0))
    ; Same direct dependencies as 'testo' above
    (ocaml (>= 4.08.0))
    (alcotest :with-test)
    (cmdliner (>= 1.1.0))
    fpath
    (re (>= 1.10.0))
    (testo-util (= :version))
  )
  (maintenance_intent "(latest)")
)
