ocaml/testsuite/external/kaputt-1.2.patch

38 lines
1.4 KiB
Diff

--- kaputt-1.2/src/syntax/kaputt_pp.ml.orig 2012-12-19 16:46:36.000000000 +0100
+++ kaputt-1.2/src/syntax/kaputt_pp.ml 2012-12-19 16:46:59.000000000 +0100
@@ -54,6 +54,8 @@
let temp_name, temp_chan = Filename.open_temp_file "kaputt" ".ml" in
let source_chan = open_in args.(len - 3) in
let test_chan = open_in test_file in
+ let directive = Printf.sprintf "# 1 %S\n" args.(len - 3) in
+ output_string temp_chan directive;
copy source_chan temp_chan;
let directive = Printf.sprintf "# 1 %S\n" test_file in
output_string temp_chan directive;
--- kaputt-1.2/src/syntax/kaputt_pp.ml.orig 2013-01-08 17:05:01.000000000 +0100
+++ kaputt-1.2/src/syntax/kaputt_pp.ml 2013-01-08 17:05:46.000000000 +0100
@@ -28,8 +28,7 @@
Buffer.add_string buff (quote args.(i));
Buffer.add_char buff ' ';
done;
- let code = Sys.command (Buffer.contents buff) in
- ignore (exit code)
+ Sys.command (Buffer.contents buff)
let copy from_chan to_chan =
try
@@ -64,9 +63,11 @@
close_in_noerr test_chan;
close_out_noerr temp_chan;
args.(len - 3) <- temp_name;
- call args
+ let code = call args in
+ (try Sys.remove temp_name with _ -> ());
+ ignore (exit code)
end else begin
- call args
+ ignore (exit (call args))
end
else begin
Printf.eprintf "Error: invalid command-line\n";