Skip to content

Commit

Permalink
Upgrade to async v0.15
Browse files Browse the repository at this point in the history
  • Loading branch information
crackcomm committed Apr 19, 2022
1 parent 75f6336 commit 9380ab8
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 21 deletions.
9 changes: 5 additions & 4 deletions alcotest-async.opam
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ depends: [
"dune" {>= "2.8"}
"re" {with-test}
"fmt" {with-test}
"cmdliner" {with-test & < "1.1.0"}
"core"
"cmdliner" {with-test & >= "1.1.0"}
"core" {>= "0.15.0"}
"core_unix" {>= "0.15.0"}
"base"
"async_kernel"
"ocaml" {>= "4.05.0"}
"alcotest" {= version}
"async_unix" {>= "v0.9.0"}
"core_kernel" {>= "v0.9.0"}
"async" {>= "v0.15.0"}
"async_unix" {>= "v0.15.0"}
"odoc" {with-doc}
]
build: [
Expand Down
2 changes: 1 addition & 1 deletion alcotest-js.opam
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ depends: [
"alcotest" {= version}
"js_of_ocaml-compiler" {>= "3.11.0"}
"fmt" {with-test & >= "0.8.7"}
"cmdliner" {with-test & >= "1.0.0" & < "1.1.0"}
"cmdliner" {with-test & >= "1.1.0"}
"odoc" {with-doc}
]
build: [
Expand Down
2 changes: 1 addition & 1 deletion alcotest-lwt.opam
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ bug-reports: "https://github.com/mirage/alcotest/issues"
depends: [
"dune" {>= "2.8"}
"re" {with-test}
"cmdliner" {with-test & < "1.1.0"}
"cmdliner" {with-test & >= "1.1.0"}
"fmt"
"ocaml" {>= "4.05.0"}
"alcotest" {= version}
Expand Down
2 changes: 1 addition & 1 deletion alcotest-mirage.opam
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ bug-reports: "https://github.com/mirage/alcotest/issues"
depends: [
"dune" {>= "2.8"}
"re" {with-test}
"cmdliner" {with-test & < "1.1.0"}
"cmdliner" {with-test & >= "1.1.0"}
"fmt"
"ocaml" {>= "4.05.0"}
"alcotest" {= version}
Expand Down
2 changes: 1 addition & 1 deletion alcotest.opam
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ depends: [
"ocaml" {>= "4.05.0"}
"fmt" {>= "0.8.7"}
"astring"
"cmdliner" {>= "1.0.0" & < "1.1.0"}
"cmdliner" {>= "1.1.0"}
"re" {>= "1.7.2"}
"stdlib-shims"
"uutf" {>= "1.0.1"}
Expand Down
11 changes: 6 additions & 5 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ tests to run.
(ocaml (>= 4.05.0))
(fmt (>= 0.8.7))
astring
(cmdliner (and (>= 1.0.0) (< 1.1.0)))
(cmdliner (>= 1.1.0))
(re (>= 1.7.2))
stdlib-shims
(uutf (>= 1.0.1))
Expand All @@ -44,8 +44,9 @@ tests to run.
(depends
(re :with-test)
(fmt :with-test)
(cmdliner (and :with-test (< 1.1.0)))
(cmdliner (and :with-test (>= 1.1.0)))
core
core_unix
base
async_kernel
(ocaml (>= 4.05.0))
Expand All @@ -60,7 +61,7 @@ tests to run.
(documentation "https://mirage.github.io/alcotest")
(depends
(re :with-test)
(cmdliner (and :with-test (< 1.1.0)))
(cmdliner (and :with-test (>= 1.1.0)))
fmt
(ocaml (>= 4.05.0))
(alcotest (= :version))
Expand All @@ -74,7 +75,7 @@ tests to run.
(documentation "https://mirage.github.io/alcotest")
(depends
(re :with-test)
(cmdliner (and :with-test (< 1.1.0)))
(cmdliner (and :with-test (>= 1.1.0)))
fmt
(ocaml (>= 4.05.0))
(alcotest (= :version))
Expand All @@ -92,4 +93,4 @@ tests to run.
(alcotest (= :version))
(js_of_ocaml-compiler (>= 3.11.0))
(fmt (and :with-test (>= 0.8.7)))
(cmdliner (and :with-test (>= 1.0.0) (< 1.1.0)))))
(cmdliner (and :with-test (>= 1.1.0)))))
7 changes: 3 additions & 4 deletions src/alcotest-async/alcotest_async.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
open Core
open Async_kernel
open Async
open Async_unix

let run_test timeout name fn args =
Expand All @@ -8,7 +7,7 @@ let run_test timeout name fn args =
| `Timeout ->
Alcotest.fail
(Printf.sprintf "%s timed out after %s" name
(Time.Span.to_string_hum timeout))
(Time_unix.Span.to_string_hum timeout))

module Promise = struct
include Deferred
Expand All @@ -25,7 +24,7 @@ module V1 = struct

let test_case_sync n s f = test_case n s (fun x -> Deferred.return (f x))

let test_case ?(timeout = sec 2.) name s f =
let test_case ?(timeout = Time_unix.Span.of_sec 2.) name s f =
test_case name s (run_test timeout name f)
end

Expand Down
6 changes: 3 additions & 3 deletions src/alcotest-async/alcotest_async_intf.ml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module type V1 = sig
include
Alcotest_engine.V1.Cli.S with type return = unit Async_kernel.Deferred.t
Alcotest_engine.V1.Cli.S with type return = unit Async.Deferred.t

val test_case :
?timeout:Core_kernel.Time.Span.t ->
?timeout:Time_unix.Span.t ->
string ->
Alcotest.speed_level ->
('a -> unit Async_kernel.Deferred.t) ->
('a -> unit Async.Deferred.t) ->
'a test_case

val test_case_sync :
Expand Down
3 changes: 2 additions & 1 deletion src/alcotest-async/dune
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
(libraries
alcotest.engine
alcotest
async
async_kernel
async_unix
base
core
core_kernel))
core_unix.time_unix))

0 comments on commit 9380ab8

Please # to comment.