File tree Expand file tree Collapse file tree 12 files changed +156
-30
lines changed Expand file tree Collapse file tree 12 files changed +156
-30
lines changed Original file line number Diff line number Diff line change 4848 ( and
4949 ( >= 1 .8.0)
5050 :with -test) )
51+ ( qcheck-core
52+ ( and
53+ ( >= 0 .21.2)
54+ :with -test) )
55+ ( qcheck-stm
56+ ( and
57+ ( >= 0 .3)
58+ :with -test) )
5159 ( mdx
5260 ( and
5361 ( >= 2 .4.1)
Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ depends: [
2424 "multicore-magic" {>= "2.3.0"}
2525 "domain_shims" {>= "0.1.0" & with-test}
2626 "alcotest" {>= "1.8.0" & with-test}
27+ "qcheck-core" {>= "0.21.2" & with-test}
28+ "qcheck-stm" {>= "0.3" & with-test}
2729 "mdx" {>= "2.4.1" & with-test}
2830 "sherlodoc" {>= "0.2" & with-doc}
2931 "odoc" {>= "2.4.2" & with-doc}
Original file line number Diff line number Diff line change 1- (rule
2- (enabled_if %{lib-available:qcheck-stm.domain})
3- (action
4- (copy stm_run.ocaml5.ml stm_run.ml)))
5-
6- (rule
7- (enabled_if
8- (not %{lib-available:qcheck-stm.domain}))
9- (action
10- (copy stm_run.ocaml4.ml stm_run.ml)))
11-
121(tests
132 (names
143 accumulator_test_stm
3019 kcas_data
3120 domain_shims
3221 qcheck-core
33- qcheck-core.runner
3422 qcheck-stm.stm
35- qcheck-stm.sequential
36- qcheck-stm.thread
23+ stm_run
3724 (select
3825 empty.ml
3926 from
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ (rule
2+ (enabled_if %{lib-available:qcheck-stm.domain})
3+ (action
4+ (copy stm_run.ocaml5.ml stm_run.ml)))
5+
6+ (rule
7+ (enabled_if
8+ (not %{lib-available:qcheck-stm.domain}))
9+ (action
10+ (copy stm_run.ocaml4.ml stm_run.ml)))
11+
12+ (library
13+ (name stm_run)
14+ (libraries
15+ qcheck-core
16+ qcheck-core.runner
17+ qcheck-stm.stm
18+ qcheck-stm.sequential
19+ qcheck-stm.thread
20+ unix
21+ (select
22+ empty.ml
23+ from
24+ (qcheck-stm.domain -> empty.ocaml5.ml)
25+ (-> empty.ocaml4.ml))))
Original file line number Diff line number Diff line change 1+ module type STM_domain = sig
2+ module Spec : STM .Spec
3+
4+ val check_obs :
5+ (Spec .cmd * STM .res ) list ->
6+ (Spec .cmd * STM .res ) list ->
7+ (Spec .cmd * STM .res ) list ->
8+ Spec .state ->
9+ bool
10+
11+ val all_interleavings_ok :
12+ Spec .cmd list * Spec .cmd list * Spec .cmd list -> bool
13+
14+ val arb_cmds_triple :
15+ int ->
16+ int ->
17+ (Spec .cmd list * Spec .cmd list * Spec .cmd list ) QCheck .arbitrary
18+
19+ val arb_triple :
20+ int ->
21+ int ->
22+ (Spec .state -> Spec .cmd QCheck .arbitrary ) ->
23+ (Spec .state -> Spec .cmd QCheck .arbitrary ) ->
24+ (Spec .state -> Spec .cmd QCheck .arbitrary ) ->
25+ (Spec .cmd list * Spec .cmd list * Spec .cmd list ) QCheck .arbitrary
26+
27+ val arb_triple_asym :
28+ int ->
29+ int ->
30+ (Spec .state -> Spec .cmd QCheck .arbitrary ) ->
31+ (Spec .state -> Spec .cmd QCheck .arbitrary ) ->
32+ (Spec .state -> Spec .cmd QCheck .arbitrary ) ->
33+ (Spec .cmd list * Spec .cmd list * Spec .cmd list ) QCheck .arbitrary
34+
35+ val interp_sut_res : Spec .sut -> Spec .cmd list -> (Spec .cmd * STM .res ) list
36+ val agree_prop_par : Spec .cmd list * Spec .cmd list * Spec .cmd list -> bool
37+
38+ val agree_prop_par_asym :
39+ Spec .cmd list * Spec .cmd list * Spec .cmd list -> bool
40+
41+ val agree_test_par : count :int -> name :string -> QCheck.Test .t
42+ val neg_agree_test_par : count :int -> name :string -> QCheck.Test .t
43+ val agree_test_par_asym : count :int -> name :string -> QCheck.Test .t
44+ val neg_agree_test_par_asym : count :int -> name :string -> QCheck.Test .t
45+ end
Original file line number Diff line number Diff line change 1+ include Intf
2+
3+ let count =
4+ let factor b = if b then 10 else 1 in
5+ factor (64 < = Sys. word_size) * factor (Sys. backend_type = Native ) * 10
6+
7+ let run ?(verbose = true ) ?(count = count) ?(budgetf = 60.0 ) ~name ?make_domain
8+ (module Spec : STM.Spec ) =
9+ let module Seq = STM_sequential. Make (Spec ) in
10+ let module Con = STM_thread. Make (Spec ) [@ alert " -experimental" ] in
11+ Util. run_with_budget ~budgetf ~count @@ fun count ->
12+ [
13+ [ Seq. agree_test ~count ~name: (name ^ " sequential" ) ];
14+ (match make_domain with
15+ | None -> [ Con. agree_test_conc ~count ~name: (name ^ " concurrent" ) ]
16+ | Some _ -> [] );
17+ ]
18+ |> List. concat
19+ |> QCheck_base_runner. run_tests ~verbose
You can’t perform that action at this time.
0 commit comments