Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit 83c8aee2 authored by MARCHE Claude's avatar MARCHE Claude

fix issues for running examples/regtests with new replayer

parent 1456ecb9
......@@ -45,18 +45,22 @@ module Unix_scheduler = struct
let prompt_delay = ref 0
let print_prompt = ref true
let prompt = ref "> "
let prompt_string = ref "> "
(* [main_loop interp] starts the scheduler. On idle, standard input is
read. When a complete line is read from stdin, it is passed
as a string to the function [interp] *)
let main_loop interp =
let main_loop ?prompt interp =
begin match prompt with
| None -> ()
| Some s -> prompt_string := s
end;
try
while true do
if !print_prompt then begin
prompt_delay := !prompt_delay + 1;
if !prompt_delay = 1 then begin
Format.printf "%s@?" !prompt;
if !prompt_string <> "" && !prompt_delay = 1 then begin
Format.printf "%s@?" !prompt_string;
prompt_delay := 0;
print_prompt := false;
end
......@@ -87,7 +91,8 @@ module Unix_scheduler = struct
| (_,t,_) :: _ -> t -. time
(* or the time left until the next timeout otherwise *)
in
let a,_,_ = Unix.select [Unix.stdin] [] [] delay in
let a,_,_ = Unix.select
(if !prompt_string <> "" then [Unix.stdin] else []) [] [] delay in
match a with
| [_] ->
let n = Unix.read Unix.stdin buf 0 256 in
......
......@@ -15,6 +15,6 @@ module Unix_scheduler : sig
registered at the same time. Functions registered with higher
priority will be called first. *)
val main_loop: (string -> 'a) -> unit
val main_loop: ?prompt:string -> (string -> 'a) -> unit
end
......@@ -391,7 +391,7 @@ let () =
if found_obs then eprintf "[Warning] session is obsolete@.";
if some_merge_miss then eprintf "[Warning] some goals were missed during merge@.";
add_to_check_no_smoke some_merge_miss found_obs cont;
Unix_scheduler.Unix_scheduler.main_loop (fun _ -> ());
Unix_scheduler.Unix_scheduler.main_loop ~prompt:"" (fun _ -> ());
eprintf "main replayer loop exited unexpectedly@.";
exit 1
with
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment