Commit 3c9e4e59 authored by Erwan Jahier's avatar Erwan Jahier

lurette 0.109 Fri, 25 Oct 2002 17:48:01 +0200 by jahier

Parent-Version:      0.108
Version-Log:

ihm/xlurette/xlurette_glade_main.ml:
source/lurettetop.ml:
   Retreive and print the pid of lurette to be able in xlurette
   to kill the current run.

Project-Description: Lurette
parent 4063d2fa
......@@ -42,11 +42,11 @@
(mlcuddidl/rdd.mli 7174 1034006019 c/40_rdd.mli 1.1)
(test/Makefile 32 1035531408 c/0_Makefile 1.8)
(source/parse_env.ml 24584 1033723811 41_parse_env. 1.29)
(ihm/xlurette/xlurette_glade_main.ml 21199 1035557853 c/12_xlurette_g 1.11)
(ihm/xlurette/xlurette_glade_main.ml 21723 1035560881 c/12_xlurette_g 1.12)
(demo/chaudiere/chaudiere_oracle.lus 107 1031732392 c/8_chaudiere_ 1.1)
(source/solver.ml 31802 1033732198 39_solver.ml 1.32)
(test/ControleurPorte.lus 3219 1032940601 c/17_Controleur 1.1)
(source/lurette.ml 14052 1035557853 12_lurette.ml 1.57)
(source/lurette.ml 14068 1035560881 12_lurette.ml 1.58)
(source/Makefile 1114 1035531408 c/20_Makefile 1.7)
(source/util.ml 19000 1035557853 35_util.ml 1.31)
(mlcuddidl/manager.mli 7912 1034006019 c/46_manager.ml 1.1)
......@@ -70,7 +70,7 @@
(make_lurette 1306 1034006019 27_make_luret 1.17)
(source/control.ml 4416 1030975996 c/4_control.ml 1.3)
(ihm/xlurette/xlurette_glade_interface.ml 31699 1035535912 c/15_xlurette_g 1.7)
(source/lurettetop.ml 28209 1035557853 c/1_lurettetop 1.18)
(source/lurettetop.ml 28340 1035560881 c/1_lurettetop 1.19)
(mlcuddidl/README 1574 1034006019 d/8_README 1.1)
(source/Makefile.lurettetop 300 1035531408 d/14_Makefile.l 1.1)
(cuddaux/README 1427 1034006019 c/34_README 1.1)
......
......@@ -6,6 +6,7 @@ let debug =
false
let pid = ref 0
let lpid = ref 0
(* Flag telling if any saved package need to be restored *)
......@@ -30,7 +31,8 @@ let _ =
type draw_mode = Verteces | Edges | Inside
type tok = Genlex.token Stream.t
let ok_str = " OK!
"
(**************************************************************************)
(**************************************************************************)
class customized_callbacks = object(self)
......@@ -74,13 +76,26 @@ class customized_callbacks = object(self)
display "No program is currently running.\n";
()
)
else if
String.length str > 22
&& String.sub str 0 22 = "The Pid of lurette is "
then
let lurette_pid = String.sub str 22 ((String.length str) - 22) in
lpid := int_of_string lurette_pid;
()
else if
String.length str > 36
&& String.sub str 0 34 = "The random engine was initialized "
then
let seed_str = String.sub str 48 ((String.length str) - 48) in
self#top_xlurette#user_seed#set_text seed_str;
display (str ^ "\n")
if self#top_xlurette#radiobutton_verbose_on#active then
display (str ^ "\n");
else if
str = " ==> The test completed; no property has been violated."
then
display (ok_str ^ str ^ "\n")
else if
String.length str > 7 && String.sub str 0 8 = "<lurette"
then
......@@ -195,9 +210,15 @@ class customized_callbacks = object(self)
"Step button unactive because step-by-step mode is off\n"
method stop_run () =
self#top_xlurette#output_window#insert "Stopping the current run.\n";
Unix.kill (!pid) Sys.sigint ;
()
if !lpid <> 0 then
(
self#top_xlurette#output_window#insert "Stopping the current run.\n";
(try
Unix.kill (!lpid) Sys.sigkill
with _ -> ()
);
lpid := 0
)
method stop () =
if
......
;; -*- Prcs -*-
(Created-By-Prcs-Version 1 3 3)
(Project-Description "Lurette")
(Project-Version lurette 0 108)
(Parent-Version lurette 0 107)
(Project-Version lurette 0 109)
(Parent-Version lurette 0 108)
(Version-Log "
source/lurette.ml:
source/command_line.ml
source/command_line.mli
source/util.ml:
source/lurettetop.ml:
use crete_process instead un sys.command to call lurette from lurettetop
ihm/xlurette/xlurette_glade_main.ml:
Put the newly generated random seed into the manual text box.
source/lurettetop.ml:
Retreive and print the pid of lurette to be able in xlurette
to kill the current run.
")
(New-Version-Log ""
)
(Checkin-Time "Fri, 25 Oct 2002 16:57:33 +0200")
(Checkin-Time "Fri, 25 Oct 2002 17:48:01 +0200")
(Checkin-Login jahier)
(Populate-Ignore ())
(Project-Keywords)
......@@ -38,7 +31,7 @@ ihm/xlurette/xlurette_glade_main.ml:
;; Sources files for lurette only
(source/lurette.mli (lurette/11_lurette.ml 1.12 644))
(source/lurette.ml (lurette/12_lurette.ml 1.57 644))
(source/lurette.ml (lurette/12_lurette.ml 1.58 644))
(source/command_line.ml (lurette/b/20_command_li 1.10 644))
(source/command_line.mli (lurette/b/21_command_li 1.9 644))
......@@ -85,7 +78,7 @@ ihm/xlurette/xlurette_glade_main.ml:
(source/gne.mli (lurette/b/36_gne.mli 1.4 644))
(source/gne.ml (lurette/b/37_gne.ml 1.4 644))
(source/lurettetop.ml (lurette/c/1_lurettetop 1.18 644))
(source/lurettetop.ml (lurette/c/1_lurettetop 1.19 644))
(source/gen_stubs.ml (lurette/24_generate_l 1.38 644))
(source/control.mli (lurette/c/3_control.ml 1.2 644))
......@@ -171,7 +164,7 @@ ihm/xlurette/xlurette_glade_main.ml:
(test/Makefile (lurette/c/0_Makefile 1.8 644))
;; xlurette
(ihm/xlurette/xlurette_glade_main.ml (lurette/c/12_xlurette_g 1.11 644))
(ihm/xlurette/xlurette_glade_main.ml (lurette/c/12_xlurette_g 1.12 644))
(ihm/xlurette/xlurette.glade (lurette/c/13_xlurette.g 1.8 644))
(ihm/xlurette/xlurette_glade_interface.ml (lurette/c/15_xlurette_g 1.7 644))
(ihm/xlurette/makefile (lurette/c/16_makefile 1.5 644))
......
......@@ -117,9 +117,9 @@ external random_seed: unit -> int = "sys_random_seed";;
let rec (main : unit -> 'a) =
fun _ ->
Array.iter (fun x -> print_string (x ^ " ")) Sys.argv;
print_string "\n";
flush stdout;
Array.iter (fun x -> output_string stderr (x ^ " ")) Sys.argv;
output_string stderr "\n";
flush stderr;
try
if (arg_nb < 5) then output_string stderr usage
else
......
......@@ -332,6 +332,10 @@ let (run : string -> int) =
let times0 = Unix.times () in
let pid = Unix.create_process prog args Unix.stdin Unix.stdout Unix.stderr in
let _ =
print_string ("\nThe Pid of lurette is " ^ (string_of_int pid) ^ "\n");
flush stdout
in
let (_, status) = Unix.waitpid [Unix.WUNTRACED] pid in
( match status with
Unix.WEXITED i ->
......@@ -351,15 +355,15 @@ let (run : string -> int) =
flush stdout;
0
| Unix.WSIGNALED i ->
print_string ("lurette was killed by signal nb "
output_string stderr("lurette was killed by signal nb "
^ (string_of_int i) ^ ".\n");
flush stdout;
1
flush stderr;
0
| Unix.WSTOPPED i ->
print_string ("lurette was stopped by signal nb "
output_string stderr ("lurette was stopped by signal nb "
^ (string_of_int i) ^ ".\n");
flush stdout;
2
flush stderr;
0
)
type cmd =
......
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