aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorletouzey2011-09-19 09:38:22 +0000
committerletouzey2011-09-19 09:38:22 +0000
commit0204e998d50d6ee881e5878b2a8c45a687d3124f (patch)
tree8ce8bfa907cd7a3e8d908584cdafe0a958c06575
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
-rw-r--r--test-suite/Makefile2
-rw-r--r--tools/fake_ide.ml10
2 files changed, 9 insertions, 3 deletions
diff --git a/test-suite/Makefile b/test-suite/Makefile
index 828a710b14..cd5886f823 100644
--- a/test-suite/Makefile
+++ b/test-suite/Makefile
@@ -431,7 +431,7 @@ ide : $(patsubst %.fake,%.fake.log,$(wildcard ide/*.fake))
@echo "TEST $<"
$(HIDE){ \
echo $(call log_intro,$<); \
- $(BIN)fake_ide $(BIN)coqtop < $< 2>&1; \
+ $(BIN)fake_ide "$(BIN)coqtop -boot" < $< 2>&1; \
if [ $$? = 0 ]; then \
echo $(log_success); \
echo " $<...Ok"; \
diff --git a/tools/fake_ide.ml b/tools/fake_ide.ml
index 3bcbb96aaf..50e56d8468 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