summaryrefslogtreecommitdiffstats
path: root/testsuite/external/kaputt-1.2.patch
blob: 279730ed98814d870c44977f2cd00c1b6732a0c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
--- 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";