diff -Nru ocaml-alcotest-1.5.0/alcotest-async.opam ocaml-alcotest-1.6.0/alcotest-async.opam --- ocaml-alcotest-1.5.0/alcotest-async.opam 2021-10-09 18:09:55.000000000 +0000 +++ ocaml-alcotest-1.6.0/alcotest-async.opam 2022-06-24 10:04:46.000000000 +0000 @@ -1,4 +1,4 @@ -version: "1.5.0" +version: "1.6.0" # This file is generated by dune, edit dune-project instead opam-version: "2.0" synopsis: "Async-based helpers for Alcotest" @@ -13,14 +13,15 @@ "dune" {>= "2.8"} "re" {with-test} "fmt" {with-test} - "cmdliner" {with-test} - "core" + "cmdliner" {with-test & >= "1.1.0"} + "core" {>= "v0.15.0"} + "core_unix" {>= "v0.15.0"} "base" "async_kernel" - "ocaml" {>= "4.03.0"} + "ocaml" {>= "4.11.0"} "alcotest" {= version} - "async_unix" {>= "v0.9.0"} - "core_kernel" {>= "v0.9.0"} + "async" {>= "v0.15.0"} + "async_unix" {>= "v0.15.0"} "odoc" {with-doc} ] build: [ diff -Nru ocaml-alcotest-1.5.0/alcotest-js.opam ocaml-alcotest-1.6.0/alcotest-js.opam --- ocaml-alcotest-1.5.0/alcotest-js.opam 2021-10-09 18:09:55.000000000 +0000 +++ ocaml-alcotest-1.6.0/alcotest-js.opam 2022-06-24 10:04:46.000000000 +0000 @@ -1,4 +1,4 @@ -version: "1.5.0" +version: "1.6.0" # This file is generated by dune, edit dune-project instead opam-version: "2.0" synopsis: @@ -16,7 +16,7 @@ "alcotest" {= version} "js_of_ocaml-compiler" {>= "3.11.0"} "fmt" {with-test & >= "0.8.7"} - "cmdliner" {with-test & >= "1.0.0"} + "cmdliner" {with-test & >= "1.1.0"} "odoc" {with-doc} ] build: [ diff -Nru ocaml-alcotest-1.5.0/alcotest-lwt.opam ocaml-alcotest-1.6.0/alcotest-lwt.opam --- ocaml-alcotest-1.5.0/alcotest-lwt.opam 2021-10-09 18:09:55.000000000 +0000 +++ ocaml-alcotest-1.6.0/alcotest-lwt.opam 2022-06-24 10:04:46.000000000 +0000 @@ -1,4 +1,4 @@ -version: "1.5.0" +version: "1.6.0" # This file is generated by dune, edit dune-project instead opam-version: "2.0" synopsis: "Lwt-based helpers for Alcotest" @@ -12,9 +12,9 @@ depends: [ "dune" {>= "2.8"} "re" {with-test} - "cmdliner" {with-test} + "cmdliner" {with-test & >= "1.1.0"} "fmt" - "ocaml" {>= "4.03.0"} + "ocaml" {>= "4.05.0"} "alcotest" {= version} "lwt" "logs" diff -Nru ocaml-alcotest-1.5.0/alcotest-mirage.opam ocaml-alcotest-1.6.0/alcotest-mirage.opam --- ocaml-alcotest-1.5.0/alcotest-mirage.opam 2021-10-09 18:09:55.000000000 +0000 +++ ocaml-alcotest-1.6.0/alcotest-mirage.opam 2022-06-24 10:04:46.000000000 +0000 @@ -1,4 +1,4 @@ -version: "1.5.0" +version: "1.6.0" # This file is generated by dune, edit dune-project instead opam-version: "2.0" synopsis: "Mirage implementation for Alcotest" @@ -12,9 +12,9 @@ depends: [ "dune" {>= "2.8"} "re" {with-test} - "cmdliner" {with-test} + "cmdliner" {with-test & >= "1.1.0"} "fmt" - "ocaml" {>= "4.03.0"} + "ocaml" {>= "4.05.0"} "alcotest" {= version} "mirage-clock" {>= "2.0.0"} "duration" diff -Nru ocaml-alcotest-1.5.0/alcotest.opam ocaml-alcotest-1.6.0/alcotest.opam --- ocaml-alcotest-1.5.0/alcotest.opam 2021-10-09 18:09:55.000000000 +0000 +++ ocaml-alcotest-1.6.0/alcotest.opam 2022-06-24 10:04:46.000000000 +0000 @@ -1,4 +1,4 @@ -version: "1.5.0" +version: "1.6.0" # This file is generated by dune, edit dune-project instead opam-version: "2.0" synopsis: "Alcotest is a lightweight and colourful test framework" @@ -21,13 +21,13 @@ bug-reports: "https://github.com/mirage/alcotest/issues" depends: [ "dune" {>= "2.8"} - "ocaml" {>= "4.03.0"} + "ocaml" {>= "4.05.0"} "fmt" {>= "0.8.7"} "astring" - "cmdliner" {>= "1.0.0"} - "re" + "cmdliner" {>= "1.1.0"} + "re" {>= "1.7.2"} "stdlib-shims" - "uutf" + "uutf" {>= "1.0.1"} "ocaml-syntax-shims" "odoc" {with-doc} ] diff -Nru ocaml-alcotest-1.5.0/CHANGES.md ocaml-alcotest-1.6.0/CHANGES.md --- ocaml-alcotest-1.5.0/CHANGES.md 2021-10-09 18:09:55.000000000 +0000 +++ ocaml-alcotest-1.6.0/CHANGES.md 2022-06-24 10:04:46.000000000 +0000 @@ -1,3 +1,14 @@ +### dev + +### v1.6.0 (2022-06-24) + +- Fix a bug when running test concurently. Alcotest could fail to + output the content of the log file. (#353, @hhugo) + +- Require Cmdliner.1.1.0. (#339, @MisterDA) + +- Upgrade to `async>=v0.15.0` (#352, @crackcomm) + ### 1.5.0 (2021-10-09) - Make Alcotest compatible with `js_of_ocaml.3.11.0`. Users can depend on the @@ -85,7 +96,7 @@ - Surround pretty-printed diffs with quotes to make trailing whitespace more obvious. (#261, @CraigFe) - + - Allow `.` characters to appear unescaped in symlinks and test directories. (#259, @CraigFe) diff -Nru ocaml-alcotest-1.5.0/CONTRIBUTING.md ocaml-alcotest-1.6.0/CONTRIBUTING.md --- ocaml-alcotest-1.5.0/CONTRIBUTING.md 2021-10-09 18:09:55.000000000 +0000 +++ ocaml-alcotest-1.6.0/CONTRIBUTING.md 2022-06-24 10:04:46.000000000 +0000 @@ -69,7 +69,7 @@ ## Expect tests The repository contains a number of 'expect' tests in -https://github.com/mirage/alcotest/tree/master/test/e2e. These are short, +https://github.com/mirage/alcotest/tree/main/test/e2e. These are short, self-contained usages of the Alcotest API, with the corresponding output snapshotted in an `.expected` file: diff -Nru ocaml-alcotest-1.5.0/debian/changelog ocaml-alcotest-1.6.0/debian/changelog --- ocaml-alcotest-1.5.0/debian/changelog 2022-02-25 15:20:44.000000000 +0000 +++ ocaml-alcotest-1.6.0/debian/changelog 2022-06-29 09:47:40.000000000 +0000 @@ -1,14 +1,10 @@ -ocaml-alcotest (1.5.0-3build2) jammy; urgency=medium +ocaml-alcotest (1.6.0-1) unstable; urgency=medium - * No-change rebuild for ocaml abi changes. + * Team upload. + * New upstream release. + * Bump standards-version to 4.6.1. - -- Matthias Klose Fri, 25 Feb 2022 16:20:44 +0100 - -ocaml-alcotest (1.5.0-3build1) jammy; urgency=medium - - * No-change rebuild for ocaml abi changes. - - -- Matthias Klose Wed, 26 Jan 2022 10:36:47 +0100 + -- Julien Puydt Wed, 29 Jun 2022 11:47:40 +0200 ocaml-alcotest (1.5.0-3) unstable; urgency=medium diff -Nru ocaml-alcotest-1.5.0/debian/control ocaml-alcotest-1.6.0/debian/control --- ocaml-alcotest-1.5.0/debian/control 2021-12-18 00:56:45.000000000 +0000 +++ ocaml-alcotest-1.6.0/debian/control 2022-06-29 09:47:40.000000000 +0000 @@ -10,12 +10,12 @@ ocaml-dune, libfmt-ocaml-dev, libastring-ocaml-dev, - libcmdliner-ocaml-dev, + libcmdliner-ocaml-dev (>= 1.1.0), libre-ocaml-dev, libuutf-ocaml-dev, ocaml-odoc, dh-ocaml -Standards-Version: 4.6.0 +Standards-Version: 4.6.1 Rules-Requires-Root: no Homepage: https://github.com/mirage/alcotest Vcs-Git: https://salsa.debian.org/ocaml-team/ocaml-alcotest.git diff -Nru ocaml-alcotest-1.5.0/debian/patches/0001-Fix-compilation-on-bytecode-architectures.patch ocaml-alcotest-1.6.0/debian/patches/0001-Fix-compilation-on-bytecode-architectures.patch --- ocaml-alcotest-1.5.0/debian/patches/0001-Fix-compilation-on-bytecode-architectures.patch 2021-12-18 00:56:45.000000000 +0000 +++ ocaml-alcotest-1.6.0/debian/patches/0001-Fix-compilation-on-bytecode-architectures.patch 2022-06-29 09:47:40.000000000 +0000 @@ -2,6 +2,7 @@ Date: Sat, 18 Dec 2021 01:55:44 +0100 Subject: Fix compilation on bytecode architectures +Forwarded: https://github.com/mirage/alcotest/pull/335 --- examples/bad/dune | 2 +- examples/dune | 2 +- diff -Nru ocaml-alcotest-1.5.0/dune-project ocaml-alcotest-1.6.0/dune-project --- ocaml-alcotest-1.5.0/dune-project 2021-10-09 18:09:55.000000000 +0000 +++ ocaml-alcotest-1.6.0/dune-project 2022-06-24 10:04:46.000000000 +0000 @@ -3,7 +3,7 @@ (generate_opam_files true) (name alcotest) -(version 1.5.0) +(version 1.5.0-29-g6be328d) (source (github mirage/alcotest)) (license ISC) (authors "Thomas Gazagnaire") @@ -25,13 +25,13 @@ tests to run. ") (depends - (ocaml (>= 4.03.0)) + (ocaml (>= 4.05.0)) (fmt (>= 0.8.7)) astring - (cmdliner (>= 1.0.0)) - re + (cmdliner (>= 1.1.0)) + (re (>= 1.7.2)) stdlib-shims - uutf + (uutf (>= 1.0.1)) ocaml-syntax-shims) (conflicts (result (< 1.5)) ;; Ensure `Result.result` = `Stdlib.result` when possible @@ -45,14 +45,15 @@ (depends (re :with-test) (fmt :with-test) - (cmdliner :with-test) - core + (cmdliner (and :with-test (>= 1.1.0))) + (core (>= v0.15.0)) + (core_unix (>= v0.15.0)) base async_kernel - (ocaml (>= 4.03.0)) + (ocaml (>= 4.11.0)) (alcotest (= :version)) - (async_unix (>= v0.9.0)) - (core_kernel (>= v0.9.0)))) + (async (>= v0.15.0)) + (async_unix (>= v0.15.0)))) (package (name alcotest-lwt) @@ -61,9 +62,9 @@ (documentation "https://mirage.github.io/alcotest") (depends (re :with-test) - (cmdliner :with-test) + (cmdliner (and :with-test (>= 1.1.0))) fmt - (ocaml (>= 4.03.0)) + (ocaml (>= 4.05.0)) (alcotest (= :version)) lwt logs)) @@ -75,9 +76,9 @@ (documentation "https://mirage.github.io/alcotest") (depends (re :with-test) - (cmdliner :with-test) + (cmdliner (and :with-test (>= 1.1.0))) fmt - (ocaml (>= 4.03.0)) + (ocaml (>= 4.05.0)) (alcotest (= :version)) (mirage-clock (>= 2.0.0)) duration @@ -93,4 +94,4 @@ (alcotest (= :version)) (js_of_ocaml-compiler (>= 3.11.0)) (fmt (and :with-test (>= 0.8.7))) - (cmdliner (and :with-test (>= 1.0.0))))) + (cmdliner (and :with-test (>= 1.1.0))))) diff -Nru ocaml-alcotest-1.5.0/.github/workflows/build.yml ocaml-alcotest-1.6.0/.github/workflows/build.yml --- ocaml-alcotest-1.5.0/.github/workflows/build.yml 1970-01-01 00:00:00.000000000 +0000 +++ ocaml-alcotest-1.6.0/.github/workflows/build.yml 2022-06-24 10:04:46.000000000 +0000 @@ -0,0 +1,86 @@ +name: build + +on: + pull_request: + push: + schedule: + # Prime the caches every Monday + - cron: 0 1 * * MON + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + packages: [ '.' ] + runtest: + - true + ocaml-compiler: + - 4.11.x + - 4.12.x + - 4.13.x + include: + - os: macos-latest + ocaml-compiler: 4.13.x + packages: '.' + runtest: true + + - os: windows-latest + ocaml-compiler: 4.13.x + packages: 'alcotest alcotest-js alcotest-lwt alcotest-mirage' + opam-local-packages: 'alcotest.opam alcotest-js.opam alcotest-lwt.opam alcotest-mirage.opam' + runtest: false + + - os: ubuntu-latest + ocaml-compiler: 4.08.x + packages: 'alcotest alcotest-js alcotest-lwt alcotest-mirage' + opam-local-packages: 'alcotest.opam alcotest-js.opam alcotest-lwt.opam alcotest-mirage.opam' + runtest: false + + - os: ubuntu-latest + ocaml-compiler: 4.09.x + packages: 'alcotest alcotest-js alcotest-lwt alcotest-mirage' + opam-local-packages: 'alcotest.opam alcotest-js.opam alcotest-lwt.opam alcotest-mirage.opam' + runtest: false + + - os: ubuntu-latest + ocaml-compiler: 4.10.x + packages: 'alcotest alcotest-js alcotest-lwt alcotest-mirage' + opam-local-packages: 'alcotest.opam alcotest-js.opam alcotest-lwt.opam alcotest-mirage.opam' + runtest: false + + runs-on: ${{ matrix.os }} + + steps: + - name: Set git to use LF + run: | + git config --global core.autocrlf false + git config --global core.eol lf + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Use Node.js 16.x + uses: actions/setup-node@v2 + with: + node-version: 16.x + + - name: Use OCaml ${{ matrix.ocaml-compiler }} + uses: ocaml/setup-ocaml@v2 + with: + ocaml-compiler: ${{ matrix.ocaml-compiler }} + opam-local-packages: $${ matrix.opam-local-packages }} + opam-depext-flags: --with-test + + - run: | + opam pin add alcotest-async.dev ./ -n + opam pin add alcotest-js.dev ./ -n + opam pin add alcotest-lwt.dev ./ -n + opam pin add alcotest-mirage.dev ./ -n + opam pin add alcotest.dev ./ -n + + - run: opam install ${{ matrix.packages }} --with-test --deps-only + - if: ${{ matrix.runtest }} + run: opam exec -- dune build @install @check @runtest @runtest-js diff -Nru ocaml-alcotest-1.5.0/.github/workflows/changelog-check.yml ocaml-alcotest-1.6.0/.github/workflows/changelog-check.yml --- ocaml-alcotest-1.5.0/.github/workflows/changelog-check.yml 1970-01-01 00:00:00.000000000 +0000 +++ ocaml-alcotest-1.6.0/.github/workflows/changelog-check.yml 2022-06-24 10:04:46.000000000 +0000 @@ -0,0 +1,20 @@ +name: Changelog check + +on: + pull_request: + branches: [ main ] + types: [ opened, synchronize, reopened, labeled, unlabeled ] + +jobs: + build: + runs-on: ubuntu-18.04 + + steps: + - uses: actions/checkout@v1 + + - name: git diff + if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-changelog-needed') }} + env: + BASE_REF: ${{ github.event.pull_request.base.ref }} + run: | + ! git diff --exit-code origin/$BASE_REF -- CHANGES.md diff -Nru ocaml-alcotest-1.5.0/.gitignore ocaml-alcotest-1.6.0/.gitignore --- ocaml-alcotest-1.5.0/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ ocaml-alcotest-1.6.0/.gitignore 2022-06-24 10:04:46.000000000 +0000 @@ -0,0 +1,10 @@ +_build +*~ +\.\#* +\#*# +*.native +*.byte +*.install +.merlin +_tests/ +_opam Binary files /tmp/tmpot56etwz/9lVjNxi9xS/ocaml-alcotest-1.5.0/.meta/alcotest-logo.png and /tmp/tmpot56etwz/ojg1AzXAM4/ocaml-alcotest-1.6.0/.meta/alcotest-logo.png differ diff -Nru ocaml-alcotest-1.5.0/.meta/alcotest-logo.svg ocaml-alcotest-1.6.0/.meta/alcotest-logo.svg --- ocaml-alcotest-1.5.0/.meta/alcotest-logo.svg 1970-01-01 00:00:00.000000000 +0000 +++ ocaml-alcotest-1.6.0/.meta/alcotest-logo.svg 2022-06-24 10:04:46.000000000 +0000 @@ -0,0 +1,136 @@ + +image/svg+xml \ No newline at end of file Binary files /tmp/tmpot56etwz/9lVjNxi9xS/ocaml-alcotest-1.5.0/.meta/error.png and /tmp/tmpot56etwz/ojg1AzXAM4/ocaml-alcotest-1.6.0/.meta/error.png differ Binary files /tmp/tmpot56etwz/9lVjNxi9xS/ocaml-alcotest-1.5.0/.meta/ok.png and /tmp/tmpot56etwz/ojg1AzXAM4/ocaml-alcotest-1.6.0/.meta/ok.png differ diff -Nru ocaml-alcotest-1.5.0/.ocamlformat ocaml-alcotest-1.6.0/.ocamlformat --- ocaml-alcotest-1.5.0/.ocamlformat 1970-01-01 00:00:00.000000000 +0000 +++ ocaml-alcotest-1.6.0/.ocamlformat 2022-06-24 10:04:46.000000000 +0000 @@ -0,0 +1,7 @@ +version = 0.20.1 +profile = conventional +ocaml-version = 4.05.0 + +module-item-spacing = compact +break-infix = fit-or-vertical +parse-docstrings diff -Nru ocaml-alcotest-1.5.0/README.md ocaml-alcotest-1.6.0/README.md --- ocaml-alcotest-1.5.0/README.md 2021-10-09 18:09:55.000000000 +0000 +++ ocaml-alcotest-1.6.0/README.md 2022-06-24 10:04:46.000000000 +0000 @@ -15,8 +15,10 @@ The API documentation can be found [here][docs]. For information on contributing to Alcotest, see [CONTRIBUTING.md](./CONTRIBUTING.md). -[![OCaml-CI Build Status](https://img.shields.io/endpoint?url=https%3A%2F%2Fci.ocamllabs.io%2Fbadge%2Fmirage%2Falcotest%2Fmaster&logo=ocaml)](https://ci.ocamllabs.io/github/mirage/alcotest) -[![docs](https://img.shields.io/badge/doc-online-blue.svg)](https://mirage.github.io/alcotest/alcotest/Alcotest/index.html) +[![OCaml-CI Build Status](https://img.shields.io/endpoint?url=https%3A%2F%2Fci.ocamllabs.io%2Fbadge%2Fmirage%2Falcotest%2Fmain&logo=ocaml)](https://ci.ocamllabs.io/github/mirage/alcotest) +[![Alcotest Documentation](https://img.shields.io/badge/doc-online-blue.svg)][docs] + +[docs]: https://mirage.github.io/alcotest/alcotest/Alcotest/index.html
@@ -104,7 +106,7 @@ Note that you cannot filter by test case name (i.e. `Lower case` or `Capitalization`), you must filter by test name & number instead. -See the [examples](https://github.com/mirage/alcotest/tree/master/examples) +See the [examples](https://github.com/mirage/alcotest/tree/main/examples) folder for more examples. ### Quick and Slow tests diff -Nru ocaml-alcotest-1.5.0/src/alcotest/alcotest.mli ocaml-alcotest-1.6.0/src/alcotest/alcotest.mli --- ocaml-alcotest-1.5.0/src/alcotest/alcotest.mli 2021-10-09 18:09:55.000000000 +0000 +++ ocaml-alcotest-1.6.0/src/alcotest/alcotest.mli 2022-06-24 10:04:46.000000000 +0000 @@ -25,7 +25,7 @@ only faulty runs are fully displayed at the end of the run (with the full logs ready to inspect). - {e Release 1.5.0} *) + {e Release 1.5.0-29-g6be328d} *) include Alcotest_engine.V1.Cli.S with type return = unit diff -Nru ocaml-alcotest-1.5.0/src/alcotest/dune ocaml-alcotest-1.6.0/src/alcotest/dune --- ocaml-alcotest-1.5.0/src/alcotest/dune 2021-10-09 18:09:55.000000000 +0000 +++ ocaml-alcotest-1.6.0/src/alcotest/dune 2022-06-24 10:04:46.000000000 +0000 @@ -1,6 +1,6 @@ (library (public_name alcotest) - (libraries alcotest.engine astring fmt fmt.tty) + (libraries alcotest.engine astring fmt fmt.tty unix) (foreign_stubs (language c) (names alcotest_stubs)) diff -Nru ocaml-alcotest-1.5.0/src/alcotest-async/alcotest_async_intf.ml ocaml-alcotest-1.6.0/src/alcotest-async/alcotest_async_intf.ml --- ocaml-alcotest-1.5.0/src/alcotest-async/alcotest_async_intf.ml 2021-10-09 18:09:55.000000000 +0000 +++ ocaml-alcotest-1.6.0/src/alcotest-async/alcotest_async_intf.ml 2022-06-24 10:04:46.000000000 +0000 @@ -1,12 +1,11 @@ module type V1 = sig - include - Alcotest_engine.V1.Cli.S with type return = unit Async_kernel.Deferred.t + include Alcotest_engine.V1.Cli.S with type return = unit Async.Deferred.t val test_case : - ?timeout:Core_kernel.Time.Span.t -> + ?timeout:Time_unix.Span.t -> string -> Alcotest.speed_level -> - ('a -> unit Async_kernel.Deferred.t) -> + ('a -> unit Async.Deferred.t) -> 'a test_case val test_case_sync : diff -Nru ocaml-alcotest-1.5.0/src/alcotest-async/alcotest_async.ml ocaml-alcotest-1.6.0/src/alcotest-async/alcotest_async.ml --- ocaml-alcotest-1.5.0/src/alcotest-async/alcotest_async.ml 2021-10-09 18:09:55.000000000 +0000 +++ ocaml-alcotest-1.6.0/src/alcotest-async/alcotest_async.ml 2022-06-24 10:04:46.000000000 +0000 @@ -1,5 +1,4 @@ -open Core -open Async_kernel +open Async open Async_unix let run_test timeout name fn args = @@ -8,7 +7,7 @@ | `Timeout -> Alcotest.fail (Printf.sprintf "%s timed out after %s" name - (Time.Span.to_string_hum timeout)) + (Time_unix.Span.to_string_hum timeout)) module Promise = struct include Deferred @@ -25,7 +24,7 @@ let test_case_sync n s f = test_case n s (fun x -> Deferred.return (f x)) - let test_case ?(timeout = sec 2.) name s f = + let test_case ?(timeout = Time_unix.Span.of_sec 2.) name s f = test_case name s (run_test timeout name f) end diff -Nru ocaml-alcotest-1.5.0/src/alcotest-async/dune ocaml-alcotest-1.6.0/src/alcotest-async/dune --- ocaml-alcotest-1.5.0/src/alcotest-async/dune 2021-10-09 18:09:55.000000000 +0000 +++ ocaml-alcotest-1.6.0/src/alcotest-async/dune 2022-06-24 10:04:46.000000000 +0000 @@ -4,8 +4,9 @@ (libraries alcotest.engine alcotest + async async_kernel async_unix base core - core_kernel)) + core_unix.time_unix)) diff -Nru ocaml-alcotest-1.5.0/src/alcotest-engine/cli.ml ocaml-alcotest-1.6.0/src/alcotest-engine/cli.ml --- ocaml-alcotest-1.5.0/src/alcotest-engine/cli.ml 2021-10-09 18:09:55.000000000 +0000 +++ ocaml-alcotest-1.6.0/src/alcotest-engine/cli.ml 2022-06-24 10:04:46.000000000 +0000 @@ -38,7 +38,7 @@ open Cmdliner_syntax let set_color = - let env = Arg.env_var "ALCOTEST_COLOR" in + let env = Cmd.Env.info "ALCOTEST_COLOR" in let+ color_flag = let enum = [ ("auto", `Auto); ("always", `Ansi_tty); ("never", `None) ] in let color = Arg.enum enum in @@ -77,7 +77,7 @@ let config = Config.User.(cli_config || config) in run_with_args' config library_name args tests in - (term, Term.info exec_name ~doc) + (term, Cmd.info exec_name ~doc) let test_cmd config args library_name tests = let doc = "Run a subset of the tests." in @@ -88,33 +88,37 @@ let config = Config.User.(cli_config || config) in run_with_args' config library_name args tests in - (term, Term.info "test" ~doc) + (term, Cmd.info "test" ~doc) let list_cmd tests = let doc = "List all available tests." in ( (let+ () = set_color in list_tests tests), - Term.info "list" ~doc ) + Cmd.info "list" ~doc ) let run_with_args' (type a) ~argv config name (args : a Term.t) (tl : a test list) = let ( >>= ) = M.bind in - let choices = [ list_cmd tl; test_cmd config args name tl ] in + let choices = + List.map + (fun (term, info) -> Cmd.v info term) + [ list_cmd tl; test_cmd config args name tl ] + in let and_exit = Config.User.and_exit config in - let exit_or_return result = - if and_exit then exit (Term.exit_status_of_result result) else M.return () + let exit_or_return exit_code = + if and_exit then exit exit_code else M.return () in let result = - Term.eval_choice ?argv + let default, info = default_cmd config args name tl in + Cmd.eval_value ?argv ~catch:and_exit (* Only log exceptions not raised to the user code *) - (default_cmd config args name tl) - choices + (Cmd.group ~default info choices) in match result with - | `Ok unit_m -> unit_m >>= fun () -> exit_or_return (`Ok ()) - | (`Help | `Version | `Error `Exn) as result -> exit_or_return result - | `Error (`Parse | `Term) as result -> - exit (Term.exit_status_of_result result) + | Ok (`Ok unit_m) -> unit_m >>= fun () -> exit_or_return Cmd.Exit.ok + | Ok (`Help | `Version) -> exit_or_return Cmd.Exit.ok + | Error (`Parse | `Term) -> exit_or_return Cmd.Exit.cli_error + | Error `Exn -> exit Cmd.Exit.internal_error let run_with_args ?and_exit ?verbose ?compact ?tail_errors ?quick_only ?show_errors ?json ?filter ?log_dir ?bail ?record_backtrace ?argv = @@ -124,7 +128,7 @@ let run = Config.User.kcreate (fun config ?argv name tl -> - run_with_args' config ~argv name (Term.pure ()) tl) + run_with_args' config ~argv name (Term.const ()) tl) end module V1 = struct diff -Nru ocaml-alcotest-1.5.0/src/alcotest-engine/config.ml ocaml-alcotest-1.6.0/src/alcotest-engine/config.ml --- ocaml-alcotest-1.5.0/src/alcotest-engine/config.ml 2021-10-09 18:09:55.000000000 +0000 +++ ocaml-alcotest-1.6.0/src/alcotest-engine/config.ml 2022-06-24 10:04:46.000000000 +0000 @@ -34,6 +34,7 @@ (** {1 Definitions of supported keys} *) module Arg = Cmdliner.Arg + module Cmd = Cmdliner.Cmd module And_exit = struct type t = bool @@ -49,7 +50,7 @@ module Verbose = Flag (struct let term = - let env = Arg.env_var "ALCOTEST_VERBOSE" in + let env = Cmd.Env.info "ALCOTEST_VERBOSE" in let doc = "Display the test outputs. $(b,WARNING:) when using this option the \ output logs will not be available for further inspection." @@ -59,14 +60,14 @@ module Compact = Flag (struct let term = - let env = Arg.env_var "ALCOTEST_COMPACT" in + let env = Cmd.Env.info "ALCOTEST_COMPACT" in let doc = "Compact the output of the tests." in Arg.(value & flag & info ~env [ "c"; "compact" ] ~docv:"" ~doc) end) module Bail = Flag (struct let term = - let env = Arg.env_var "ALCOTEST_BAIL" in + let env = Cmd.Env.info "ALCOTEST_BAIL" in let doc = "Stop running tests after the first failure." in Arg.(value & flag & info ~env [ "bail" ] ~docv:"" ~doc) end) @@ -79,14 +80,14 @@ module Show_errors = Flag (struct let term = - let env = Arg.env_var "ALCOTEST_SHOW_ERRORS" in + let env = Cmd.Env.info "ALCOTEST_SHOW_ERRORS" in let doc = "Display the test errors." in Arg.(value & flag & info ~env [ "e"; "show-errors" ] ~docv:"" ~doc) end) module Quick_only = Flag (struct let term = - let env = Arg.env_var "ALCOTEST_QUICK_TESTS" in + let env = Cmd.Env.info "ALCOTEST_QUICK_TESTS" in let doc = "Run only the quick tests." in Arg.(value & flag & info ~env [ "q"; "quick-tests" ] ~docv:"" ~doc) end) @@ -116,7 +117,7 @@ let limit = Arg.conv (limit_parser, limit_printer) let term = - let env = Arg.env_var "ALCOTEST_TAIL_ERRORS" in + let env = Cmd.Env.info "ALCOTEST_TAIL_ERRORS" in let doc = "Show only the last $(docv) lines of output in case of an error." in diff -Nru ocaml-alcotest-1.5.0/src/alcotest-engine/core_intf.ml ocaml-alcotest-1.6.0/src/alcotest-engine/core_intf.ml --- ocaml-alcotest-1.5.0/src/alcotest-engine/core_intf.ml 2021-10-09 18:09:55.000000000 +0000 +++ ocaml-alcotest-1.6.0/src/alcotest-engine/core_intf.ml 2022-06-24 10:04:46.000000000 +0000 @@ -73,11 +73,13 @@ - [show_errors] (default [false]). Display the test errors. - [json] (default [false]). Print test results in a JSON-compatible format. + - [filter]. Filter tests according to [~name], the name of the test, and + [~index], the number of the test case. - [log_dir] (default ["$PWD/_build/_tests/"]). The directory in which to log the output of the tests (if [verbose] is not set). - [bail] (default [false]). If true, stop running the tests after the first failure. - - [record_backtrace] (defualt [true]). Enable backtrace recording before + - [record_backtrace] (default [true]). Enable backtrace recording before beginning testing. *) val run : (string -> unit test list -> return) with_options diff -Nru ocaml-alcotest-1.5.0/src/alcotest-engine/log_trap.ml ocaml-alcotest-1.6.0/src/alcotest-engine/log_trap.ml --- ocaml-alcotest-1.5.0/src/alcotest-engine/log_trap.ml 2021-10-09 18:09:55.000000000 +0000 +++ ocaml-alcotest-1.6.0/src/alcotest-engine/log_trap.ml 2022-06-24 10:04:46.000000000 +0000 @@ -9,7 +9,13 @@ struct open Promise.Syntax - type state = { root : string; uuid : string; suite_name : string } + type state = { + root : string; + uuid : string; + suite_name : string; + has_alias : bool; + } + type t = Inactive | Active of state (** Take a string path and collapse a leading [$HOME] path segment to [~]. *) @@ -30,7 +36,8 @@ let active ~root ~uuid ~suite_name = Platform.prepare_log_trap ~root ~uuid ~name:suite_name; - Active { root; uuid; suite_name } + let has_alias = Platform.file_exists (Filename.concat root suite_name) in + Active { root; uuid; suite_name; has_alias } let pp_path = Fmt.using maybe_collapse_home Fmt.string @@ -63,12 +70,12 @@ in ListLabels.iter display_lines ~f:(Fmt.pf ppf "%s@\n") - let log_dir { suite_name; uuid; root } = - (* We don't create symlinks on Windows. *) - let via_symlink = not Sys.win32 in + let log_dir ~via_symlink { suite_name; uuid; root; has_alias } = + let via_symlink = via_symlink && has_alias in Filename.concat root (if via_symlink then suite_name else uuid) - let output_fpath t tname = Filename.concat (log_dir t) (Test_name.file tname) + let output_fpath ~via_symlink t tname = + Filename.concat (log_dir ~via_symlink t) (Test_name.file tname) let active_or_exn = function | Active t -> t @@ -76,18 +83,18 @@ let pp_current_run_dir t ppf = let t = active_or_exn t in - pp_path ppf (log_dir t) + pp_path ppf (log_dir ~via_symlink:true t) let pp_log_location t tname ppf = let t = active_or_exn t in - let path = output_fpath t tname in + let path = output_fpath ~via_symlink:true t tname in pp_path ppf path let recover_logs t ~tail tname = match t with | Inactive -> None | Active t -> ( - let fpath = output_fpath t tname in + let fpath = output_fpath ~via_symlink:false t tname in match Platform.file_exists fpath with | false -> None | true -> Some (fun ppf -> pp_tail tail fpath ppf)) @@ -96,7 +103,9 @@ match t with | Inactive -> f x | Active t -> - let fd = Platform.open_write_only (output_fpath t tname) in + let fd = + Platform.open_write_only (output_fpath ~via_symlink:false t tname) + in let* () = Promise.return () in let+ a = Platform.with_redirect fd (fun () -> f x) in Platform.close fd; diff -Nru ocaml-alcotest-1.5.0/test/e2e/alcotest/failing/dune.inc ocaml-alcotest-1.6.0/test/e2e/alcotest/failing/dune.inc --- ocaml-alcotest-1.5.0/test/e2e/alcotest/failing/dune.inc 2021-10-09 18:09:55.000000000 +0000 +++ ocaml-alcotest-1.6.0/test/e2e/alcotest/failing/dune.inc 2022-06-24 10:04:46.000000000 +0000 @@ -41,7 +41,7 @@ (target bail.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run %{dep:bail.exe}))))) (rule @@ -60,7 +60,7 @@ (target bail-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run node %{dep:bail.bc.js}))))) (rule @@ -79,7 +79,7 @@ (target check_basic.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run %{dep:check_basic.exe}))))) (rule @@ -98,7 +98,7 @@ (target check_basic-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run node %{dep:check_basic.bc.js}))))) (rule @@ -117,7 +117,7 @@ (target check_located.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run %{dep:check_located.exe}))))) (rule @@ -136,7 +136,7 @@ (target check_located-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run node %{dep:check_located.bc.js}))))) (rule @@ -155,7 +155,7 @@ (target check_long.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run %{dep:check_long.exe}))))) (rule @@ -174,7 +174,7 @@ (target check_long-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run node %{dep:check_long.bc.js}))))) (rule @@ -193,7 +193,7 @@ (target compact.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run %{dep:compact.exe}))))) (rule @@ -212,7 +212,7 @@ (target compact-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run node %{dep:compact.bc.js}))))) (rule @@ -231,7 +231,7 @@ (target duplicate_test_names.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run %{dep:duplicate_test_names.exe}))))) (rule @@ -250,7 +250,7 @@ (target duplicate_test_names-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run node %{dep:duplicate_test_names.bc.js}))))) (rule @@ -269,7 +269,7 @@ (target empty_suite_name.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run %{dep:empty_suite_name.exe}))))) (rule @@ -288,7 +288,7 @@ (target empty_suite_name-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run node %{dep:empty_suite_name.bc.js}))))) (rule @@ -307,7 +307,7 @@ (target exception_in_test.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run %{dep:exception_in_test.exe}))))) (rule @@ -326,7 +326,7 @@ (target exception_in_test-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run node %{dep:exception_in_test.bc.js}))))) (rule @@ -345,7 +345,7 @@ (target filter_all_tests.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run %{dep:filter_all_tests.exe} test bar 1))))) (rule @@ -364,7 +364,7 @@ (target filter_all_tests-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run node %{dep:filter_all_tests.bc.js} test bar 1))))) (rule @@ -383,7 +383,7 @@ (target invalid_arg_in_test.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run %{dep:invalid_arg_in_test.exe}))))) (rule @@ -402,7 +402,7 @@ (target invalid_arg_in_test-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run node %{dep:invalid_arg_in_test.bc.js}))))) (rule @@ -421,7 +421,7 @@ (target long_test_case_name.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run %{dep:long_test_case_name.exe}))))) (rule @@ -440,7 +440,7 @@ (target long_test_case_name-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run node %{dep:long_test_case_name.bc.js}))))) (rule @@ -459,7 +459,7 @@ (target outside_runner.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run %{dep:outside_runner.exe}))))) (rule @@ -478,7 +478,7 @@ (target outside_runner-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run node %{dep:outside_runner.bc.js}))))) (rule @@ -497,7 +497,7 @@ (target tail_errors_limit.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run %{dep:tail_errors_limit.exe}))))) (rule @@ -516,7 +516,7 @@ (target tail_errors_limit-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run node %{dep:tail_errors_limit.bc.js}))))) (rule @@ -535,7 +535,7 @@ (target tail_errors_unlimited.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run %{dep:tail_errors_unlimited.exe}))))) (rule @@ -554,7 +554,7 @@ (target tail_errors_unlimited-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run node %{dep:tail_errors_unlimited.bc.js}))))) (rule @@ -573,7 +573,7 @@ (target unknown_option.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run %{dep:unknown_option.exe} --dry-runn))))) (rule @@ -592,7 +592,7 @@ (target unknown_option-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run node %{dep:unknown_option.bc.js} --dry-runn))))) (rule diff -Nru ocaml-alcotest-1.5.0/test/e2e/alcotest/failing/unknown_option.expected ocaml-alcotest-1.6.0/test/e2e/alcotest/failing/unknown_option.expected --- ocaml-alcotest-1.5.0/test/e2e/alcotest/failing/unknown_option.expected 2021-10-09 18:09:55.000000000 +0000 +++ ocaml-alcotest-1.6.0/test/e2e/alcotest/failing/unknown_option.expected 2022-06-24 10:04:46.000000000 +0000 @@ -1,3 +1,3 @@ -unknown_option.: unknown option `--dry-runn'. -Usage: unknown_option. COMMAND ... -Try `unknown_option. --help' for more information. +unknown_option.: unknown option '--dry-runn'. +Usage: unknown_option. [COMMAND] … +Try 'unknown_option. --help' for more information. diff -Nru ocaml-alcotest-1.5.0/test/e2e/alcotest/failing/unknown_option-js.expected ocaml-alcotest-1.6.0/test/e2e/alcotest/failing/unknown_option-js.expected --- ocaml-alcotest-1.5.0/test/e2e/alcotest/failing/unknown_option-js.expected 2021-10-09 18:09:55.000000000 +0000 +++ ocaml-alcotest-1.6.0/test/e2e/alcotest/failing/unknown_option-js.expected 2022-06-24 10:04:46.000000000 +0000 @@ -1,3 +1,3 @@ -unknown_option.: unknown option `--dry-runn'. -Usage: unknown_option. COMMAND ... -Try `unknown_option. --help' for more information. +unknown_option.: unknown option '--dry-runn'. +Usage: unknown_option. [COMMAND] … +Try 'unknown_option. --help' for more information. diff -Nru ocaml-alcotest-1.5.0/test/e2e/alcotest/passing/dune.inc ocaml-alcotest-1.6.0/test/e2e/alcotest/passing/dune.inc --- ocaml-alcotest-1.5.0/test/e2e/alcotest/passing/dune.inc 2021-10-09 18:09:55.000000000 +0000 +++ ocaml-alcotest-1.6.0/test/e2e/alcotest/passing/dune.inc 2022-06-24 10:04:46.000000000 +0000 @@ -53,7 +53,7 @@ (target and_exit_false.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run %{dep:and_exit_false.exe}))))) (rule @@ -72,7 +72,7 @@ (target and_exit_false-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run node %{dep:and_exit_false.bc.js}))))) (rule @@ -91,7 +91,7 @@ (target and_exit_true.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run %{dep:and_exit_true.exe}))))) (rule @@ -110,7 +110,7 @@ (target and_exit_true-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run node %{dep:and_exit_true.bc.js}))))) (rule @@ -129,7 +129,7 @@ (target assert_and_verbose.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run %{dep:assert_and_verbose.exe}))))) (rule @@ -148,7 +148,7 @@ (target assert_and_verbose-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run node %{dep:assert_and_verbose.bc.js}))))) (rule @@ -167,7 +167,7 @@ (target assert_not_printed.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run %{dep:assert_not_printed.exe}))))) (rule @@ -186,7 +186,7 @@ (target assert_not_printed-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run node %{dep:assert_not_printed.bc.js}))))) (rule @@ -205,7 +205,7 @@ (target basic.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run %{dep:basic.exe}))))) (rule @@ -224,7 +224,7 @@ (target basic-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run node %{dep:basic.bc.js}))))) (rule @@ -243,7 +243,7 @@ (target check_basic.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run %{dep:check_basic.exe}))))) (rule @@ -262,7 +262,7 @@ (target check_basic-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run node %{dep:check_basic.bc.js}))))) (rule @@ -281,7 +281,7 @@ (target cli_verbose.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run %{dep:cli_verbose.exe} --verbose))))) (rule @@ -300,7 +300,7 @@ (target cli_verbose-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run node %{dep:cli_verbose.bc.js} --verbose))))) (rule @@ -319,7 +319,7 @@ (target compact.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run %{dep:compact.exe} --compact))))) (rule @@ -338,7 +338,7 @@ (target compact-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run node %{dep:compact.bc.js} --compact))))) (rule @@ -357,7 +357,7 @@ (target empty_test_name.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run %{dep:empty_test_name.exe}))))) (rule @@ -376,7 +376,7 @@ (target empty_test_name-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run node %{dep:empty_test_name.bc.js}))))) (rule @@ -395,7 +395,7 @@ (target filter_name.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run %{dep:filter_name.exe}))))) (rule @@ -414,7 +414,7 @@ (target filter_name-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run node %{dep:filter_name.bc.js}))))) (rule @@ -433,7 +433,7 @@ (target filter_name_regex.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run %{dep:filter_name_regex.exe}))))) (rule @@ -452,7 +452,7 @@ (target filter_name_regex-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run node %{dep:filter_name_regex.bc.js}))))) (rule @@ -471,7 +471,7 @@ (target filter_range.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run %{dep:filter_range.exe} test main 0..1,1-3,5))))) (rule @@ -490,7 +490,7 @@ (target filter_range-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run node %{dep:filter_range.bc.js} test main 0..1,1-3,5))))) (rule @@ -509,7 +509,7 @@ (target isatty.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run %{dep:isatty.exe}))))) (rule @@ -528,7 +528,7 @@ (target isatty-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run node %{dep:isatty.bc.js}))))) (rule @@ -547,7 +547,7 @@ (target json_output.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run %{dep:json_output.exe}))))) (rule @@ -566,7 +566,7 @@ (target json_output-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run node %{dep:json_output.bc.js}))))) (rule @@ -585,7 +585,7 @@ (target list_tests.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run %{dep:list_tests.exe}))))) (rule @@ -604,7 +604,7 @@ (target list_tests-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run node %{dep:list_tests.bc.js}))))) (rule @@ -623,7 +623,7 @@ (target only_monadic_effects.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run %{dep:only_monadic_effects.exe}))))) (rule @@ -642,7 +642,7 @@ (target only_monadic_effects-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run node %{dep:only_monadic_effects.bc.js}))))) (rule @@ -661,7 +661,7 @@ (target quick_only.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run %{dep:quick_only.exe}))))) (rule @@ -680,7 +680,7 @@ (target quick_only-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run node %{dep:quick_only.bc.js}))))) (rule @@ -699,7 +699,7 @@ (target quick_only_regex.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run %{dep:quick_only_regex.exe}))))) (rule @@ -718,7 +718,7 @@ (target quick_only_regex-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run node %{dep:quick_only_regex.bc.js}))))) (rule @@ -737,7 +737,7 @@ (target separator_testname.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run %{dep:separator_testname.exe}))))) (rule @@ -756,7 +756,7 @@ (target separator_testname-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run node %{dep:separator_testname.bc.js}))))) (rule @@ -775,7 +775,7 @@ (target unicode_testname.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run %{dep:unicode_testname.exe}))))) (rule @@ -794,7 +794,7 @@ (target unicode_testname-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run node %{dep:unicode_testname.bc.js}))))) (rule @@ -813,7 +813,7 @@ (target verbose_newlines.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run %{dep:verbose_newlines.exe}))))) (rule @@ -832,7 +832,7 @@ (target verbose_newlines-js.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run node %{dep:verbose_newlines.bc.js}))))) (rule diff -Nru ocaml-alcotest-1.5.0/test/e2e/alcotest-lwt/failing/dune.inc ocaml-alcotest-1.6.0/test/e2e/alcotest-lwt/failing/dune.inc --- ocaml-alcotest-1.5.0/test/e2e/alcotest-lwt/failing/dune.inc 2021-10-09 18:09:55.000000000 +0000 +++ ocaml-alcotest-1.6.0/test/e2e/alcotest-lwt/failing/dune.inc 2022-06-24 10:04:46.000000000 +0000 @@ -15,7 +15,7 @@ (target async_failure.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run %{dep:async_failure.exe}))))) (rule @@ -34,7 +34,7 @@ (target fail_with.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 1 2 125) + (with-accepted-exit-codes (or 1 2 124 125) (run %{dep:fail_with.exe}))))) (rule diff -Nru ocaml-alcotest-1.5.0/test/e2e/alcotest-lwt/passing/dune.inc ocaml-alcotest-1.6.0/test/e2e/alcotest-lwt/passing/dune.inc --- ocaml-alcotest-1.5.0/test/e2e/alcotest-lwt/passing/dune.inc 2021-10-09 18:09:55.000000000 +0000 +++ ocaml-alcotest-1.6.0/test/e2e/alcotest-lwt/passing/dune.inc 2022-06-24 10:04:46.000000000 +0000 @@ -13,7 +13,7 @@ (target cli_options.actual) (action (with-outputs-to %{target} - (with-accepted-exit-codes (or 0 125) + (with-accepted-exit-codes (or 0 124 125) (run %{dep:cli_options.exe} --json))))) (rule diff -Nru ocaml-alcotest-1.5.0/test/e2e/gen_dune_rules.ml ocaml-alcotest-1.6.0/test/e2e/gen_dune_rules.ml --- ocaml-alcotest-1.5.0/test/e2e/gen_dune_rules.ml 2021-10-09 18:09:55.000000000 +0000 +++ ocaml-alcotest-1.6.0/test/e2e/gen_dune_rules.ml 2022-06-24 10:04:46.000000000 +0000 @@ -61,12 +61,12 @@ let base = chop_extension filename in let options = options_of_test_file filename |> List.map (( ^ ) " ") in let accepted_exit_codes = - Fmt.str "(or %s %d)" + Fmt.str "(or %s %d %d)" (if expect_failure then (* 1 = failing test, 2 = failed assertion outside runner *) "1 2" else "0") - Cmdliner.Term.exit_status_internal_error + Cmdliner.Cmd.Exit.cli_error Cmdliner.Cmd.Exit.internal_error in (* Run Alcotest to get *.actual, then pass through the strip_randomness sanitiser to get *.processed. *) @@ -154,9 +154,8 @@ in Arg.(value & flag doc) -let term = - Term. - ( const main $ package $ expect_failure $ libraries $ js, - info ~version:"1.5.0" "gen_dune_rules" ) +let cmd = + let info = Cmd.info ~version:"1.5.0-29-g6be328d" "gen_dune_rules" in + Cmd.v info Term.(const main $ package $ expect_failure $ libraries $ js) -let () = Term.(exit @@ eval term) +let () = exit @@ Cmd.eval cmd