Skip to content

Commit 353eab4

Browse files
committed
Adapt the multicore tests to the new Lin interface
1 parent 3e72b8c commit 353eab4

37 files changed

+211
-169
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_qcheck 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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ struct
5656
let cleanup _ = ()
5757
end
5858

59-
module AT = Lin.Make(AConf)
59+
module AT_domain = Lin_domain.Make_internal(AConf)
6060
;;
6161
QCheck_base_runner.run_tests_main [
62-
AT.neg_lin_test `Domain ~count:1000 ~name:"Lin Array test with Domain";
62+
AT_domain.neg_lin_test ~count:1000 ~name:"Lin Array test with Domain";
6363
]

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 =
@@ -26,8 +26,8 @@ struct
2626
]
2727
end
2828

29-
module AT = Lin_api.Make(AConf)
29+
module AT_domain = Lin_domain.Make(AConf)
3030
;;
3131
QCheck_base_runner.run_tests_main [
32-
AT.neg_lin_test `Domain ~count:1000 ~name:"Lin_api Array test with Domain";
32+
AT_domain.neg_lin_test ~count:1000 ~name:"Lin_api Array test with Domain";
3333
]

src/atomic/dune

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

3737
; (rule
@@ -43,7 +43,7 @@
4343
(executable
4444
(name lin_tests_dsl)
4545
(modules lin_tests_dsl)
46-
(libraries lin))
46+
(libraries qcheck-lin.domain))
4747

4848
(rule
4949
(alias runtest)

src/atomic/lin_tests.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct
4242
let cleanup _ = ()
4343
end
4444

45-
module AT = Lin.Make(AConf)
45+
module AT_domain = Lin_domain.Make_internal(AConf)
4646

4747
(** A variant of the above with 3 Atomics *)
4848
module A3Conf =
@@ -85,9 +85,9 @@ struct
8585
let cleanup _ = ()
8686
end
8787

88-
module A3T = Lin.Make(A3Conf)
88+
module A3T_domain = Lin_domain.Make_internal(A3Conf)
8989
;;
9090
QCheck_base_runner.run_tests_main [
91-
AT.lin_test `Domain ~count:1000 ~name:"Lin Atomic test with Domain";
92-
A3T.lin_test `Domain ~count:1000 ~name:"Lin Atomic3 test with Domain";
91+
AT_domain.lin_test ~count:1000 ~name:"Lin Atomic test with Domain";
92+
A3T_domain.lin_test ~count:1000 ~name:"Lin Atomic3 test with Domain";
9393
]

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.ApiSpec = struct
2+
open Lin_base (* FIXME add Gen.nat *)
33
type t = int Atomic.t
44
let init () = Atomic.make 0
55
let cleanup _ = ()
@@ -13,9 +13,9 @@ module Atomic_spec : Lin_api.ApiSpec = struct
1313
val_ "Atomic.decr" Atomic.decr (t @-> returning unit) ]
1414
end
1515

16-
module Lin_atomic = Lin_api.Make (Atomic_spec)
16+
module Lin_atomic_domain = Lin_domain.Make (Atomic_spec)
1717

1818
let () =
1919
QCheck_base_runner.run_tests_main
20-
[ Lin_atomic.lin_test `Domain ~count:1000 ~name:"Lin_api Atomic test with Domain";
20+
[ Lin_atomic_domain.lin_test ~count:1000 ~name:"Lin_api Atomic test with Domain";
2121
]

src/bigarray/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
(executable
1313
(name lin_tests_dsl)
1414
(modules lin_tests_dsl)
15-
(libraries lin))
15+
(libraries qcheck-lin.domain))
1616

1717
(executable
1818
(name stm_tests)

src/bigarray/lin_tests_dsl.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ struct
1414
arr
1515
let cleanup _ = ()
1616

17-
open Lin_api
17+
open Lin_base
1818
let int = int_small
1919

2020
let api =
@@ -25,9 +25,9 @@ struct
2525
]
2626
end
2727

28-
module BA1T = Lin_api.Make(BA1Conf)
28+
module BA1T = Lin_domain.Make(BA1Conf)
2929

3030
let _ =
3131
QCheck_base_runner.run_tests_main [
32-
BA1T.neg_lin_test `Domain ~count:5000 ~name:"Lin_api Bigarray.Array1 (of ints) test with Domain";
32+
BA1T.neg_lin_test ~count:5000 ~name:"Lin_api Bigarray.Array1 (of ints) test with Domain";
3333
]

src/bytes/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
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 () = Stdlib.Bytes.make 42 '0'
77
let cleanup _ = ()
88

9-
open Lin_api
9+
open Lin_base
10+
1011
let api = [
1112
val_ "Bytes.get" Bytes.get (t @-> int @-> returning_or_exc char);
1213
val_ "Bytes.sub_string" Bytes.sub_string (t @-> int @-> int @-> returning_or_exc string);
@@ -16,9 +17,10 @@ module BConf = struct
1617
val_ "Bytes.index_from" Bytes.index_from (t @-> int @-> char @-> returning_or_exc int)]
1718
end
1819

19-
module BT = Lin_api.Make(BConf)
20+
module BT_domain = Lin_domain.Make(BConf)
21+
module BT_thread = Lin_thread.Make(BConf)
2022
;;
2123
QCheck_base_runner.run_tests_main [
22-
BT.lin_test `Domain ~count:1000 ~name:"Lin_api Bytes test with Domain";
23-
BT.lin_test `Thread ~count:1000 ~name:"Lin_api Bytes test with Thread";
24+
BT_domain.lin_test ~count:1000 ~name:"Lin_api Bytes test with Domain";
25+
BT_thread.lin_test ~count:1000 ~name:"Lin_api Bytes test with Thread";
2426
]

0 commit comments

Comments
 (0)