Skip to content

Commit 76b3db6

Browse files
authored
Merge pull request #5884 from edwintorok/private/edvint/ci-to-quicktest
CP-50448: run quickcheck tests in XenRT
2 parents afe5fec + efcb7af commit 76b3db6

File tree

18 files changed

+65
-21
lines changed

18 files changed

+65
-21
lines changed

ocaml/libs/clock/dune

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,23 @@
1111
)
1212
)
1313

14-
(tests
15-
(names test_date test_timer)
14+
(library
15+
(name test_timer)
1616
(package clock)
17-
(modules test_date test_timer)
17+
(modules test_timer)
1818
(libraries
1919
alcotest
2020
clock
2121
fmt
22-
mtime
2322
mtime.clock.os
24-
ptime
2523
qcheck-alcotest
2624
qcheck-core
27-
qcheck-core.runner
2825
)
2926
)
27+
28+
(tests
29+
(names test_date test_timer_run)
30+
(package clock)
31+
(modules test_date test_timer_run)
32+
(libraries alcotest clock fmt mtime mtime.clock.os ptime qcheck-core qcheck-alcotest test_timer)
33+
)

ocaml/libs/clock/test_timer.ml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ let test_timer_remaining =
6060
Mtime.Span.pp duration Timer.pp timer ;
6161
true
6262

63-
let tests_timer = List.map QCheck_alcotest.to_alcotest [test_timer_remaining]
64-
6563
let combinations =
6664
let pair x y = (x, y) in
6765
let rec loop acc = function
@@ -154,4 +152,4 @@ let test_conversion_from_s =
154152
let tests_span =
155153
List.concat [test_conversion_to_s; test_conversion_from_s; test_span_compare]
156154

157-
let () = Alcotest.run "Timer" [("Timer", tests_timer); ("Span", tests_span)]
155+
let tests = [test_timer_remaining]

ocaml/libs/clock/test_timer.mli

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
val tests_span : unit Alcotest.V1.test_case list
2+
3+
val tests : QCheck2.Test.t list

ocaml/libs/clock/test_timer_run.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
let tests_timer = List.map QCheck_alcotest.to_alcotest Test_timer.tests
2+
3+
let () =
4+
Alcotest.run "Timer" [("Timer", tests_timer); ("Span", Test_timer.tests_span)]

ocaml/libs/clock/test_timer_run.mli

Whitespace-only changes.

ocaml/libs/http-lib/bufio_test.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ let test_buf_io =
9898
in
9999
true
100100

101+
let tests = [test_buf_io]
102+
101103
let () =
102104
(* avoid SIGPIPE *)
103105
let (_ : Sys.signal_behavior) = Sys.signal Sys.sigpipe Sys.Signal_ignore in
104-
QCheck_base_runner.run_tests_main [test_buf_io]
106+
()

ocaml/libs/http-lib/bufio_test.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
val tests : QCheck2.Test.t list

ocaml/libs/http-lib/bufio_test_run.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let () = QCheck_base_runner.run_tests_main Bufio_test.tests

ocaml/libs/http-lib/bufio_test_run.mli

Whitespace-only changes.

ocaml/libs/http-lib/dune

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
(public_name http-lib)
44
(modes best)
55
(wrapped false)
6-
(modules (:standard \ http_svr http_proxy server_io http_test radix_tree_test test_client test_server bufio_test))
6+
(modules (:standard \ http_svr http_proxy server_io http_test radix_tree_test test_client test_server bufio_test bufio_test_run))
77
(preprocess (per_module ((pps ppx_deriving_rpc) Http)))
88
(libraries
99
astring
@@ -67,9 +67,21 @@
6767
)
6868

6969
(test
70-
(name bufio_test)
70+
(name bufio_test_run)
7171
(package http-lib)
7272
(modes (best exe))
73+
(modules bufio_test_run)
74+
(libraries
75+
qcheck-core.runner
76+
bufio_test
77+
)
78+
; use fixed seed to avoid causing random failures in CI and package builds
79+
(action (run %{test} -v -bt --seed 42))
80+
)
81+
82+
(library
83+
(name bufio_test)
84+
(modes best)
7385
(modules bufio_test)
7486
(libraries
7587
fmt
@@ -79,11 +91,8 @@
7991
rresult
8092
http_lib
8193
qcheck-core
82-
qcheck-core.runner
8394
xapi_fd_test
8495
)
85-
; use fixed seed to avoid causing random failures in CI and package builds
86-
(action (run %{test} -v -bt --seed 42))
8796
)
8897

8998
(rule

0 commit comments

Comments
 (0)