Commit ecf174c3 authored by Erwan Jahier's avatar Erwan Jahier
Browse files

Fix a bug in the "lurette calls luciole if needed" mode, introduced in...

Fix a bug in the "lurette calls luciole if needed" mode, introduced in 459c1713.

Indeed, I've change the definition of var.t so that they are by
default sorted by their creation date, and in luc2luciole, I was
suposing they were ordered by names...

BTW, I add a test in the non-reg suite.
parent f6e16ee4
......@@ -15,6 +15,7 @@ test-lucky:
cd lucky/C && make test ;
cd lucky/lustre && make test
cd lucky/luciole && make test ;
cd xlurette/call-luciole && make test ;
cd ocaml/xlurette && make test ;
ifneq ($(HOST_TYPE),mac)
# cd xlurette/Sildex/ && make test ;
......
(* Time-stamp: <modified the 18/08/2010 (at 11:02) by Erwan Jahier> *)
(* Time-stamp: <modified the 13/12/2010 (at 17:16) by Erwan Jahier> *)
......@@ -30,7 +30,7 @@ let (step : Value.OfIdent.t -> Value.OfIdent.t)=
| _ -> assert false
in
pre_res := res;
Value.OfIdent.from_list [ ("Heat_on", B(res)) ]
Value.OfIdent.from_list [ ("Heat_on", B(res)) ]
let (step_try : Value.OfIdent.t -> Value.OfIdent.t)=
fun l ->
......
LTOP=/usr/local/tools/lustre-misc/lurette/i386-linux-gcc3/bin/lurettetop
LTOP=../../../$(HOSTTYPE)/bin/lurettetop
LURETTETOP=$(LTOP) --precision 2 --sut heater_control.lus \
--main-sut-node heater_control --oracle heater_control.lus \
--main-oracle-node not_a_sauna --sut-compiler verimag \
--oracle-compiler verimag --test-length 1 --thick-draw 1 \
--draw-inside 0 --draw-edges 0 --draw-vertices 0 --draw-all-vertices \
--step-mode Inside --local-var --no-sim2chro --seed 3 \
--step-mode Inside --local-var --no-sim2chro --seed 3 \
--do-not-show-step
test:
rm -f test.rif0 .lurette_rc
$(LURETTETOP) -go --output test.rif0 heater_control_env.luc && \
rm -f test.rif .lurette_rc
$(LURETTETOP) -go --output test.rif heater_control_env.luc && \
make clean
utest:
cp test.rif test.rif.exp
clean:
rm -rf *.ec *.log *~ .*~ *.o *rif0 *rif Data *.pp_luc *.plot *.gp
test_dontgo:
dontgo:
rm -f test.rif0 .lurette_rc
$(LURETTETOP) --output test.rif0 degradable-sensors.luc && \
grep -v "lurette chronogram" test.rif0 | \
grep -v "The execution lasted"| sed -e "s/^M//" > test.rif &&\
rm -f test.res && diff -u -i test.rif.exp test.rif > test.res
[ ! -s test.res ] && make clean
$(LURETTETOP) heater_control_env.luc
......@@ -134,7 +134,7 @@ let rec (main : unit -> 'a) =
in
let luciole_outputs = List.sort compare luciole_outputs in
let luciole_inputs = List.sort compare luciole_inputs in
let from_lutin = Util.get_extension flag.env = ".lut" in
let from_lutin = Util.get_extension flag.env = ".lut" in
let sut_str = Filename.basename (Filename.chop_extension flag.sut_header) in
Luciole.gen_stubs true from_lutin sut_str luciole_outputs luciole_inputs
......
......@@ -66,9 +66,9 @@ let (gen_stubs : bool -> bool -> string -> vn_ct list -> vn_ct list -> unit) =
let pn s = p (s^"\n") in
let d2r = function
| "_real" -> "real"
| "_real" | "real" | "float" | "double" -> "real"
| "_bool" | "bool" -> "bool"
| "_int" -> "int"
| "_bool" -> "bool"
| e -> "int"
in
let vn_ct_to_array (vn, ct) =
......
......@@ -105,8 +105,9 @@ let random_seed () =
let luciole_pid = ref 0
let lurette_exit i =
if options.luciole_mode & !luciole_pid <> 0 then (Unix.kill !luciole_pid Sys.sigkill);
output_msg (Printf.sprintf "Lurette exit with code %d.\n" i);
if !luciole_pid <> 0 then (Unix.kill !luciole_pid Sys.sigkill);
output_msg (Printf.sprintf "Try killing process %d (simec).\n" !luciole_pid);
if i<>0 then output_msg (Printf.sprintf "Lurette exit with code %d.\n" i);
exit i
let print_failure i o oo l t locals rif =
......@@ -630,9 +631,10 @@ and
let luciole_outputs2: Exp.var list = list_minus sut_in init_state.s.out_vars in
let luciole_outputs = luciole_outputs1@luciole_outputs2 in
let compare_var_by_name v1 v2 = compare (Var.name v1) (Var.name v2) in
let luciole_inputs = list_minus luciole_inputs luciole_outputs in
let luciole_outputs = List.sort compare luciole_outputs
and luciole_inputs = List.sort compare luciole_inputs
let luciole_outputs = List.sort compare_var_by_name luciole_outputs
and luciole_inputs = List.sort compare_var_by_name luciole_inputs
in
let _ = if options.luciole_mode then (
debug_msg ("luciole_inputs: "^ (String. concat "," (List.map Var.name luciole_inputs ))^"\n");
......@@ -656,19 +658,22 @@ and
match Var.typ var with
| Type.BoolT ->
if str = "t" then Value.B(true) else if str = "f" then Value.B(false) else (
output_msg2 rif ("Can not convert into a bool:'"^str^"'\n");
output_msg2 rif ("read_luciole_outputs:Can not convert the value of "
^(Var.name var)^" into a bool:'"^str^"'\n");
lurette_exit 2
)
| Type.IntT -> (
try Value.N(Value.I(int_of_string str))
with _ ->
output_msg2 rif ("Can not convert into an int:'"^str^"'\n");
output_msg2 rif ("read_luciole_outputs:Can not convert the value of "^
(Var.name var)^" into an int:'"^str^"'\n");
lurette_exit 2
)
| Type.FloatT -> (
try Value.N(Value.F(float_of_string str))
with _ ->
output_msg2 rif ("Can not convert into a float:'"^str^"'\n");
output_msg2 rif ("read_luciole_outputs:Can not convert the value of "
^(Var.name var)^"into a float:'"^str^"'\n");
lurette_exit 2)
| Type.UT _ -> assert false
in
......@@ -712,6 +717,8 @@ and
let close_me () = (
flush stdout;
flush rif;
close_out luciole_oc;
close_in luciole_ic;
close_out rif;
debug_msg "Killing luciole process...\n";
if options.luciole_mode then (Unix.kill !luciole_pid Sys.sigkill)
......@@ -978,7 +985,7 @@ and (main_loop :
output_msg ("The generated data can be found in the file " ^
options.output ^ "\n");
output_msg2 rif time_msg;
next_state
lurette_exit 0
)
......
......@@ -5,4 +5,4 @@ dro_file=$1
ppid=$2
trap 'echo "Luciole process killed: kills it father process ($ppid) " ; kill -9 $ppid' 0 1 2 15
simec $dro_file
exec simec $dro_file
Supports Markdown
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