Skip to content

Commit aa871d0

Browse files
committed
Skip tearing test on < OCaml 5.4
1 parent 595de55 commit aa871d0

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

src/array/stm_tests.ml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,17 @@ end
200200
module ArraySTM_seq = STM_sequential.Make(AConf)
201201
module ArraySTM_dom = STM_domain.Make(AConf)
202202
module ArraySTM_dom_tear = STM_domain.Make(struct include AConf let next_state _ s = s let postcond = postcond_tear end)
203-
;;
204-
QCheck_base_runner.run_tests_main
205-
(let count = 1000 in
206-
[ArraySTM_seq.agree_test ~count ~name:"STM Array test sequential";
207-
ArraySTM_dom.neg_agree_test_par ~count ~name:"STM Array test parallel"; (* this test is expected to fail *)
208-
ArraySTM_dom_tear.agree_test_par ~count ~name:"STM Array test tearing parallel";
209-
])
203+
204+
let _ =
205+
let count = 1000 in
206+
let tests =
207+
[ArraySTM_seq.agree_test ~count ~name:"STM Array test sequential";
208+
ArraySTM_dom.neg_agree_test_par ~count ~name:"STM Array test parallel"] (* this test is expected to fail *)
209+
@
210+
if Sys.(ocaml_release.major,ocaml_release.minor) < (5,4)
211+
then
212+
(Printf.printf "Skipping STM Array test tearing parallel on < OCaml 5.4\n%!"; [])
213+
else
214+
[ArraySTM_dom_tear.agree_test_par ~count ~name:"STM Array test tearing parallel"]
215+
in
216+
QCheck_base_runner.run_tests_main tests

0 commit comments

Comments
 (0)