Skip to content

Commit 6a78c51

Browse files
committed
Adapt the multicore tests to the new Lin interface
1 parent dd8fd76 commit 6a78c51

34 files changed

+170
-143
lines changed

src/array/dune

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
(name lin_tests)
2626
(modules lin_tests)
2727
(flags (:standard -w -27))
28-
(libraries lin)
28+
(libraries qcheck-lin.domain)
2929
(preprocess (pps ppx_deriving.show ppx_deriving.eq)))
3030

3131
; (rule
@@ -37,7 +37,7 @@
3737
(executable
3838
(name lin_tests_dsl)
3939
(modules lin_tests_dsl)
40-
(libraries lin))
40+
(libraries qcheck-lin.domain))
4141

4242
(rule
4343
(alias runtest)

src/array/lin_tests.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ struct
1010
(* note to self:
1111
- generate one t_var per input [t] parameter and
1212
- record [Env.next] for each resulting [t] in an option *)
13-
open Lin
13+
open Lin_base.Lin_internal
1414
type cmd =
1515
| Length of Var.t
1616
| Get of Var.t * int
@@ -113,10 +113,10 @@ struct
113113
let cleanup _ = ()
114114
end
115115

116-
module AT = Lin.Make(AConf)
116+
module AT_domain = Lin_domain.Make_internal(AConf)
117117
;;
118118
Util.set_ci_printing ()
119119
;;
120120
QCheck_base_runner.run_tests_main [
121-
AT.neg_lin_test `Domain ~count:1000 ~name:"Lin Array test with Domain";
121+
AT_domain.neg_lin_test ~count:1000 ~name:"Lin Array test with Domain";
122122
]

src/array/lin_tests_dsl.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ struct
99
let init () = Array.make array_size 'a'
1010
let cleanup _ = ()
1111

12-
open Lin_api
12+
open Lin_base
1313
let int,char = nat_small,char_printable
1414
let array_to_seq a = List.to_seq (List.of_seq (Array.to_seq a)) (* workaround: Array.to_seq is lazy and will otherwise see and report later Array.set state changes... *)
1515
let api =
@@ -29,10 +29,10 @@ struct
2929
]
3030
end
3131

32-
module AT = Lin_api.Make(AConf)
32+
module AT_domain = Lin_domain.Make(AConf)
3333
;;
3434
Util.set_ci_printing ()
3535
;;
3636
QCheck_base_runner.run_tests_main [
37-
AT.neg_lin_test `Domain ~count:1000 ~name:"Lin_api Array test with Domain";
37+
AT_domain.neg_lin_test ~count:1000 ~name:"Lin_api Array test with Domain";
3838
]

src/atomic/dune

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
(name lin_tests)
2929
(modules lin_tests)
3030
(flags (:standard -w -27))
31-
(libraries lin)
31+
(libraries qcheck-lin.domain)
3232
(preprocess (pps ppx_deriving.show ppx_deriving.eq)))
3333

3434
; (rule
@@ -40,7 +40,7 @@
4040
(executable
4141
(name lin_tests_dsl)
4242
(modules lin_tests_dsl)
43-
(libraries lin))
43+
(libraries qcheck-lin.domain))
4444

4545
(rule
4646
(alias runtest)

src/atomic/lin_tests.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ open QCheck
66
module AConf =
77
struct
88
type t = int Atomic.t
9-
open Lin
9+
open Lin_base.Lin_internal
1010
type cmd =
1111
| Make of int
1212
| Get of Var.t
@@ -68,7 +68,7 @@ struct
6868
let cleanup _ = ()
6969
end
7070

71-
module AT = Lin.Make(AConf)
71+
module AT_domain = Lin_domain.Make_internal(AConf)
7272

7373
(*
7474
(** A variant of the above with 3 Atomics *)
@@ -118,6 +118,6 @@ module A3T = Lin.Make(A3Conf)
118118
Util.set_ci_printing ()
119119
;;
120120
QCheck_base_runner.run_tests_main [
121-
AT.lin_test `Domain ~count:1000 ~name:"Lin Atomic test with Domain";
121+
AT_domain.lin_test ~count:1000 ~name:"Lin Atomic test with Domain";
122122
(* A3T.lin_test `Domain ~count:1000 ~name:"Lin Atomic3 test with Domain"; *)
123123
]

src/atomic/lin_tests_dsl.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
module Atomic_spec : Lin_api.ApiSpec = struct
2-
open Lin_api (* FIXME add Gen.nat *)
1+
module Atomic_spec : Lin_base.Spec = struct
2+
open Lin_base (* FIXME add Gen.nat *)
33
type t = int Atomic.t
44
let init () = Atomic.make 0
55
let cleanup _ = ()
@@ -15,10 +15,10 @@ module Atomic_spec : Lin_api.ApiSpec = struct
1515
val_ "Atomic.decr" Atomic.decr (t @-> returning unit) ]
1616
end
1717

18-
module Lin_atomic = Lin_api.Make (Atomic_spec)
18+
module Lin_atomic_domain = Lin_domain.Make (Atomic_spec)
1919

2020
let () = Util.set_ci_printing ()
2121
let () =
2222
QCheck_base_runner.run_tests_main
23-
[ Lin_atomic.lin_test `Domain ~count:1000 ~name:"Lin_api Atomic test with Domain";
23+
[ Lin_atomic_domain.lin_test ~count:1000 ~name:"Lin_api Atomic test with Domain";
2424
]

src/bigarray/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
(executable
1111
(name lin_tests_dsl)
1212
(modules lin_tests_dsl)
13-
(libraries lin))
13+
(libraries qcheck-lin.domain))
1414

1515
(executable
1616
(name stm_tests)

src/bigarray/lin_tests_dsl.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct
3838
let init () = array_create array_size
3939
let cleanup _ = ()
4040

41-
open Lin_api
41+
open Lin_base
4242
let int = int_small
4343

4444
let api =
@@ -61,10 +61,10 @@ struct
6161
]
6262
end
6363

64-
module BA1T = Lin_api.Make(BA1Conf)
64+
module BA1T = Lin_domain.Make(BA1Conf)
6565

6666
let _ =
6767
Util.set_ci_printing () ;
6868
QCheck_base_runner.run_tests_main [
69-
BA1T.neg_lin_test `Domain ~count:5000 ~name:"Lin_api Bigarray.Array1 (of ints) test with Domain";
69+
BA1T.neg_lin_test ~count:5000 ~name:"Lin_api Bigarray.Array1 (of ints) test with Domain";
7070
]

src/bytes/dune

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
(alias
66
(name default)
77
(package multicoretests)
8-
(deps lin_tests_dsl.exe))
8+
(deps lin_tests_dsl.exe stm_tests.exe))
99

1010
;; Linearizability tests
1111

1212
(executable
1313
(name lin_tests_dsl)
1414
(modules lin_tests_dsl)
15-
(libraries lin))
15+
(libraries qcheck-lin.domain qcheck-lin.thread))
1616

1717
(executable
1818
(name stm_tests)

src/bytes/lin_tests_dsl.ml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ module BConf = struct
66
let init () = Bytes.make 42 '0'
77
let cleanup _ = ()
88

9-
open Lin_api
9+
open Lin_base
10+
1011
let int = nat_small
1112
(*let int = int_bound 10*)
1213

@@ -29,11 +30,12 @@ module BConf = struct
2930
val_ "Bytes.index_from" Bytes.index_from (t @-> int @-> char @-> returning_or_exc int)]
3031
end
3132

32-
module BT = Lin_api.Make(BConf)
33+
module BT_domain = Lin_domain.Make(BConf)
34+
module BT_thread = Lin_thread.Make(BConf)
3335
;;
3436
Util.set_ci_printing ()
3537
;;
3638
QCheck_base_runner.run_tests_main [
37-
BT.neg_lin_test `Domain ~count:1000 ~name:"Lin_api Bytes test with Domain";
38-
BT.lin_test `Thread ~count:250 ~name:"Lin_api Bytes test with Thread";
39+
BT_domain.neg_lin_test ~count:1000 ~name:"Lin_api Bytes test with Domain";
40+
BT_thread.lin_test ~count:250 ~name:"Lin_api Bytes test with Thread";
3941
]

0 commit comments

Comments
 (0)