aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-09-19 09:38:22 +0000
committerGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-09-19 09:38:22 +0000
commit0204e998d50d6ee881e5878b2a8c45a687d3124f (patch)
tree8ce8bfa907cd7a3e8d908584cdafe0a958c06575 /tools
parent251b34ac94d8797637b3ca5acce5db593950d0c5 (diff)
Fix test-suite/ide for repository compiled without -local (fix #2600)
- Add option -boot to the coqtop given to fake_ide - Be sure that a dying coqtop subprocess cannot go unnoticed. Before that, for repositories compiled without -local, coqtop -ideslave was dying immediately because it was missing its coqlib informations. Then the first command send via Marshal.to_channel was triggering a SIGPIPE and hence the death of fake_ide. Strangely, the return code was not necessarily understood as non-zero (?!). We now catch SIGPIPE and do an "exit 1". git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14480 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'tools')
-rw-r--r--tools/fake_ide.ml10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/fake_ide.ml b/tools/fake_ide.ml
index 3bcbb96aa..50e56d846 100644
--- a/tools/fake_ide.ml
+++ b/tools/fake_ide.ml
@@ -56,6 +56,9 @@ let usage () =
exit 1
let main =
+ Sys.set_signal Sys.sigpipe
+ (Sys.Signal_handle
+ (fun _ -> prerr_endline "Broken Pipe (coqtop died ?)"; exit 1));
let coqtop_name = match Array.length Sys.argv with
| 1 -> "coqtop"
| 2 when Sys.argv.(1) <> "-help" -> Sys.argv.(1)
@@ -63,8 +66,11 @@ let main =
in
coqtop := Unix.open_process (coqtop_name^" -ideslave");
while true do
- try read_eval_print (read_line ())
+ let l = try read_line () with End_of_file -> exit 0
+ in
+ try read_eval_print l
with
- | End_of_file -> exit 0
| Comment -> ()
+ | e ->
+ prerr_endline ("Uncaught exception" ^ Printexc.to_string e); exit 1
done