diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml index 781c259a6..c60d497cd 100644 --- a/.github/workflows/common.yml +++ b/.github/workflows/common.yml @@ -110,8 +110,6 @@ jobs: runs-on: ${{ inputs.runs_on }} - timeout-minutes: ${{ inputs.timeout }} - outputs: skippart2: ${{ steps.winonlyone.outputs.skippart2 }} @@ -305,10 +303,14 @@ jobs: if: env.ONLY_TEST == '' - name: Run the multicore test suite (Linux / macOS) + env: + QCHECK_STATISTICS_FILE: 'stats' run: opam exec -- dune runtest -j1 --no-buffer --display=quiet --cache=disabled --error-reporting=twice $SUBSUITE if: "runner.os != 'Windows' && env.ONLY_TEST == ''" - name: Run the multicore test suite (Windows / Cygwin) + env: + QCHECK_STATISTICS_FILE: 'stats' run: opam exec -- dune runtest -j1 --no-buffer --display=quiet --cache=disabled --error-reporting=twice @(-Split $Env:SUBSUITE) if: "runner.os == 'Windows' && env.ONLY_TEST == ''" diff --git a/lib/STM_domain.ml b/lib/STM_domain.ml index 6d8d3dffa..69695d88a 100644 --- a/lib/STM_domain.ml +++ b/lib/STM_domain.ml @@ -34,7 +34,7 @@ module Make (Spec: Spec) = struct let obs1 = match obs1 with Ok v -> v | Error exn -> raise exn in let obs2 = match obs2 with Ok v -> v | Error exn -> raise exn in check_obs pref_obs obs1 obs2 Spec.init_state - || Test.fail_reportf " Results incompatible with linearized model\n\n%s" + || Util.fail_reportf " Results incompatible with linearized model\n\n%s" @@ print_triple_vertical ~fig_indent:5 ~res_width:35 (fun (c,r) -> Printf.sprintf "%s : %s" (Spec.show_cmd c) (show_res r)) (pref_obs,obs1,obs2) @@ -57,7 +57,7 @@ module Make (Spec: Spec) = struct let parent_obs = match parent_obs with Ok v -> v | Error exn -> raise exn in let child_obs = match child_obs with Ok v -> v | Error exn -> raise exn in check_obs pref_obs parent_obs child_obs Spec.init_state - || Test.fail_reportf " Results incompatible with linearized model:\n\n%s" + || Util.fail_reportf " Results incompatible with linearized model:\n\n%s" @@ print_triple_vertical ~fig_indent:5 ~res_width:35 ~center_prefix:false (fun (c,r) -> Printf.sprintf "%s : %s" (Spec.show_cmd c) (show_res r)) (pref_obs,parent_obs,child_obs) @@ -66,7 +66,7 @@ module Make (Spec: Spec) = struct let rep_count = 25 in let seq_len,par_len = 20,12 in let max_gen = 3*count in (* precond filtering may require extra generation: max. 3*count though *) - Test.make ~retries:10 ~max_gen ~count ~name + Util.make_test ~retries:10 ~max_gen ~count ~name (arb_cmds_triple seq_len par_len) (fun triple -> assume (all_interleavings_ok triple); @@ -76,7 +76,7 @@ module Make (Spec: Spec) = struct let rep_count = 25 in let seq_len,par_len = 20,12 in let max_gen = 3*count in (* precond filtering may require extra generation: max. 3*count though *) - Test.make_neg ~retries:10 ~max_gen ~count ~name + Util.make_neg_test ~retries:10 ~max_gen ~count ~name (arb_cmds_triple seq_len par_len) (fun triple -> assume (all_interleavings_ok triple); @@ -86,7 +86,7 @@ module Make (Spec: Spec) = struct let rep_count = 25 in let seq_len,par_len = 20,12 in let max_gen = 3*count in (* precond filtering may require extra generation: max. 3*count though *) - Test.make ~retries:10 ~max_gen ~count ~name + Util.make_test ~retries:10 ~max_gen ~count ~name (arb_cmds_triple seq_len par_len) (fun triple -> assume (all_interleavings_ok triple); @@ -96,7 +96,7 @@ module Make (Spec: Spec) = struct let rep_count = 25 in let seq_len,par_len = 20,12 in let max_gen = 3*count in (* precond filtering may require extra generation: max. 3*count though *) - Test.make_neg ~retries:10 ~max_gen ~count ~name + Util.make_neg_test ~retries:10 ~max_gen ~count ~name (arb_cmds_triple seq_len par_len) (fun triple -> assume (all_interleavings_ok triple); diff --git a/lib/STM_sequential.ml b/lib/STM_sequential.ml index c3d240a64..7c42a56b2 100644 --- a/lib/STM_sequential.ml +++ b/lib/STM_sequential.ml @@ -24,13 +24,13 @@ module Make (Spec: Spec) = struct match res with | None -> true | Some trace -> - Test.fail_reportf " Results incompatible with model\n%s" + Util.fail_reportf " Results incompatible with model\n%s" @@ print_seq_trace trace let agree_test ~count ~name = - Test.make ~name ~count (arb_cmds Spec.init_state) agree_prop + Util.make_test ~name ~count (arb_cmds Spec.init_state) (Util.repeat 1 agree_prop) let neg_agree_test ~count ~name = - Test.make_neg ~name ~count (arb_cmds Spec.init_state) agree_prop + Util.make_neg_test ~name ~count (arb_cmds Spec.init_state) (Util.repeat 1 agree_prop) end diff --git a/lib/STM_thread.ml b/lib/STM_thread.ml index 89447ff42..b92cdcb27 100644 --- a/lib/STM_thread.ml +++ b/lib/STM_thread.ml @@ -33,7 +33,7 @@ module Make (Spec: Spec) = struct let obs1 = match !obs1 with Ok v -> v | Error exn -> raise exn in let obs2 = match !obs2 with Ok v -> v | Error exn -> raise exn in check_obs pref_obs obs1 obs2 Spec.init_state - || Test.fail_reportf " Results incompatible with linearized model\n\n%s" + || Util.fail_reportf " Results incompatible with linearized model\n\n%s" @@ print_triple_vertical ~fig_indent:5 ~res_width:35 (fun (c,r) -> Printf.sprintf "%s : %s" (Spec.show_cmd c) (show_res r)) (pref_obs,obs1,obs2) @@ -43,7 +43,7 @@ module Make (Spec: Spec) = struct let rep_count = 100 in let seq_len,par_len = 20,12 in let max_gen = 3*count in (* precond filtering may require extra generation: max. 3*count though *) - Test.make ~retries:15 ~max_gen ~count ~name + Util.make_test ~retries:15 ~max_gen ~count ~name (arb_cmds_triple seq_len par_len) (fun ((seq_pref,cmds1,cmds2) as triple) -> assume (all_interleavings_ok seq_pref cmds1 cmds2 Spec.init_state); @@ -53,7 +53,7 @@ module Make (Spec: Spec) = struct let rep_count = 100 in let seq_len,par_len = 20,12 in let max_gen = 3*count in (* precond filtering may require extra generation: max. 3*count though *) - Test.make_neg ~retries:15 ~max_gen ~count ~name + Util.make_neg_test ~retries:15 ~max_gen ~count ~name (arb_cmds_triple seq_len par_len) (fun ((seq_pref,cmds1,cmds2) as triple) -> assume (all_interleavings_ok seq_pref cmds1 cmds2 Spec.init_state); diff --git a/lib/lin.ml b/lib/lin.ml index ab7b12873..948d300f7 100644 --- a/lib/lin.ml +++ b/lib/lin.ml @@ -121,13 +121,13 @@ struct (* Linearization test *) let lin_test ~rep_count ~retries ~count ~name ~lin_prop = let arb_cmd_triple = arb_cmds_triple 20 12 in - Test.make ~count ~retries ~name + Util.make_test ~count ~retries ~name arb_cmd_triple (repeat rep_count lin_prop) (* Negative linearization test *) let neg_lin_test ~rep_count ~retries ~count ~name ~lin_prop = let arb_cmd_triple = arb_cmds_triple 20 12 in - Test.make_neg ~count ~retries ~name + Util.make_neg_test ~count ~retries ~name arb_cmd_triple (repeat rep_count lin_prop) end end diff --git a/lib/lin_domain.ml b/lib/lin_domain.ml index 4c525e673..13783890a 100644 --- a/lib/lin_domain.ml +++ b/lib/lin_domain.ml @@ -24,7 +24,7 @@ module Make_internal (Spec : Internal.CmdSpec [@alert "-internal"]) = struct let obs2 = match obs2 with Ok v -> v | Error exn -> raise exn in let seq_sut = Spec.init () in check_seq_cons pref_obs obs1 obs2 seq_sut [] - || QCheck.Test.fail_reportf " Results incompatible with sequential execution\n\n%s" + || Util.fail_reportf " Results incompatible with sequential execution\n\n%s" @@ Util.print_triple_vertical ~fig_indent:5 ~res_width:35 (fun (c,r) -> Printf.sprintf "%s : %s" (Spec.show_cmd c) (Spec.show_res r)) (pref_obs,obs1,obs2) diff --git a/lib/lin_effect.ml b/lib/lin_effect.ml index 1da365dea..fc48813bc 100644 --- a/lib/lin_effect.ml +++ b/lib/lin_effect.ml @@ -107,7 +107,7 @@ module Make_internal (Spec : Internal.CmdSpec [@alert "-internal"]) = struct let seq_sut = Spec.init () in (* exclude [Yield]s from sequential executions when searching for an interleaving *) EffTest.check_seq_cons (filter_res pref_obs) (filter_res !obs1) (filter_res !obs2) seq_sut [] - || QCheck.Test.fail_reportf " Results incompatible with linearized model\n\n%s" + || Util.fail_reportf " Results incompatible with linearized model\n\n%s" @@ Util.print_triple_vertical ~fig_indent:5 ~res_width:35 (fun (c,r) -> Printf.sprintf "%s : %s" (EffSpec.show_cmd c) (EffSpec.show_res r)) (pref_obs,!obs1,!obs2) @@ -115,13 +115,13 @@ module Make_internal (Spec : Internal.CmdSpec [@alert "-internal"]) = struct let lin_test ~count ~name = let arb_cmd_triple = EffTest.arb_cmds_triple 20 12 in let rep_count = 1 in - QCheck.Test.make ~count ~retries:10 ~name + Util.make_test ~count ~retries:10 ~name arb_cmd_triple (Util.repeat rep_count lin_prop) let neg_lin_test ~count ~name = let arb_cmd_triple = EffTest.arb_cmds_triple 20 12 in let rep_count = 1 in - QCheck.Test.make_neg ~count ~retries:10 ~name + Util.make_neg_test ~count ~retries:10 ~name arb_cmd_triple (Util.repeat rep_count lin_prop) end diff --git a/lib/util.ml b/lib/util.ml index 71fc4d3e6..1a8f56e3b 100644 --- a/lib/util.ml +++ b/lib/util.ml @@ -1,9 +1,3 @@ -let rec repeat n prop = fun input -> - if n<0 then failwith "repeat: negative repetition count"; - if n=0 - then true - else prop input && repeat (n-1) prop input - exception Timeout let prop_timeout sec p x = @@ -170,3 +164,116 @@ module Equal = struct | _ -> false let equal_array eq x y = equal_seq eq (Array.to_seq x) (Array.to_seq y) end + +module Stats = struct + let env_var = "QCHECK_STATISTICS_FILE" + + let enabled = + match Sys.getenv_opt env_var with None | Some "" -> false | _ -> true + + let out_channel = + match Sys.getenv_opt env_var with + | None | Some "" -> None + | Some "-" -> Some stdout + | Some path -> + Some (open_out_gen [ Open_wronly; Open_append; Open_creat ] 0o644 path) + + type t = { + mutable iterations : int; + mutable failures : int; + mutable exceptions : int; + } + + let current = { iterations = 0; failures = 0; exceptions = 0 } + + let reset () = + current.iterations <- 0; + current.failures <- 0; + current.exceptions <- 0 + + let incr_iterations () = current.iterations <- current.iterations + 1 + let incr_failures () = current.failures <- current.failures + 1 + let incr_exceptions () = current.exceptions <- current.exceptions + 1 + + let record verbose (QCheck2.Test.Test cell) = + let open QCheck2.Test in + let name = get_name cell in + let { iterations; failures; exceptions } = current in + Option.fold ~none:() + ~some:(fun o -> + Printf.fprintf o "%d %d %d %s\n%!" iterations failures exceptions name) + out_channel; + if verbose then + Printf.printf "Stats for %s: %diters %dfails %dexns\n%!" name iterations + failures exceptions +end + +let repeat n prop = + let rec normal_repeat n input = + if n = 0 then true else prop input && normal_repeat (n - 1) input + and stats_repeat n input = + (* In Stats mode, we always run all the iterations, but we + count failures and exceptions on the way *) + if n = 0 then true + else ( + Stats.incr_iterations (); + try + if not (prop input) then Stats.incr_failures (); + stats_repeat (n - 1) input + with _ -> + Stats.incr_exceptions (); + false) + in + if n < 0 then failwith "repeat: negative repetition count" + else if Stats.enabled then stats_repeat n + else normal_repeat n + +let fail_reportf m = + if Stats.enabled then Format.ikfprintf (Fun.const false) Format.err_formatter m + else QCheck.Test.fail_reportf m + +let make_test ?if_assumptions_fail ?count ?long_factor ?max_gen ?max_fail ?small + ?retries ?name arb law = + QCheck.Test.make ?if_assumptions_fail ?count ?long_factor ?max_gen ?max_fail + ?small ?retries ?name arb law + +let make_neg_test ?if_assumptions_fail ?count ?long_factor ?max_gen ?max_fail + ?small ?retries ?name arb law = + if Stats.enabled then + (* Note that, even negative tests are run as QCheck positive + tests, since we are hijacking the failure reports and counting + them separately *) + QCheck.Test.make ?if_assumptions_fail ?count ?long_factor ?max_gen ?max_fail + ?small ?retries ?name arb law + else + QCheck.Test.make_neg ?if_assumptions_fail ?count ?long_factor ?max_gen + ?max_fail ?small ?retries ?name arb law + +let run_tests_main ?(argv = Sys.argv) l = + let cli_args = + try QCheck_base_runner.Raw.parse_cli ~full_options:false argv with + | Arg.Bad msg -> + print_endline msg; + exit 1 + | Arg.Help msg -> + print_endline msg; + exit 0 + in + let run_tests l = + QCheck_base_runner.run_tests l ~colors:cli_args.cli_colors + ~verbose:cli_args.cli_verbose + ~long:(cli_args.cli_long_tests || Stats.enabled) + ~out:stdout ~rand:cli_args.cli_rand + in + if Stats.enabled then + let res = + List.map + (fun tst -> + Stats.reset (); + let r = run_tests [ tst ] in + Stats.record cli_args.cli_verbose tst; + r = 0) + l + in + exit (if List.fold_left ( && ) true res then 0 else 1) + else exit (run_tests l) diff --git a/lib/util.mli b/lib/util.mli index 128ef66a5..6dc9499c6 100644 --- a/lib/util.mli +++ b/lib/util.mli @@ -6,7 +6,8 @@ val repeat : int -> ('a -> bool) -> 'a -> bool (** [repeat num prop] iterates a property [prop] [num] times. The function stops early and returns false if just one of the iterations returns false. This is handy if the property outcome is non-determistic, for example, - if it depends on scheduling. *) + if it depends on scheduling. + TODO *) exception Timeout (** exception raised by [prop_timeout] and [fork_prop_with_timeout]. *) @@ -161,3 +162,42 @@ module Equal : sig val equal_seq : 'a t -> 'a Seq.t t val equal_array : 'a t -> 'a array t end + +module Stats : sig + val enabled : bool + (** TODO *) +end + +val make_test : + ?if_assumptions_fail:[ `Fatal | `Warning ] * float -> + ?count:int -> + ?long_factor:int -> + ?max_gen:int -> + ?max_fail:int -> + ?small:('a -> int) -> + ?retries:int -> + ?name:string -> + 'a QCheck.arbitrary -> + ('a -> bool) -> + QCheck.Test.t +(** TODO *) + +val make_neg_test : + ?if_assumptions_fail:[ `Fatal | `Warning ] * float -> + ?count:int -> + ?long_factor:int -> + ?max_gen:int -> + ?max_fail:int -> + ?small:('a -> int) -> + ?retries:int -> + ?name:string -> + 'a QCheck.arbitrary -> + ('a -> bool) -> + QCheck.Test.t +(** TODO *) + +val fail_reportf : ('a, Format.formatter, unit, bool) format4 -> 'a +(** TODO *) + +val run_tests_main : ?argv:string array -> QCheck2.Test.t list -> 'a +(** TODO *) diff --git a/src/array/lin_tests.ml b/src/array/lin_tests.ml index 77965e611..da1ea1e33 100644 --- a/src/array/lin_tests.ml +++ b/src/array/lin_tests.ml @@ -117,6 +117,6 @@ end module AT_domain = Lin_domain.Make_internal(AConf) [@alert "-internal"] ;; -QCheck_base_runner.run_tests_main [ +Util.run_tests_main [ AT_domain.neg_lin_test ~count:1000 ~name:"Lin Array test with Domain"; ] diff --git a/src/array/lin_tests_dsl.ml b/src/array/lin_tests_dsl.ml index fb5b67f27..861aea874 100644 --- a/src/array/lin_tests_dsl.ml +++ b/src/array/lin_tests_dsl.ml @@ -28,6 +28,6 @@ end module AT_domain = Lin_domain.Make(AConf) ;; -QCheck_base_runner.run_tests_main [ +Util.run_tests_main [ AT_domain.neg_lin_test ~count:1000 ~name:"Lin DSL Array test with Domain"; ] diff --git a/src/array/stm_tests.ml b/src/array/stm_tests.ml index 0a6ce52b4..4b23d9884 100644 --- a/src/array/stm_tests.ml +++ b/src/array/stm_tests.ml @@ -121,7 +121,7 @@ end module ArraySTM_seq = STM_sequential.Make(AConf) module ArraySTM_dom = STM_domain.Make(AConf) ;; -QCheck_base_runner.run_tests_main +Util.run_tests_main (let count = 1000 in [ArraySTM_seq.agree_test ~count ~name:"STM Array test sequential"; ArraySTM_dom.neg_agree_test_par ~count ~name:"STM Array test parallel" (* this test is expected to fail *) diff --git a/src/atomic/lin_tests.ml b/src/atomic/lin_tests.ml index bd7059a8f..0dd4d7eff 100644 --- a/src/atomic/lin_tests.ml +++ b/src/atomic/lin_tests.ml @@ -189,7 +189,7 @@ end module A3T_domain = Lin_domain.Make_internal(A3Conf) [@alert "-internal"] ;; -QCheck_base_runner.run_tests_main [ +Util.run_tests_main [ AT_domain.lin_test ~count:1000 ~name:"Lin Atomic test with Domain"; A3T_domain.lin_test ~count:1000 ~name:"Lin Atomic3 test with Domain"; ] diff --git a/src/atomic/lin_tests_dsl.ml b/src/atomic/lin_tests_dsl.ml index 88e7c2e38..b9f7ef0b2 100644 --- a/src/atomic/lin_tests_dsl.ml +++ b/src/atomic/lin_tests_dsl.ml @@ -16,6 +16,6 @@ end module Lin_atomic_domain = Lin_domain.Make (Atomic_spec) let () = - QCheck_base_runner.run_tests_main + Util.run_tests_main [ Lin_atomic_domain.lin_test ~count:1000 ~name:"Lin DSL Atomic test with Domain"; ] diff --git a/src/atomic/stm_tests.ml b/src/atomic/stm_tests.ml index 5a1c9c572..a3a3286ea 100644 --- a/src/atomic/stm_tests.ml +++ b/src/atomic/stm_tests.ml @@ -83,7 +83,7 @@ end module AT_seq = STM_sequential.Make(CConf) module AT_dom = STM_domain.Make(CConf) ;; -QCheck_base_runner.run_tests_main +Util.run_tests_main (let count = 250 in [AT_seq.agree_test ~count ~name:"STM Atomic test sequential"; AT_dom.agree_test_par ~count ~name:"STM Atomic test parallel";]) diff --git a/src/bigarray/lin_tests_dsl.ml b/src/bigarray/lin_tests_dsl.ml index fbd609ed9..de0bbcbf6 100644 --- a/src/bigarray/lin_tests_dsl.ml +++ b/src/bigarray/lin_tests_dsl.ml @@ -28,6 +28,6 @@ end module BA1T = Lin_domain.Make(BA1Conf) let _ = - QCheck_base_runner.run_tests_main [ + Util.run_tests_main [ BA1T.neg_lin_test ~count:5000 ~name:"Lin DSL Bigarray.Array1 (of ints) test with Domain"; ] diff --git a/src/bigarray/stm_tests.ml b/src/bigarray/stm_tests.ml index fe5b69324..3a6cd856d 100644 --- a/src/bigarray/stm_tests.ml +++ b/src/bigarray/stm_tests.ml @@ -92,7 +92,7 @@ end module BigArraySTM_seq = STM_sequential.Make(BAConf) module BigArraySTM_dom = STM_domain.Make(BAConf) ;; -QCheck_base_runner.run_tests_main +Util.run_tests_main (let count = 1000 in [BigArraySTM_seq.agree_test ~count ~name:"STM BigArray test sequential"; BigArraySTM_dom.neg_agree_test_par ~count ~name:"STM BigArray test parallel" diff --git a/src/buffer/stm_tests.ml b/src/buffer/stm_tests.ml index 1c5792a5b..cba74e61e 100644 --- a/src/buffer/stm_tests.ml +++ b/src/buffer/stm_tests.ml @@ -144,7 +144,7 @@ end module BufferSTM_seq = STM_sequential.Make(BConf) module BufferSTM_dom = STM_domain.Make(BConf) ;; -QCheck_base_runner.run_tests_main +Util.run_tests_main (let count = 1000 in [BufferSTM_seq.agree_test ~count ~name:"STM Buffer test sequential"; BufferSTM_dom.neg_agree_test_par ~count ~name:"STM Buffer test parallel"]) diff --git a/src/bytes/lin_tests_dsl.ml b/src/bytes/lin_tests_dsl.ml index 739974690..fce58a3ac 100644 --- a/src/bytes/lin_tests_dsl.ml +++ b/src/bytes/lin_tests_dsl.ml @@ -20,7 +20,7 @@ end module BT_domain = Lin_domain.Make(BConf) module BT_thread = Lin_thread.Make(BConf) [@alert "-experimental"] ;; -QCheck_base_runner.run_tests_main [ +Util.run_tests_main [ BT_domain.lin_test ~count:1000 ~name:"Lin DSL Bytes test with Domain"; BT_thread.lin_test ~count:1000 ~name:"Lin DSL Bytes test with Thread"; ] diff --git a/src/bytes/stm_tests.ml b/src/bytes/stm_tests.ml index bdd47316f..647f088e6 100644 --- a/src/bytes/stm_tests.ml +++ b/src/bytes/stm_tests.ml @@ -101,7 +101,7 @@ end module BytesSTM_seq = STM_sequential.Make(ByConf) module BytesSTM_dom = STM_domain.Make(ByConf) ;; -QCheck_base_runner.run_tests_main +Util.run_tests_main (let count = 1000 in [BytesSTM_seq.agree_test ~count ~name:"STM Bytes test sequential"; BytesSTM_dom.neg_agree_test_par ~count ~name:"STM Bytes test parallel" diff --git a/src/domain/domain_joingraph.ml b/src/domain/domain_joingraph.ml index 2b8660bab..62bef9eb3 100644 --- a/src/domain/domain_joingraph.ml +++ b/src/domain/domain_joingraph.ml @@ -143,9 +143,10 @@ let work () = done let test_tak_work ~domain_bound = - Test.make ~name:"Domain.spawn/join - tak work" ~count:100 + Util.make_test ~name:"Domain.spawn/join - tak work" ~count:100 (arb_deps domain_bound) ((*Util.fork_prop_with_timeout 30*) + Util.repeat 1 (fun test_input -> (*Printf.printf "%s\n%!" (show_test_input test_input);*) let ps = build_dep_graph test_input work in @@ -154,9 +155,9 @@ let test_tak_work ~domain_bound = (** In this test each spawned domain calls [Atomic.incr] - and then optionally join. *) let test_atomic_work ~domain_bound = - Test.make ~name:"Domain.spawn/join - atomic" ~count:500 + Util.make_test ~name:"Domain.spawn/join - atomic" ~count:500 (arb_deps domain_bound) - (fun test_input -> + (Util.repeat 1 (fun test_input -> let a = Atomic.make 0 in let ps = build_dep_graph test_input (fun () -> Atomic.incr a) in List.iteri (fun i p -> @@ -166,13 +167,13 @@ let test_atomic_work ~domain_bound = Domain.join p; (*Printf.printf "main domain %i -- joining %s success\n%!" (Domain.self () :> int) tgt_id*) ) ps; - Atomic.get a = test_input.num_domains) + Atomic.get a = test_input.num_domains)) let bound_tak = if Sys.word_size == 64 then 100 else 8 let bound_atomic = if Sys.word_size == 64 then 250 else 8 ;; -QCheck_base_runner.run_tests_main +Util.run_tests_main [test_tak_work ~domain_bound:bound_tak; test_atomic_work ~domain_bound:bound_atomic ] diff --git a/src/domain/domain_spawntree.ml b/src/domain/domain_spawntree.ml index e85e3d48f..9b661f3b9 100644 --- a/src/domain/domain_spawntree.ml +++ b/src/domain/domain_spawntree.ml @@ -72,7 +72,7 @@ let rec dom_interp a = function let ds = List.map (fun c -> Domain.spawn (fun () -> dom_interp a c)) cs in List.iter Domain.join ds -let t ~max_height ~max_degree = Test.make +let t ~max_height ~max_degree = Util.make_test ~name:"domain_spawntree - with Atomic" ~count:100 ~retries:10 @@ -80,6 +80,7 @@ let t ~max_height ~max_degree = Test.make (make ~print:show_cmd ~shrink:shrink_cmd (gen max_height max_degree)) ((*Util.fork_prop_with_timeout 30*) (* forking a fresh process starts afresh, it seems *) + Util.repeat 1 (fun c -> (*Printf.printf "spawns: %i\n%!" (count_spawns c);*) (*Printf.printf "%s\n%!" (show_cmd c);*) @@ -100,4 +101,4 @@ let test = else t ~max_height:3 ~max_degree:3 ;; -QCheck_base_runner.run_tests_main [test] +Util.run_tests_main [test] diff --git a/src/dynlink/lin_tests_dsl.ml b/src/dynlink/lin_tests_dsl.ml index 665d00de8..69dc80801 100644 --- a/src/dynlink/lin_tests_dsl.ml +++ b/src/dynlink/lin_tests_dsl.ml @@ -34,6 +34,6 @@ let _ = if Sys.win32 then Printf.printf "negative Lin DSL Dynlink test with Domain disabled under Windows\n\n%!" else - QCheck_base_runner.run_tests_main [ + Util.run_tests_main [ DynT.neg_lin_test ~count:100 ~name:"negative Lin DSL Dynlink test with Domain"; ] diff --git a/src/floatarray/lin_tests_dsl.ml b/src/floatarray/lin_tests_dsl.ml index dfa82991d..1ade8a53e 100644 --- a/src/floatarray/lin_tests_dsl.ml +++ b/src/floatarray/lin_tests_dsl.ml @@ -36,6 +36,6 @@ end module FAT = Lin_domain.Make(FAConf) let _ = - QCheck_base_runner.run_tests_main [ + Util.run_tests_main [ FAT.neg_lin_test ~count:1000 ~name:"Lin DSL Float.Array test with Domain"; ] diff --git a/src/floatarray/stm_tests.ml b/src/floatarray/stm_tests.ml index 87d5bfa79..9bc6955a6 100644 --- a/src/floatarray/stm_tests.ml +++ b/src/floatarray/stm_tests.ml @@ -134,7 +134,7 @@ end module FloatArraySTM_seq = STM_sequential.Make(FAConf) module FloatArraySTM_dom = STM_domain.Make(FAConf) ;; -QCheck_base_runner.run_tests_main +Util.run_tests_main (let count = 1000 in [FloatArraySTM_seq.agree_test ~count ~name:"STM Float Array test sequential"; FloatArraySTM_dom.neg_agree_test_par ~count ~name:"STM Float Array test parallel" diff --git a/src/hashtbl/lin_tests.ml b/src/hashtbl/lin_tests.ml index 13c876536..daa29f561 100644 --- a/src/hashtbl/lin_tests.ml +++ b/src/hashtbl/lin_tests.ml @@ -124,6 +124,6 @@ end module HT_domain = Lin_domain.Make_internal(HConf) [@alert "-internal"] ;; -QCheck_base_runner.run_tests_main [ +Util.run_tests_main [ HT_domain.neg_lin_test ~count:1000 ~name:"Lin Hashtbl test with Domain"; ] diff --git a/src/hashtbl/lin_tests_dsl.ml b/src/hashtbl/lin_tests_dsl.ml index 76b7b70a2..ba96ac774 100644 --- a/src/hashtbl/lin_tests_dsl.ml +++ b/src/hashtbl/lin_tests_dsl.ml @@ -25,6 +25,6 @@ end module HT_domain = Lin_domain.Make(HConf) ;; -QCheck_base_runner.run_tests_main [ +Util.run_tests_main [ HT_domain.neg_lin_test ~count:1000 ~name:"Lin DSL Hashtbl test with Domain"; ] diff --git a/src/hashtbl/stm_tests.ml b/src/hashtbl/stm_tests.ml index 31747c4c3..70fe6d046 100644 --- a/src/hashtbl/stm_tests.ml +++ b/src/hashtbl/stm_tests.ml @@ -135,7 +135,7 @@ end module HTest_seq = STM_sequential.Make(HConf) module HTest_dom = STM_domain.Make(HConf) ;; -QCheck_base_runner.run_tests_main +Util.run_tests_main (let count = 200 in [HTest_seq.agree_test ~count ~name:"STM Hashtbl test sequential"; HTest_dom.neg_agree_test_par ~count ~name:"STM Hashtbl test parallel"; diff --git a/src/io/lin_tests.ml b/src/io/lin_tests.ml index de797dade..b3cb089cf 100644 --- a/src/io/lin_tests.ml +++ b/src/io/lin_tests.ml @@ -128,7 +128,7 @@ module Out_channel_lin = Lin_domain.Make_internal (Out_channel_ops) [@@alert "-i module In_channel_lin = Lin_domain.Make_internal (In_channel_ops) [@@alert "-internal"] let () = - QCheck_base_runner.run_tests_main + Util.run_tests_main [ Out_channel_lin.lin_test ~count:1000 ~name:"Lin Out_channel test with domains"; In_channel_lin.lin_test ~count:1000 ~name:"Lin In_channel test with domains"; ] diff --git a/src/io/lin_tests_dsl_domain.ml b/src/io/lin_tests_dsl_domain.ml index 3d7fd0e04..9035df57a 100644 --- a/src/io/lin_tests_dsl_domain.ml +++ b/src/io/lin_tests_dsl_domain.ml @@ -17,4 +17,4 @@ let tests = OC_domain.neg_lin_test ~count:1000 ~name:"Lin DSL Out_channel test with Domain"; ] -let _ = QCheck_base_runner.run_tests_main tests +let _ = Util.run_tests_main tests diff --git a/src/io/lin_tests_dsl_thread.ml b/src/io/lin_tests_dsl_thread.ml index 12962b004..9a9be688d 100644 --- a/src/io/lin_tests_dsl_thread.ml +++ b/src/io/lin_tests_dsl_thread.ml @@ -8,7 +8,7 @@ module IC_thread = Lin_thread.Make(ICConf) [@@alert "-experimental"] module OC_thread = Lin_thread.Make(OCConf) [@@alert "-experimental"] let _ = - QCheck_base_runner.run_tests_main [ + Util.run_tests_main [ IC_thread.neg_lin_test ~count:1000 ~name:"Lin DSL In_channel test with Thread"; OC_thread.neg_lin_test ~count:1000 ~name:"Lin DSL Out_channel test with Thread"; ] diff --git a/src/lazy/lin_tests.ml b/src/lazy/lin_tests.ml index 7e5de3308..ef72d8007 100644 --- a/src/lazy/lin_tests.ml +++ b/src/lazy/lin_tests.ml @@ -131,7 +131,7 @@ module LTfromfun = Lin_domain.Make_internal(struct let init () = Lazy.from_fun work end) [@alert "-internal"] ;; -QCheck_base_runner.run_tests_main +Util.run_tests_main (let count = 100 in [LTlazy.neg_lin_test ~count ~name:"Lin Lazy test with Domain"; LTfromval.lin_test ~count ~name:"Lin Lazy test with Domain from_val"; diff --git a/src/lazy/lin_tests_dsl.ml b/src/lazy/lin_tests_dsl.ml index 2e1b7d9f7..fbe657cbd 100644 --- a/src/lazy/lin_tests_dsl.ml +++ b/src/lazy/lin_tests_dsl.ml @@ -65,7 +65,7 @@ module LTfromval_domain = Lin_domain.Make(LTfromvalAPI) module LTfromfunAPI = struct include LBase let init () = Lazy.from_fun work end module LTfromfun_domain = Lin_domain.Make(LTfromfunAPI) ;; -QCheck_base_runner.run_tests_main +Util.run_tests_main (let count = 100 in [LTlazy_domain.neg_lin_test ~count ~name:"Lin DSL Lazy test with Domain"; LTfromval_domain.lin_test ~count ~name:"Lin DSL Lazy test with Domain from_val"; diff --git a/src/lazy/stm_tests.ml b/src/lazy/stm_tests.ml index 2c728134e..d83c409d8 100644 --- a/src/lazy/stm_tests.ml +++ b/src/lazy/stm_tests.ml @@ -143,7 +143,7 @@ module LTfromfun_dom = STM_domain.Make(struct let init_sut () = Lazy.from_fun work end) ;; -QCheck_base_runner.run_tests_main +Util.run_tests_main (let count = 200 in [LTlazy_seq.agree_test ~count ~name:"STM Lazy test sequential"; LTfromval_seq.agree_test ~count ~name:"STM Lazy test sequential from_val"; diff --git a/src/neg_tests/lin_tests_domain.ml b/src/neg_tests/lin_tests_domain.ml index 4191cd720..24e43fb9c 100644 --- a/src/neg_tests/lin_tests_domain.ml +++ b/src/neg_tests/lin_tests_domain.ml @@ -8,7 +8,7 @@ module CLT_int64_domain = Lin_domain.Make_internal(CLConf (Int64)) [@alert "-int (** This is a driver of the negative tests over the Domain module *) ;; -QCheck_base_runner.run_tests_main +Util.run_tests_main (let count = 15000 in [RT_int_domain.neg_lin_test ~count ~name:"Lin ref int test with Domain"; RT_int64_domain.neg_lin_test ~count ~name:"Lin ref int64 test with Domain"; diff --git a/src/neg_tests/lin_tests_dsl_domain.ml b/src/neg_tests/lin_tests_dsl_domain.ml index f2ffeeba0..2208ee207 100644 --- a/src/neg_tests/lin_tests_dsl_domain.ml +++ b/src/neg_tests/lin_tests_dsl_domain.ml @@ -8,7 +8,7 @@ module CLT_int64_domain = Lin_domain.Make(CList_spec_int64) (** This is a driver of the negative tests over the Domain module *) ;; -QCheck_base_runner.run_tests_main +Util.run_tests_main (let count = 10000 in [RT_int_domain.neg_lin_test ~count ~name:"Lin DSL ref int test with Domain"; RT_int64_domain.neg_lin_test ~count ~name:"Lin DSL ref int64 test with Domain"; diff --git a/src/neg_tests/lin_tests_dsl_effect.ml b/src/neg_tests/lin_tests_dsl_effect.ml index 91f00b730..2bd3531f4 100644 --- a/src/neg_tests/lin_tests_dsl_effect.ml +++ b/src/neg_tests/lin_tests_dsl_effect.ml @@ -80,7 +80,7 @@ module CLT_int64_effect = Lin_effect.Make(CList_spec_int64) [@alert "-experiment module CLT_int64'_effect = Lin_effect.Make(CList_spec_int64') [@alert "-experimental"] ;; -QCheck_base_runner.run_tests_main +Util.run_tests_main (let count = 20_000 in [ (* We don't expect the first four tests to fail as each `cmd` is completed before a `Yield` *) RT_int_effect.lin_test ~count ~name:"Lin DSL ref int test with Effect"; diff --git a/src/neg_tests/lin_tests_dsl_thread.ml b/src/neg_tests/lin_tests_dsl_thread.ml index ca9863115..bec4b1b77 100644 --- a/src/neg_tests/lin_tests_dsl_thread.ml +++ b/src/neg_tests/lin_tests_dsl_thread.ml @@ -8,7 +8,7 @@ module CLT_int_thread = Lin_thread.Make(CList_spec_int) [@alert "-experimental"] module CLT_int64_thread = Lin_thread.Make(CList_spec_int64) [@alert "-experimental"] ;; -QCheck_base_runner.run_tests_main +Util.run_tests_main (let count = 1000 in [RT_int_thread.lin_test ~count ~name:"Lin ref int test with Thread"; (* unboxed, hence no allocations to trigger context switch *) RT_int64_thread.neg_lin_test ~count:15000 ~name:"Lin ref int64 test with Thread"; diff --git a/src/neg_tests/lin_tests_effect.ml b/src/neg_tests/lin_tests_effect.ml index 67ba3e0c3..9678b232d 100644 --- a/src/neg_tests/lin_tests_effect.ml +++ b/src/neg_tests/lin_tests_effect.ml @@ -148,7 +148,7 @@ end module CLT_int64_effect = Lin_effect.Make_internal(CLConf(Int64)) [@alert "-internal"] module CLT_int64'_effect = Lin_effect.Make_internal(CLConf_int64') [@alert "-internal"] ;; -QCheck_base_runner.run_tests_main +Util.run_tests_main (let count = 20_000 in [ (* We don't expect the first four tests to fail as each `cmd` is completed before a `Yield` *) RT_int_effect.lin_test ~count ~name:"Lin ref int test with Effect"; diff --git a/src/neg_tests/lin_tests_thread_conclist.ml b/src/neg_tests/lin_tests_thread_conclist.ml index 247ad4453..ac10fb6cd 100644 --- a/src/neg_tests/lin_tests_thread_conclist.ml +++ b/src/neg_tests/lin_tests_thread_conclist.ml @@ -17,4 +17,4 @@ let _ = [ List.hd tests ]) else tests in - QCheck_base_runner.run_tests_main tests + Util.run_tests_main tests diff --git a/src/neg_tests/lin_tests_thread_ref.ml b/src/neg_tests/lin_tests_thread_ref.ml index b0973dff5..02bc5d052 100644 --- a/src/neg_tests/lin_tests_thread_ref.ml +++ b/src/neg_tests/lin_tests_thread_ref.ml @@ -10,7 +10,7 @@ if Sys.backend_type = Sys.Bytecode then Printf.printf "Lin ref tests with Thread disabled under bytecode\n\n%!" else -QCheck_base_runner.run_tests_main +Util.run_tests_main (let count = 1000 in [RT_int_thread.lin_test ~count ~name:"Lin ref int test with Thread"; (* unboxed, hence no allocations to trigger context switch *) RT_int64_thread.neg_lin_test ~count:15000 ~name:"Lin ref int64 test with Thread"]) diff --git a/src/neg_tests/stm_tests_conclist.ml b/src/neg_tests/stm_tests_conclist.ml index 3ae8a32da..7b04e32a7 100644 --- a/src/neg_tests/stm_tests_conclist.ml +++ b/src/neg_tests/stm_tests_conclist.ml @@ -63,7 +63,7 @@ module CLT_int_dom = STM_domain.Make(CLConf(Int)) module CLT_int64_seq = STM_sequential.Make(CLConf(Int64)) module CLT_int64_dom = STM_domain.Make(CLConf(Int64)) ;; -QCheck_base_runner.run_tests_main +Util.run_tests_main (let count = 1000 in [CLT_int_seq.agree_test ~count ~name:"STM int CList test sequential"; CLT_int64_seq.agree_test ~count ~name:"STM int64 CList test sequential"; diff --git a/src/neg_tests/stm_tests_domain_ref.ml b/src/neg_tests/stm_tests_domain_ref.ml index e016bdb06..5750ec8e2 100644 --- a/src/neg_tests/stm_tests_domain_ref.ml +++ b/src/neg_tests/stm_tests_domain_ref.ml @@ -3,7 +3,7 @@ open Stm_tests_spec_ref module RT_int = STM_domain.Make(RConf_int) module RT_int64 = STM_domain.Make(RConf_int64) ;; -QCheck_base_runner.run_tests_main +Util.run_tests_main [RT_int.neg_agree_test_par ~count:1000 ~name:"STM int ref test parallel"; RT_int64.neg_agree_test_par ~count:1000 ~name:"STM int64 ref test parallel"; RT_int.neg_agree_test_par_asym ~count:2000 ~name:"STM int ref test parallel asymmetric"; diff --git a/src/neg_tests/stm_tests_sequential_ref.ml b/src/neg_tests/stm_tests_sequential_ref.ml index 25fa302fc..82cd93d8b 100644 --- a/src/neg_tests/stm_tests_sequential_ref.ml +++ b/src/neg_tests/stm_tests_sequential_ref.ml @@ -3,7 +3,7 @@ open Stm_tests_spec_ref module RT_int_seq = STM_sequential.Make(RConf_int) module RT_int64_seq = STM_sequential.Make(RConf_int64) ;; -QCheck_base_runner.run_tests_main +Util.run_tests_main (let count = 1000 in [RT_int_seq.agree_test ~count ~name:"STM int ref test sequential"; RT_int64_seq.agree_test ~count ~name:"STM int64 ref test sequential"; diff --git a/src/neg_tests/stm_tests_thread_ref.ml b/src/neg_tests/stm_tests_thread_ref.ml index f198dd7a8..83cce662c 100644 --- a/src/neg_tests/stm_tests_thread_ref.ml +++ b/src/neg_tests/stm_tests_thread_ref.ml @@ -7,7 +7,7 @@ if Sys.backend_type = Sys.Bytecode then Printf.printf "STM ref tests with Thread disabled under bytecode\n\n%!" else -QCheck_base_runner.run_tests_main +Util.run_tests_main [RT_int.agree_test_conc ~count:250 ~name:"STM int ref test with Thread"; RT_int64.neg_agree_test_conc ~count:1000 ~name:"STM int64 ref test with Thread"; ] diff --git a/src/queue/lin_tests.ml b/src/queue/lin_tests.ml index ddcae68ac..ef866410e 100644 --- a/src/queue/lin_tests.ml +++ b/src/queue/lin_tests.ml @@ -170,7 +170,7 @@ module QMT_thread = Lin_thread.Make_internal(QMutexConf) [@alert "-internal"] module QT_domain = Lin_domain.Make_internal(QConf) [@alert "-internal"] module QT_thread = Lin_thread.Make_internal(QConf) [@alert "-internal"] ;; -QCheck_base_runner.run_tests_main [ +Util.run_tests_main [ QMT_domain.lin_test ~count:1000 ~name:"Lin Queue test with Domain and mutex"; QMT_thread.lin_test ~count:1000 ~name:"Lin Queue test with Thread and mutex"; QT_domain.neg_lin_test ~count:1000 ~name:"Lin Queue test with Domain without mutex"; diff --git a/src/queue/lin_tests_dsl.ml b/src/queue/lin_tests_dsl.ml index 930d75aea..f6260894b 100644 --- a/src/queue/lin_tests_dsl.ml +++ b/src/queue/lin_tests_dsl.ml @@ -21,7 +21,7 @@ module Lin_queue_domain = Lin_domain.Make(Queue_spec) module Lin_queue_thread = Lin_thread.Make(Queue_spec) [@alert "-experimental"] let () = - QCheck_base_runner.run_tests_main [ + Util.run_tests_main [ Lin_queue_domain.neg_lin_test ~count:1000 ~name:"Lin DSL Queue test with Domain"; Lin_queue_thread.lin_test ~count:250 ~name:"Lin DSL Queue test with Thread"; ] diff --git a/src/semaphore/stm_tests.ml b/src/semaphore/stm_tests.ml index c00a0acfd..90acbbc93 100644 --- a/src/semaphore/stm_tests.ml +++ b/src/semaphore/stm_tests.ml @@ -76,7 +76,7 @@ module SCTest_seq = STM_sequential.Make(SCConf) module SCTest_dom = STM_domain.Make(SCConf) let _ = - QCheck_base_runner.run_tests_main + Util.run_tests_main (let count = 200 in [SCTest_seq.agree_test ~count ~name:"STM Semaphore.Counting test sequential"; SCTest_dom.agree_test_par ~count ~name:"STM Semaphore.Counting test parallel"; diff --git a/src/stack/lin_tests.ml b/src/stack/lin_tests.ml index 78841d268..4a2c65842 100644 --- a/src/stack/lin_tests.ml +++ b/src/stack/lin_tests.ml @@ -170,7 +170,7 @@ module ST_thread = Lin_thread.Make_internal(SConf) [@alert "-internal"] module SMT_domain = Lin_domain.Make_internal(SMutexConf) [@alert "-internal"] module SMT_thread = Lin_thread.Make_internal(SMutexConf) [@alert "-internal"] ;; -QCheck_base_runner.run_tests_main [ +Util.run_tests_main [ SMT_domain.lin_test ~count:1000 ~name:"Lin Stack test with Domain and mutex"; SMT_thread.lin_test ~count:1000 ~name:"Lin Stack test with Thread and mutex"; ST_domain.neg_lin_test ~count:1000 ~name:"Lin Stack test with Domain without mutex"; diff --git a/src/stack/lin_tests_dsl.ml b/src/stack/lin_tests_dsl.ml index 8a5dce90d..180e41cd5 100644 --- a/src/stack/lin_tests_dsl.ml +++ b/src/stack/lin_tests_dsl.ml @@ -31,4 +31,4 @@ let () = [ List.hd tests ]) else tests in - QCheck_base_runner.run_tests_main tests + Util.run_tests_main tests diff --git a/src/sys/stm_tests.ml b/src/sys/stm_tests.ml index 0ae67ad87..5ed444953 100644 --- a/src/sys/stm_tests.ml +++ b/src/sys/stm_tests.ml @@ -328,7 +328,7 @@ module Sys_seq = STM_sequential.Make(SConf) module Sys_dom = STM_domain.Make(SConf) ;; -QCheck_base_runner.run_tests_main [ +Util.run_tests_main [ Sys_seq.agree_test ~count:1000 ~name:"STM Sys test sequential"; if Sys.unix && (uname_os () = Some "Linux" || arch () = Some "arm64") then Sys_dom.agree_test_par ~count:200 ~name:"STM Sys test parallel" diff --git a/src/thread/thread_createtree.ml b/src/thread/thread_createtree.ml index bd3fe216d..1327deafc 100644 --- a/src/thread/thread_createtree.ml +++ b/src/thread/thread_createtree.ml @@ -72,16 +72,16 @@ let rec thread_interp a = function let ts = List.map (fun c -> Thread.create (fun () -> thread_interp a c) ()) cs in List.iter Thread.join ts -let t ~max_height ~max_degree = Test.make +let t ~max_height ~max_degree = Util.make_test ~name:"thread_createtree - with Atomic" ~count:1000 ~retries:100 (make ~print:show_cmd ~shrink:shrink_cmd (gen max_height max_degree)) - (fun c -> + (Util.repeat 1 (fun c -> (*Printf.printf "%s\n%!" (show_cmd c);*) let a = Atomic.make 0 in let () = thread_interp a c in - Atomic.get a = interp 0 c) + Atomic.get a = interp 0 c)) let test = if Sys.word_size == 64 @@ -89,4 +89,4 @@ let test = else t ~max_height:3 ~max_degree:3 ;; -QCheck_base_runner.run_tests_main [test] +Util.run_tests_main [test] diff --git a/src/thread/thread_joingraph.ml b/src/thread/thread_joingraph.ml index d4f908403..a7c4b5a30 100644 --- a/src/thread/thread_joingraph.ml +++ b/src/thread/thread_joingraph.ml @@ -104,9 +104,10 @@ let work () = done let test_tak_work ~thread_bound = - Test.make ~name:"Thread.create/join - tak work" ~count:100 + Util.make_test ~name:"Thread.create/join - tak work" ~count:100 (arb_deps thread_bound) ((*Util.fork_prop_with_timeout 30*) + Util.repeat 1 (fun test_input -> (*Printf.printf "%s\n%!" (show_test_input test_input);*) let ps = build_dep_graph test_input work in @@ -115,9 +116,9 @@ let test_tak_work ~thread_bound = (** In this test each created thread calls [Atomic.incr] - and then optionally join. *) let test_atomic_work ~thread_bound = - Test.make ~name:"Thread.create/join - atomic" ~count:500 + Util.make_test ~name:"Thread.create/join - atomic" ~count:500 (arb_deps thread_bound) - (fun test_input -> + (Util.repeat 1 (fun test_input -> let a = Atomic.make 0 in let ps = build_dep_graph test_input (fun () -> Atomic.incr a) in List.iteri (fun i p -> @@ -125,13 +126,13 @@ let test_atomic_work ~thread_bound = then Thread.join p; ) ps; - Atomic.get a = test_input.num_threads) + Atomic.get a = test_input.num_threads)) let bound_tak = if Sys.word_size == 64 then 100 else 16 let bound_atomic = if Sys.word_size == 64 then 250 else 16 ;; -QCheck_base_runner.run_tests_main +Util.run_tests_main [test_tak_work ~thread_bound:bound_tak; test_atomic_work ~thread_bound:bound_atomic ] diff --git a/src/threadomain/threadomain.ml b/src/threadomain/threadomain.ml index bb154e4e5..982970080 100644 --- a/src/threadomain/threadomain.ml +++ b/src/threadomain/threadomain.ml @@ -185,11 +185,11 @@ let main_test = Test.make ~name:"Mash up of threads and domains" ~count:500 ~print:show_spawn_join (Gen.sized_size nb_nodes gen_spawn_join) - run_all_nodes + (Util.repeat 1 run_all_nodes) (* to debug deadlocks: *) (* (Util.fork_prop_with_timeout 1 run_all_nodes) *) let _ = - QCheck_base_runner.run_tests_main [ + Util.run_tests_main [ main_test ] diff --git a/test/cleanup_lin.ml b/test/cleanup_lin.ml index 4d425aaf7..586f7002d 100644 --- a/test/cleanup_lin.ml +++ b/test/cleanup_lin.ml @@ -72,7 +72,7 @@ module RT = Lin_domain.Make_internal(RConf) [@alert "-internal"] ;; Test.check_exn (let seq_len,par_len = 20,15 in - Test.make ~count:1000 ~name:("exactly one-cleanup test") + Util.make_test ~count:1000 ~name:("exactly one-cleanup test") (RT.arb_cmds_triple seq_len par_len) (fun input -> try diff --git a/test/cleanup_stm.ml b/test/cleanup_stm.ml index 81ef76a83..e71d35595 100644 --- a/test/cleanup_stm.ml +++ b/test/cleanup_stm.ml @@ -88,7 +88,7 @@ status := None; for _i=1 to 100 do try Test.check_exn ~rand - (Test.make ~count:1000 ~name:"STM ensure cleanup test parallel" + (Util.make_test ~count:1000 ~name:"STM ensure cleanup test parallel" (RT_dom.arb_cmds_triple 20 12) RT_dom.agree_prop_par) (* without retries *) with _e -> incr i; assert (!status = Some Cleaned); done; diff --git a/test/mutable_set_v5.ml b/test/mutable_set_v5.ml index 16512417c..eaa1994a9 100644 --- a/test/mutable_set_v5.ml +++ b/test/mutable_set_v5.ml @@ -132,5 +132,5 @@ end module Lib_sequential = STM_sequential.Make(Lib_spec) -let _ = QCheck_base_runner.run_tests_main +let _ = Util.run_tests_main [Lib_sequential.agree_test ~count:100 ~name:"STM sequential tests"]