diff --git a/src/io/dune b/src/io/dune index d16bebf33..6f61bd436 100644 --- a/src/io/dune +++ b/src/io/dune @@ -11,8 +11,8 @@ ) (library - (name lin_tests_dsl_common_io) - (modules lin_tests_dsl_common) + (name lin_tests_spec_io) + (modules lin_tests_spec_io) (package multicoretests) (libraries qcheck-lin.lin) ) @@ -22,7 +22,7 @@ (modules lin_tests_dsl_domain) (package multicoretests) ;(flags (:standard -w -27)) - (libraries qcheck-lin.domain lin_tests_dsl_common_io) + (libraries qcheck-lin.domain lin_tests_spec_io) (action (setenv OCAML_SYSTEM %{system} (run %{test} --verbose))) @@ -33,7 +33,7 @@ (modules lin_tests_dsl_thread) (package multicoretests) ;(flags (:standard -w -27)) - (libraries qcheck-lin.thread lin_tests_dsl_common_io) + (libraries qcheck-lin.thread lin_tests_spec_io) ; (action (run %{test} --verbose)) (action (echo "Skipping src/io/%{test} from the test suite\n\n")) ) diff --git a/src/io/lin_tests_dsl_domain.ml b/src/io/lin_tests_dsl_domain.ml index 3d7fd0e04..6837cdb51 100644 --- a/src/io/lin_tests_dsl_domain.ml +++ b/src/io/lin_tests_dsl_domain.ml @@ -2,10 +2,8 @@ (* Tests of in and out channels *) (* ********************************************************************** *) -open Lin_tests_dsl_common_io.Lin_tests_dsl_common - -module IC_domain = Lin_domain.Make(ICConf) -module OC_domain = Lin_domain.Make(OCConf) +module IC_domain = Lin_domain.Make(Lin_tests_spec_io.ICConf) +module OC_domain = Lin_domain.Make(Lin_tests_spec_io.OCConf) let tests = IC_domain.neg_lin_test ~count:1000 ~name:"Lin DSL In_channel test with Domain" :: @@ -14,7 +12,7 @@ let tests = Printf.printf "Lin DSL Out_channel test with Domain disabled under macOS\n\n%!"; [] ) else [ - OC_domain.neg_lin_test ~count:1000 ~name:"Lin DSL Out_channel test with Domain"; + OC_domain.neg_lin_test ~count:5000 ~name:"Lin DSL Out_channel test with Domain"; ] let _ = QCheck_base_runner.run_tests_main tests diff --git a/src/io/lin_tests_dsl_thread.ml b/src/io/lin_tests_dsl_thread.ml index 12962b004..4ecffb307 100644 --- a/src/io/lin_tests_dsl_thread.ml +++ b/src/io/lin_tests_dsl_thread.ml @@ -2,10 +2,8 @@ (* Tests of in and out channels *) (* ********************************************************************** *) -open Lin_tests_dsl_common_io.Lin_tests_dsl_common - -module IC_thread = Lin_thread.Make(ICConf) [@@alert "-experimental"] -module OC_thread = Lin_thread.Make(OCConf) [@@alert "-experimental"] +module IC_thread = Lin_thread.Make(Lin_tests_spec_io.ICConf) [@@alert "-experimental"] +module OC_thread = Lin_thread.Make(Lin_tests_spec_io.OCConf) [@@alert "-experimental"] let _ = QCheck_base_runner.run_tests_main [ diff --git a/src/io/lin_tests_dsl_common.ml b/src/io/lin_tests_spec_io.ml similarity index 89% rename from src/io/lin_tests_dsl_common.ml rename to src/io/lin_tests_spec_io.ml index f17ae7ddd..b19aabdb3 100644 --- a/src/io/lin_tests_dsl_common.ml +++ b/src/io/lin_tests_spec_io.ml @@ -9,7 +9,7 @@ module ICConf : Lin.Spec = struct let cleanup = In_channel.close open Lin - let int,int64 = nat_small,nat64_small + let int,int64,bytes = nat_small,nat64_small,bytes_small let api = [ (* Only one t is tested, so skip stdin and opening functions *) @@ -29,9 +29,8 @@ module ICConf : Lin.Spec = struct val_ "In_channel.input_char" In_channel.input_char (t @-> returning_or_exc (option char)) ; val_ "In_channel.input_byte" In_channel.input_byte (t @-> returning_or_exc (option int)) ; val_ "In_channel.input_line" In_channel.input_line (t @-> returning_or_exc (option string)) ; - (* bytes not yet supported by the Lin library *) - (* val_ "In_channel.input" In_channel.input (t @-> bytes @-> int @-> int @-> returning int) ; *) - (* val_ "In_channel.really_input" In_channel.really_input (t @-> bytes @-> int @-> int @-> returning (option unit)) ; *) + val_ "In_channel.input" In_channel.input (t @-> bytes @-> int @-> int @-> returning_or_exc int) ; + val_ "In_channel.really_input" In_channel.really_input (t @-> bytes @-> int @-> int @-> returning_or_exc (option unit)) ; val_ "In_channel.really_input_string" In_channel.really_input_string (t @-> int @-> returning_or_exc (option string)) ; (* input_all generates counter-examples that are impossibly long *) (* val_ "In_channel.input_all" In_channel.input_all (t @-> returning_or_exc string) ; *) @@ -53,7 +52,7 @@ module OCConf : Lin.Spec = struct let lift f (_, chan) = f chan open Lin - let int,int64,string = nat_small,nat64_small,string_small + let int,int64,string,bytes = nat_small,nat64_small,string_small,bytes_small let api = [ (* Only one t is tested, so skip stdout, stderr and opening functions *) @@ -76,10 +75,8 @@ module OCConf : Lin.Spec = struct val_ "Out_channel.output_char" (lift Out_channel.output_char) (t @-> char @-> returning_or_exc unit) ; val_ "Out_channel.output_byte" (lift Out_channel.output_byte) (t @-> int @-> returning_or_exc unit) ; val_ "Out_channel.output_string" (lift Out_channel.output_string) (t @-> string @-> returning_or_exc unit) ; - - (* val_ "Out_channel.output_bytes" Out_channel.output_bytes (t @-> bytes @-> returning unit) ; *) - (* val_ "Out_channel.output" Out_channel.output (t @-> bytes @-> int @-> int @-> returning unit) ; *) - + val_ "Out_channel.output_bytes" (lift Out_channel.output_bytes) (t @-> bytes @-> returning_or_exc unit) ; + val_ "Out_channel.output" (lift Out_channel.output) (t @-> bytes @-> int @-> int @-> returning_or_exc unit) ; val_ "Out_channel.output_substring" (lift Out_channel.output_substring) (t @-> string @-> int @-> int @-> returning_or_exc unit) ; val_ "Out_channel.set_binary_mode" (lift Out_channel.set_binary_mode) (t @-> bool @-> returning_or_exc unit) ; val_ "Out_channel.set_buffered" (lift Out_channel.set_buffered) (t @-> bool @-> returning_or_exc unit) ;