Skip to content

Commit 2150652

Browse files
committed
Remove Lin Out_channel tests
1 parent e1aab77 commit 2150652

File tree

4 files changed

+6
-76
lines changed

4 files changed

+6
-76
lines changed

src/io/dune

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@
2323
(package multicoretests)
2424
;(flags (:standard -w -27))
2525
(libraries qcheck-lin.domain lin_tests_spec_io)
26-
(action
27-
(setenv OCAML_SYSTEM %{system}
28-
(run %{test} --verbose)))
26+
(action (run %{test} --verbose))
2927
)
3028

3129
(test

src/io/lin_tests_domain.ml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
(* ********************************************************************** *)
2-
(* Tests of in and out channels *)
2+
(* Tests of In_channels *)
33
(* ********************************************************************** *)
44

55
module IC_domain = Lin_domain.Make(Lin_tests_spec_io.ICConf)
6-
module OC_domain = Lin_domain.Make(Lin_tests_spec_io.OCConf)
76

8-
let tests =
9-
IC_domain.neg_lin_test ~count:1000 ~name:"Lin In_channel test with Domain" ::
10-
if Sys.getenv_opt "OCAML_SYSTEM" = Some "macosx"
11-
then (
12-
Printf.printf "Lin Out_channel test with Domain disabled under macOS\n\n%!";
13-
[]
14-
) else [
15-
OC_domain.neg_lin_test ~count:5000 ~name:"Lin Out_channel test with Domain";
7+
let _ =
8+
QCheck_base_runner.run_tests_main [
9+
IC_domain.neg_lin_test ~count:1000 ~name:"Lin In_channel test with Domain"
1610
]
17-
18-
let _ = QCheck_base_runner.run_tests_main tests

src/io/lin_tests_spec_io.ml

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -61,61 +61,3 @@ module ICConf : Lin.Spec = struct
6161
val_ "In_channel.set_binary_mode" In_channel.set_binary_mode (t @-> bool @-> returning_or_exc unit) ;
6262
]
6363
end
64-
65-
module OCConf : Lin.Spec = struct
66-
(* a path and an open channel to that file; we need to keep the path
67-
to cleanup after the test run *)
68-
type t = Out_channel.t
69-
let path = ref ""
70-
71-
let init () =
72-
let p,ch = Filename.open_temp_file "lin-" "" in
73-
path := p;
74-
ch
75-
76-
let cleanup chan =
77-
Out_channel.close chan;
78-
Sys.remove !path
79-
80-
open Lin
81-
let int,int64 = nat_small,nat64_small
82-
83-
(* disable string and bytes char shrinking as too many shrinking candidates
84-
triggers long Out_channel shrink runs on Mingw + Cygwin *)
85-
let string =
86-
let string = QCheck.(set_shrink Shrink.(string ~shrink:nil) string_small) in
87-
gen_deconstructible string (print Lin.string) String.equal
88-
let bytes =
89-
let bytes = QCheck.(set_shrink Shrink.(bytes ~shrink:nil) bytes_small) in
90-
gen_deconstructible bytes (print Lin.bytes) Bytes.equal
91-
92-
let api = [
93-
(* Only one t is tested, so skip stdout, stderr and opening functions *)
94-
95-
(* val_ "Out_channel.stdout" Out_channel.stdout (t) ; *)
96-
(* val_ "Out_channel.stderr" Out_channel.stderr (t) ; *)
97-
(* val_ "Out_channel.open_bin" Out_channel.open_bin (string @-> returning t) ; *)
98-
(* val_ "Out_channel.open_text" Out_channel.open_text (string @-> returning t) ; *)
99-
(* val_ "Out_channel.open_gen" Out_channel.open_gen (open_flag list @-> int @-> string @-> returning t) ; *)
100-
(* val_ "Out_channel.with_open_bin" Out_channel.with_open_bin (string @-> (t @-> 'a) @-> returning 'a) ; *)
101-
(* val_ "Out_channel.with_open_text" Out_channel.with_open_text (string @-> (t @-> 'a) @-> returning 'a) ; *)
102-
(* val_ "Out_channel.with_open_gen" Out_channel.with_open_gen (open_flag list @-> int @-> string @-> (t @-> 'a) @-> returning 'a) ; *)
103-
104-
val_freq 10 "Out_channel.seek" Out_channel.seek (t @-> int64 @-> returning_or_exc unit) ;
105-
val_freq 20 "Out_channel.pos" Out_channel.pos (t @-> returning_or_exc int64) ;
106-
val_freq 20 "Out_channel.length" Out_channel.length (t @-> returning_or_exc int64) ;
107-
val_freq 10 "Out_channel.close" Out_channel.close (t @-> returning_or_exc unit) ;
108-
val_freq 10 "Out_channel.close_noerr" Out_channel.close_noerr (t @-> returning unit) ;
109-
val_freq 10 "Out_channel.flush" Out_channel.flush (t @-> returning_or_exc unit) ;
110-
(*val_freq 1 "Out_channel.flush_all" Out_channel.flush_all (unit @-> returning_or_exc unit) ;*)
111-
val_freq 10 "Out_channel.output_char" Out_channel.output_char (t @-> char @-> returning_or_exc unit) ;
112-
val_freq 10 "Out_channel.output_byte" Out_channel.output_byte (t @-> int @-> returning_or_exc unit) ;
113-
val_freq 10 "Out_channel.output_string" Out_channel.output_string (t @-> string @-> returning_or_exc unit) ;
114-
val_freq 10 "Out_channel.output_bytes" Out_channel.output_bytes (t @-> bytes @-> returning_or_exc unit) ;
115-
val_freq 10 "Out_channel.output" Out_channel.output (t @-> bytes @-> int @-> int @-> returning_or_exc unit) ;
116-
val_freq 10 "Out_channel.output_substring" Out_channel.output_substring (t @-> string @-> int @-> int @-> returning_or_exc unit) ;
117-
val_freq 10 "Out_channel.set_binary_mode" Out_channel.set_binary_mode (t @-> bool @-> returning_or_exc unit) ;
118-
val_freq 10 "Out_channel.set_buffered" Out_channel.set_buffered (t @-> bool @-> returning_or_exc unit) ;
119-
val_freq 10 "Out_channel.is_buffered" Out_channel.is_buffered (t @-> returning_or_exc bool) ;
120-
]
121-
end

src/io/lin_tests_thread.ml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
(* ********************************************************************** *)
2-
(* Tests of in and out channels *)
2+
(* Tests of In_channels *)
33
(* ********************************************************************** *)
44

55
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"]
76

87
let _ =
98
QCheck_base_runner.run_tests_main [
109
IC_thread.neg_lin_test ~count:1000 ~name:"Lin In_channel test with Thread";
11-
OC_thread.neg_lin_test ~count:1000 ~name:"Lin Out_channel test with Thread";
1210
]

0 commit comments

Comments
 (0)