Skip to content

Commit ec598c6

Browse files
authored
Merge pull request #370 from ocaml-multicore/io-lin-revision
In/Out_channel Lin test revision
2 parents 9cb4f47 + 64a4cfc commit ec598c6

File tree

4 files changed

+15
-22
lines changed

4 files changed

+15
-22
lines changed

src/io/dune

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
)
1212

1313
(library
14-
(name lin_tests_dsl_common_io)
15-
(modules lin_tests_dsl_common)
14+
(name lin_tests_spec_io)
15+
(modules lin_tests_spec_io)
1616
(package multicoretests)
1717
(libraries qcheck-lin.lin)
1818
)
@@ -22,7 +22,7 @@
2222
(modules lin_tests_dsl_domain)
2323
(package multicoretests)
2424
;(flags (:standard -w -27))
25-
(libraries qcheck-lin.domain lin_tests_dsl_common_io)
25+
(libraries qcheck-lin.domain lin_tests_spec_io)
2626
(action
2727
(setenv OCAML_SYSTEM %{system}
2828
(run %{test} --verbose)))
@@ -33,7 +33,7 @@
3333
(modules lin_tests_dsl_thread)
3434
(package multicoretests)
3535
;(flags (:standard -w -27))
36-
(libraries qcheck-lin.thread lin_tests_dsl_common_io)
36+
(libraries qcheck-lin.thread lin_tests_spec_io)
3737
; (action (run %{test} --verbose))
3838
(action (echo "Skipping src/io/%{test} from the test suite\n\n"))
3939
)

src/io/lin_tests_dsl_domain.ml

+3-5
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
(* Tests of in and out channels *)
33
(* ********************************************************************** *)
44

5-
open Lin_tests_dsl_common_io.Lin_tests_dsl_common
6-
7-
module IC_domain = Lin_domain.Make(ICConf)
8-
module OC_domain = Lin_domain.Make(OCConf)
5+
module IC_domain = Lin_domain.Make(Lin_tests_spec_io.ICConf)
6+
module OC_domain = Lin_domain.Make(Lin_tests_spec_io.OCConf)
97

108
let tests =
119
IC_domain.neg_lin_test ~count:1000 ~name:"Lin DSL In_channel test with Domain" ::
@@ -14,7 +12,7 @@ let tests =
1412
Printf.printf "Lin DSL Out_channel test with Domain disabled under macOS\n\n%!";
1513
[]
1614
) else [
17-
OC_domain.neg_lin_test ~count:1000 ~name:"Lin DSL Out_channel test with Domain";
15+
OC_domain.neg_lin_test ~count:5000 ~name:"Lin DSL Out_channel test with Domain";
1816
]
1917

2018
let _ = QCheck_base_runner.run_tests_main tests

src/io/lin_tests_dsl_thread.ml

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
(* Tests of in and out channels *)
33
(* ********************************************************************** *)
44

5-
open Lin_tests_dsl_common_io.Lin_tests_dsl_common
6-
7-
module IC_thread = Lin_thread.Make(ICConf) [@@alert "-experimental"]
8-
module OC_thread = Lin_thread.Make(OCConf) [@@alert "-experimental"]
5+
module IC_thread = Lin_thread.Make(Lin_tests_spec_io.ICConf) [@@alert "-experimental"]
6+
module OC_thread = Lin_thread.Make(Lin_tests_spec_io.OCConf) [@@alert "-experimental"]
97

108
let _ =
119
QCheck_base_runner.run_tests_main [

src/io/lin_tests_dsl_common.ml renamed to src/io/lin_tests_spec_io.ml

+6-9
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module ICConf : Lin.Spec = struct
99
let cleanup = In_channel.close
1010

1111
open Lin
12-
let int,int64 = nat_small,nat64_small
12+
let int,int64,bytes = nat_small,nat64_small,bytes_small
1313

1414
let api = [
1515
(* Only one t is tested, so skip stdin and opening functions *)
@@ -29,9 +29,8 @@ module ICConf : Lin.Spec = struct
2929
val_ "In_channel.input_char" In_channel.input_char (t @-> returning_or_exc (option char)) ;
3030
val_ "In_channel.input_byte" In_channel.input_byte (t @-> returning_or_exc (option int)) ;
3131
val_ "In_channel.input_line" In_channel.input_line (t @-> returning_or_exc (option string)) ;
32-
(* bytes not yet supported by the Lin library *)
33-
(* val_ "In_channel.input" In_channel.input (t @-> bytes @-> int @-> int @-> returning int) ; *)
34-
(* val_ "In_channel.really_input" In_channel.really_input (t @-> bytes @-> int @-> int @-> returning (option unit)) ; *)
32+
val_ "In_channel.input" In_channel.input (t @-> bytes @-> int @-> int @-> returning_or_exc int) ;
33+
val_ "In_channel.really_input" In_channel.really_input (t @-> bytes @-> int @-> int @-> returning_or_exc (option unit)) ;
3534
val_ "In_channel.really_input_string" In_channel.really_input_string (t @-> int @-> returning_or_exc (option string)) ;
3635
(* input_all generates counter-examples that are impossibly long *)
3736
(* val_ "In_channel.input_all" In_channel.input_all (t @-> returning_or_exc string) ; *)
@@ -53,7 +52,7 @@ module OCConf : Lin.Spec = struct
5352
let lift f (_, chan) = f chan
5453

5554
open Lin
56-
let int,int64,string = nat_small,nat64_small,string_small
55+
let int,int64,string,bytes = nat_small,nat64_small,string_small,bytes_small
5756
let api = [
5857
(* Only one t is tested, so skip stdout, stderr and opening functions *)
5958

@@ -76,10 +75,8 @@ module OCConf : Lin.Spec = struct
7675
val_ "Out_channel.output_char" (lift Out_channel.output_char) (t @-> char @-> returning_or_exc unit) ;
7776
val_ "Out_channel.output_byte" (lift Out_channel.output_byte) (t @-> int @-> returning_or_exc unit) ;
7877
val_ "Out_channel.output_string" (lift Out_channel.output_string) (t @-> string @-> returning_or_exc unit) ;
79-
80-
(* val_ "Out_channel.output_bytes" Out_channel.output_bytes (t @-> bytes @-> returning unit) ; *)
81-
(* val_ "Out_channel.output" Out_channel.output (t @-> bytes @-> int @-> int @-> returning unit) ; *)
82-
78+
val_ "Out_channel.output_bytes" (lift Out_channel.output_bytes) (t @-> bytes @-> returning_or_exc unit) ;
79+
val_ "Out_channel.output" (lift Out_channel.output) (t @-> bytes @-> int @-> int @-> returning_or_exc unit) ;
8380
val_ "Out_channel.output_substring" (lift Out_channel.output_substring) (t @-> string @-> int @-> int @-> returning_or_exc unit) ;
8481
val_ "Out_channel.set_binary_mode" (lift Out_channel.set_binary_mode) (t @-> bool @-> returning_or_exc unit) ;
8582
val_ "Out_channel.set_buffered" (lift Out_channel.set_buffered) (t @-> bool @-> returning_or_exc unit) ;

0 commit comments

Comments
 (0)