Commit 9a16c8b5 authored by Erwan Jahier's avatar Erwan Jahier

Fix a couple of bugs.

source/gen_stubs_poc.ml:
  Make sure the ocaml floats are casted to _real so that lurette works
  with programs that use floats.

source/lurettetop.ml:
   Make use of Filename.is_relative instead of my buggy way todo it.
parent 5013c382
......@@ -25,3 +25,13 @@ clean:
test_dontgo:
rm -f test.rif0 && \
$(LURETTETOP) --precision 4 -l 50 \
-td 1 -msn onlyroll --sut onlyroll.lus -seed 1 \
--do-not-show-step -ns2c -o test.rif0 giro.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
LTOP=../../../bin/lurettetop
LURETTETOP=$(LTOP) -go --precision 2 --sut heater_control.lus \
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 500 --thick-draw 1 \
......@@ -12,7 +12,7 @@ LURETTETOP=$(LTOP) -go --precision 2 --sut heater_control.lus \
test:
rm -f test.rif0 .lurette_rc
$(LURETTETOP) --output test.rif0 degradable-sensors.luc && \
$(LURETTETOP) -go --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
......@@ -29,3 +29,12 @@ clean:
test_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
......@@ -181,7 +181,7 @@ let (go: module_name -> string -> typedef list -> vn_ct list -> vn_ct list ->
IntT -> ()
| FloatT ->
put ("\n case " ^ (string_of_int i) ^ ": ") ;
put (mod_name ^ "_I_" ^ v ^ "(prg, valf);\n");
put (mod_name ^ "_I_" ^ v ^ "(prg, (_real) valf);\n");
put " break;\n";
| BoolT -> ()
| UT xxx ->
......@@ -212,7 +212,7 @@ let (go: module_name -> string -> typedef list -> vn_ct list -> vn_ct list ->
IntT -> ()
| FloatT ->
put ("\n case " ^ (string_of_int i) ^
": return " ^ v ^ ";\n");
": return (double) " ^ v ^ ";\n");
put " break;\n";
| BoolT -> ()
| UT xxx ->
......
......@@ -293,16 +293,7 @@ let (get_full_path: string -> string -> string) =
let l0 = Util2.string_to_string_list str in
let l1 =
List.map
(fun s ->
if
(Filename.dirname s) = "." && s <> "" &&
not (String.contains s ':') (* ZZZ : under windows, path such as
"u:\lurette\foo.c" are absolute *)
then
(Filename.concat dir s)
else
s
)
(fun s -> if (Filename.is_relative s) then (Filename.concat dir s) else s)
l0
in
List.fold_left (fun acc s -> acc ^ s ^ " ") "" l1
......
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