Skip to content

Commit 2d9e24a

Browse files
authored
Merge pull request ocaml-multicore#782 from talex5/openbsd
Fix tests on OpenBSD
2 parents 681400c + ae0eaa2 commit 2d9e24a

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

dune-project

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
(eio (= :version))
4949
(iomux (>= 0.2))
5050
(mdx (and (>= 2.4.1) :with-test))
51+
(conf-bash :with-test)
5152
(fmt (>= 0.8.9))))
5253
(package
5354
(name eio_windows)

eio_posix.opam

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ depends: [
1313
"eio" {= version}
1414
"iomux" {>= "0.2"}
1515
"mdx" {>= "2.4.1" & with-test}
16+
"conf-bash" {with-test}
1617
"fmt" {>= "0.8.9"}
1718
"odoc" {with-doc}
1819
]

tests/network.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,9 @@ Exception: Eio.Io Fs Not_found _,
620620
```ocaml
621621
# Eio_main.run @@ fun env ->
622622
let sockaddr = `Tcp (Eio.Net.Ipaddr.V4.loopback, 80) in
623-
Eio.Net.getnameinfo env#net sockaddr;;
623+
let (host, service) = Eio.Net.getnameinfo env#net sockaddr in
624+
let service = if service = "www" then "http" else service in (* OpenBSD *)
625+
(host, service)
624626
- : string * string = ("localhost", "http")
625627
```
626628

tests/process.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,24 +145,24 @@ If a command fails, we get shown the arguments (quoted if necessary):
145145

146146
```ocaml
147147
# run @@ fun mgr env ->
148-
Process.run mgr ["bash"; "-c"; "exit 3"; ""; "foo"; "\"bar\""];;
148+
Process.run mgr ["sh"; "-c"; "exit 3"; ""; "foo"; "\"bar\""];;
149149
Exception:
150150
Eio.Io Process Child_error Exited (code 3),
151-
running command: bash -c "exit 3" "" foo "\"bar\""
151+
running command: sh -c "exit 3" "" foo "\"bar\""
152152
```
153153

154154
Exit code success can be determined by is_success (Process.run):
155155

156156
```ocaml
157157
# run @@ fun mgr env ->
158-
Process.run ~is_success:(Int.equal 3) mgr ["bash"; "-c"; "exit 3"];;
158+
Process.run ~is_success:(Int.equal 3) mgr ["sh"; "-c"; "exit 3"];;
159159
- : unit = ()
160160
161161
# run @@ fun mgr env ->
162-
Process.run ~is_success:(Int.equal 3) mgr ["bash"; "-c"; "exit 0"];;
162+
Process.run ~is_success:(Int.equal 3) mgr ["sh"; "-c"; "exit 0"];;
163163
Exception:
164164
Eio.Io Process Child_error Exited (code 0),
165-
running command: bash -c "exit 0"
165+
running command: sh -c "exit 0"
166166
```
167167

168168
Exit code success can be determined by is_success (Process.parse_out):

0 commit comments

Comments
 (0)