-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting MDX tests working on Windows #589
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
||
<!-- $MDX os_type<>Win32 --> | ||
```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: | ||
|
||
<!-- $MDX os_type<>Win32 --> | ||
```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: | ||
|
||
<!-- $MDX os_type<>Win32 --> | ||
```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, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I disabled the process tests. There are two problems:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah. We really need a way to selectively disable tests on different platforms (e.g. realworldocaml/mdx#393). |
||
or use the `parse_out` convenience wrapper: | ||
|
||
<!-- $MDX os_type<>Win32 --> | ||
```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): | ||
|
||
<!-- $MDX os_type<>Win32 --> | ||
```ocaml | ||
# Eio_main.run @@ fun env -> | ||
let proc_mgr = Eio.Stdenv.process_mgr env in | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason this test never completes. So, I disabled it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems worrying! Is it only an MDX thing, or does the example in
examples/net
also hang if the server side isn't running?