-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert pipe tests to cram and port to Windows
- Loading branch information
Showing
16 changed files
with
208 additions
and
301 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
let () = | ||
Helpers.with_pipe @@ fun pipe -> | ||
Luv.Pipe.bind pipe Helpers.filename |> ok "bind" @@ fun () -> | ||
print_endline "Ok" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
let () = | ||
Helpers.with_pipe @@ fun pipe -> | ||
Luv.Pipe.bind pipe Helpers.filename |> ok "bind" @@ fun () -> | ||
Luv.Pipe.chmod pipe [`READABLE] |> ok "chmod" @@ fun () -> | ||
print_endline "Ok" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
let () = | ||
Helpers.with_pipe @@ fun pipe -> | ||
Luv.Pipe.chmod pipe [`READABLE] |> error [`EBADF] "chmod" @@ fun () -> | ||
print_endline "Ok" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
let () = | ||
Luv.Error.set_on_unhandled_exception (function | ||
| Exit -> print_endline "Ok"; exit 0 | ||
| _ -> ()); | ||
|
||
Helpers.with_server_and_client () | ||
~server:(fun server_pipe accept_pipe -> Luv.Handle.close server_pipe ignore) | ||
~client:(fun client_pipe -> raise Exit) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
(cram | ||
(alias runtest-windows) | ||
(deps | ||
trivial.exe | ||
bind.exe | ||
listen_accept.exe | ||
getsockname.exe | ||
getpeername.exe | ||
connect_exception.exe | ||
read_write.exe | ||
receive_handle.exe | ||
chmod.exe | ||
chmod_error.exe | ||
handle.exe | ||
)) | ||
|
||
(executables | ||
(names | ||
trivial | ||
bind | ||
listen_accept | ||
getsockname | ||
getpeername | ||
connect_exception | ||
read_write | ||
receive_handle | ||
chmod | ||
chmod_error | ||
handle | ||
) | ||
(libraries luv unit_helpers) | ||
(flags -open Unit_helpers)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
let () = | ||
Helpers.with_server_and_client () | ||
~server:begin fun server_pipe accept_pipe -> | ||
Luv.Handle.close server_pipe ignore | ||
end | ||
~client:begin fun client_pipe -> | ||
Luv.Pipe.getpeername client_pipe |> ok "getpeername" @@ fun filename' -> | ||
Printf.printf "%b\n" (filename' = Helpers.filename) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
let () = | ||
Helpers.with_pipe @@ fun pipe -> | ||
|
||
Luv.Pipe.bind pipe Helpers.filename |> ok "bind" @@ fun () -> | ||
Luv.Pipe.getsockname pipe |> ok "getsockname" @@ fun filename' -> | ||
|
||
Printf.printf "%b\n" (filename' = Helpers.filename) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
(* This is a compilation test. If the type constraints in handle.mli are wrong, | ||
there will be a type error in this test. *) | ||
let () = | ||
Helpers.with_pipe begin fun pipe -> | ||
ignore @@ Luv.Handle.send_buffer_size pipe; | ||
ignore @@ Luv.Handle.recv_buffer_size pipe; | ||
ignore @@ Luv.Handle.set_send_buffer_size pipe 4096; | ||
ignore @@ Luv.Handle.set_recv_buffer_size pipe 4096; | ||
ignore @@ Luv.Handle.fileno pipe | ||
end; | ||
|
||
print_endline "Ok" |
Oops, something went wrong.