diff --git a/dune-project b/dune-project index 2e08fc3..b9cf574 100644 --- a/dune-project +++ b/dune-project @@ -21,5 +21,4 @@ ctypes ctypes-foreign (ounit2 :with-test) - (stdio :with-test) )) diff --git a/gobject-introspection.opam b/gobject-introspection.opam index 9539fa6..81a8254 100644 --- a/gobject-introspection.opam +++ b/gobject-introspection.opam @@ -22,7 +22,6 @@ depends: [ "ctypes" "ctypes-foreign" "ounit2" {with-test} - "stdio" {with-test} "odoc" {with-doc} ] build: [ diff --git a/tests/Test_version.ml b/tests/Test_version.ml index 3f903f0..f93fd6b 100644 --- a/tests/Test_version.ml +++ b/tests/Test_version.ml @@ -1,7 +1,14 @@ open Test_utils open OUnit2 open GObject_introspection -open Stdio + +let input_lines ch = + let rec aux acc = + match input_line ch with + | exception End_of_file -> List.rev acc + | line -> aux (line :: acc) + in + aux [] let test_get_version _ = let major = Version.get_major_version () |> string_of_int in @@ -10,8 +17,9 @@ let test_get_version _ = let version = String.concat "." [ major; minor; micro ] in let run cmd = let inp = Unix.open_process_in cmd in - let r = In_channel.input_lines inp in - In_channel.close inp; + let r = + Fun.protect (fun () -> input_lines inp) ~finally:(fun () -> close_in inp) + in List.hd r in let modversion =