-
Notifications
You must be signed in to change notification settings - Fork 26
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
Update lib_test/mirage for Mirage 3.x #110
Conversation
https://mirage.io/wiki/mirage2-to-mirage3 was an incredible resource for helping me update this test code. Tested against Mirage 3.0.5 and ocaml-vchan 3.0.0.
lib_test/mirage/unikernel.ml
Outdated
|`Eof -> C.log c "EOF"; OS.Time.sleep 5. | ||
|`Error _ -> C.log c "ERR"; OS.Time.sleep 5. | ||
|`Ok buf -> | ||
| Ok `Eof -> OS.Time.sleep_ns (5.0 *. 1e9 |> Int64.of_float) >>= fun () -> C.log c "EOF" |
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.
you may be interested in the duration library - Duration.of_sec 5
does exactly that (and is much more readable) -- plus it doesn't use floating point "numbers" \o/
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.
Ah, yes! A wonderful recommendation. Thanks!
Thanks very much for this contribution (and the compliment on the porting guide), @mneilsen ! :) |
CHANGES: * Modernise build for OCaml 4.04 and port to Dune (mirage/ocaml-vchan#120 @talex5 @avsm) * Upgrade opam metadata files to 2.0 (mirage/ocaml-vchan#120 @avsm @talex5) * Remove mli only module (mirage/ocaml-vchan#114 @rgrinberg @samoht) * Fix deprecation warning on String.create (mirage/ocaml-vchan#112 @samoht) * Make OCaml 4.04 the minimum version (mirage/ocaml-vchan#111 @cfcs @hannesm) * Update test cases for Mirage 3 (mirage/ocaml-vchan#110 @mneilsen)
CHANGES: * Modernise build for OCaml 4.04 and port to Dune (mirage/ocaml-vchan#120 @talex5 @avsm) * Upgrade opam metadata files to 2.0 (mirage/ocaml-vchan#120 @avsm @talex5) * Remove mli only module (mirage/ocaml-vchan#114 @rgrinberg @samoht) * Fix deprecation warning on String.create (mirage/ocaml-vchan#112 @samoht) * Make OCaml 4.04 the minimum version (mirage/ocaml-vchan#111 @cfcs @hannesm) * Update test cases for Mirage 3 (mirage/ocaml-vchan#110 @mneilsen)
CHANGES: * Modernise build for OCaml 4.04 and port to Dune (mirage/ocaml-vchan#120 @talex5 @avsm) * Upgrade opam metadata files to 2.0 (mirage/ocaml-vchan#120 @avsm @talex5) * Remove mli only module (mirage/ocaml-vchan#114 @rgrinberg @samoht) * Fix deprecation warning on String.create (mirage/ocaml-vchan#112 @samoht) * Make OCaml 4.04 the minimum version (mirage/ocaml-vchan#111 @cfcs @hannesm) * Update test cases for Mirage 3 (mirage/ocaml-vchan#110 @mneilsen)
https://mirage.io/wiki/mirage2-to-mirage3 was an incredible resource for
helping me update this test code. Tested against Mirage 3.0.5 and
ocaml-vchan 3.0.0.