From acb2ad569f3e2d38453a13778a1f6ec84f7069aa Mon Sep 17 00:00:00 2001 From: Vesa Karvonen Date: Fri, 21 Jul 2023 14:26:51 +0300 Subject: [PATCH 1/2] Get MDX tests working on Windows --- README.md | 11 ++++++++++- dune | 1 - 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 32680abf9..57ec8f276 100644 --- a/README.md +++ b/README.md @@ -752,12 +752,17 @@ Eio.Io Net Connection_failure Refused Unix_error (Connection refused, "connect", ``` If we ran this using another backend, the `Unix_error` part might change. -To avoid this problem, you can use `Eio.Exn.Backend.show` to hide the backend-specific part of errors: +To avoid this problem, you can use `Eio.Exn.Backend.show` ```ocaml # Eio.Exn.Backend.show := false;; - : unit = () +``` + +to hide the backend-specific part of errors: + +```ocaml # Eio_main.run @@ fun env -> let net = Eio.Stdenv.net env in Switch.run @@ fun sw -> @@ -892,6 +897,7 @@ perhaps with `open_dir` to constrain all access to be within that directory. Spawning a child process can be done using the [Eio.Process][] module: + ```ocaml # Eio_main.run @@ fun env -> let proc_mgr = Eio.Stdenv.process_mgr env in @@ -903,6 +909,7 @@ hello There are various optional arguments for setting the process's current directory or connecting up the standard streams. For example, we can use `tr` to convert some text to upper-case: + ```ocaml # Eio_main.run @@ fun env -> let proc_mgr = Eio.Stdenv.process_mgr env in @@ -915,6 +922,7 @@ ONE TWO THREE If you want to capture the output of a process, you can provide a suitable `Eio.Flow.sink` as the `stdout` argument, or use the `parse_out` convenience wrapper: + ```ocaml # Eio_main.run @@ fun env -> let proc_mgr = Eio.Stdenv.process_mgr env in @@ -924,6 +932,7 @@ or use the `parse_out` convenience wrapper: All process functions either return the exit status or check that it was zero (success): + ```ocaml # Eio_main.run @@ fun env -> let proc_mgr = Eio.Stdenv.process_mgr env in diff --git a/dune b/dune index 5c5a1c5cf..904da8b2b 100644 --- a/dune +++ b/dune @@ -2,5 +2,4 @@ (package eio_main) (deps (package eio_main) (package kcas) (env_var "EIO_BACKEND")) (preludes doc/prelude.ml) - (enabled_if (<> %{os_type} "Win32")) (files README.md)) From 8ce161db91cc022ce6bf995938d90d79b56f42b5 Mon Sep 17 00:00:00 2001 From: Vesa Karvonen Date: Thu, 27 Jul 2023 14:32:31 +0300 Subject: [PATCH 2/2] Skip tests by os_type --- README.md | 10 +++++----- dune-project | 8 ++++---- eio.opam | 2 +- eio_linux.opam | 2 +- eio_main.opam | 2 +- eio_posix.opam | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 57ec8f276..7de7b8f8c 100644 --- a/README.md +++ b/README.md @@ -761,7 +761,7 @@ To avoid this problem, you can use `Eio.Exn.Backend.show` to hide the backend-specific part of errors: - + ```ocaml # Eio_main.run @@ fun env -> let net = Eio.Stdenv.net env in @@ -897,7 +897,7 @@ perhaps with `open_dir` to constrain all access to be within that directory. Spawning a child process can be done using the [Eio.Process][] module: - + ```ocaml # Eio_main.run @@ fun env -> let proc_mgr = Eio.Stdenv.process_mgr env in @@ -909,7 +909,7 @@ hello There are various optional arguments for setting the process's current directory or connecting up the standard streams. For example, we can use `tr` to convert some text to upper-case: - + ```ocaml # Eio_main.run @@ fun env -> let proc_mgr = Eio.Stdenv.process_mgr env in @@ -922,7 +922,7 @@ ONE TWO THREE If you want to capture the output of a process, you can provide a suitable `Eio.Flow.sink` as the `stdout` argument, or use the `parse_out` convenience wrapper: - + ```ocaml # Eio_main.run @@ fun env -> let proc_mgr = Eio.Stdenv.process_mgr env in @@ -932,7 +932,7 @@ or use the `parse_out` convenience wrapper: All process functions either return the exit status or check that it was zero (success): - + ```ocaml # Eio_main.run @@ fun env -> let proc_mgr = Eio.Stdenv.process_mgr env in diff --git a/dune-project b/dune-project index 89d4f8809..85e56a3d0 100644 --- a/dune-project +++ b/dune-project @@ -28,7 +28,7 @@ (domain-local-await (>= 0.1.0)) (crowbar (and (>= 0.2) :with-test)) (mtime (>= 2.0.0)) - (mdx (and (>= 2.2.0) :with-test)) + (mdx (and (>= 2.3.1) :with-test)) (dscheck (and (>= 0.1.0) :with-test)))) (package (name eio_linux) @@ -38,7 +38,7 @@ (depends (alcotest (and (>= 1.7.0) :with-test)) (eio (= :version)) - (mdx (and (>= 2.2.0) :with-test)) + (mdx (and (>= 2.3.1) :with-test)) (logs (>= 0.7.0)) (fmt (>= 0.8.9)) (cmdliner (and (>= 1.1.0) :with-test)) @@ -51,7 +51,7 @@ (depends (eio (= :version)) (iomux (>= 0.2)) - (mdx (and (>= 2.2.0) :with-test)) + (mdx (and (>= 2.3.1) :with-test)) (fmt (>= 0.8.9)))) (package (name eio_windows) @@ -67,7 +67,7 @@ (synopsis "Effect-based direct-style IO mainloop for OCaml") (description "Selects an appropriate Eio backend for the current platform.") (depends - (mdx (and (>= 2.2.0) :with-test)) + (mdx (and (>= 2.3.1) :with-test)) (kcas (and (>= 0.3.0) :with-test)) (yojson (and (>= 2.0.2) :with-test)) (eio_linux (and (= :version) (= :os "linux"))) diff --git a/eio.opam b/eio.opam index 30a3b9fdb..5d47dec7e 100644 --- a/eio.opam +++ b/eio.opam @@ -21,7 +21,7 @@ depends: [ "domain-local-await" {>= "0.1.0"} "crowbar" {>= "0.2" & with-test} "mtime" {>= "2.0.0"} - "mdx" {>= "2.2.0" & with-test} + "mdx" {>= "2.3.1" & with-test} "dscheck" {>= "0.1.0" & with-test} "odoc" {with-doc} ] diff --git a/eio_linux.opam b/eio_linux.opam index 94f2f56d9..a1b734a99 100644 --- a/eio_linux.opam +++ b/eio_linux.opam @@ -12,7 +12,7 @@ depends: [ "dune" {>= "3.9"} "alcotest" {>= "1.7.0" & with-test} "eio" {= version} - "mdx" {>= "2.2.0" & with-test} + "mdx" {>= "2.3.1" & with-test} "logs" {>= "0.7.0"} "fmt" {>= "0.8.9"} "cmdliner" {>= "1.1.0" & with-test} diff --git a/eio_main.opam b/eio_main.opam index f152b18ea..000d98e70 100644 --- a/eio_main.opam +++ b/eio_main.opam @@ -10,7 +10,7 @@ doc: "https://ocaml-multicore.github.io/eio/" bug-reports: "https://github.com/ocaml-multicore/eio/issues" depends: [ "dune" {>= "3.9"} - "mdx" {>= "2.2.0" & with-test} + "mdx" {>= "2.3.1" & with-test} "kcas" {>= "0.3.0" & with-test} "yojson" {>= "2.0.2" & with-test} "eio_linux" {= version & os = "linux"} diff --git a/eio_posix.opam b/eio_posix.opam index bba85875f..f941c1512 100644 --- a/eio_posix.opam +++ b/eio_posix.opam @@ -12,7 +12,7 @@ depends: [ "dune" {>= "3.9"} "eio" {= version} "iomux" {>= "0.2"} - "mdx" {>= "2.2.0" & with-test} + "mdx" {>= "2.3.1" & with-test} "fmt" {>= "0.8.9"} "odoc" {with-doc} ]