Commit bed715d5 authored by erwan's avatar erwan
Browse files

test: fix broken tests (playing on whether -knc is the default or not)

parent b0be78df
(** Time-stamp: <modified the 06/05/2022 (at 17:43) by Erwan Jahier> *)
(** Time-stamp: <modified the 11/05/2022 (at 17:01) by Erwan Jahier> *)
(* Replace structures and arrays by as many variables as necessary.
Since structures can be nested, it might be a lot of new variables...
......@@ -425,7 +425,9 @@ and (break_tuple : Lxm.t -> left list -> val_exp -> Lic.eq_info srcflagged list)
in
let msg = Printf.sprintf
"error: expression \n %s\n cannot be broken \n %s (%d)
should have the same arity as\n%s(%d)"
should have the same arity as\n%s(%d)
You may want to try to compile with -rnc (a.k.a. --remove-nested-calls)"
(LicDump.string_of_val_exp_eff false ve)
(vel2str ve1l) l1 (vel2str ve2l) l2
in
......
(* Time-stamp: <modified the 05/05/2022 (at 13:39) by Erwan Jahier> *)
(* Time-stamp: <modified the 12/05/2022 (at 09:55) by Erwan Jahier> *)
(*
Le manager d'argument adapt de celui de lutin, plus joli
N.B. solution un peu batarde : les options sont stockes, comme avant, dans Global,
......@@ -57,6 +57,7 @@ type global_opt = {
mutable expand_enums : enum_mode;
mutable inline_iterator : bool;
mutable one_op_per_equation : bool;
mutable one_op_per_equation_set : bool; (* to be able to give priority to cli option *)
mutable when_on_ident : bool;
mutable no_when_not : bool;
mutable no_prefix : bool;
......@@ -81,7 +82,8 @@ let (global_opt:global_opt) =
lv4 = false;
kcg = false;
ec = false;
one_op_per_equation = false;
one_op_per_equation = true;
one_op_per_equation_set = false;
inline_iterator = false;
when_on_ident = false;
no_when_not = false;
......@@ -242,6 +244,7 @@ let (mkopt : t -> string list -> ?doc_level:doc_level -> ?arg:string -> Arg.spec
(* utils *)
let set_v4_options opt =
global_opt.lv4 <- true;
if not global_opt.one_op_per_equation_set then global_opt.one_op_per_equation <- false;
(match global_opt.expand_enums with
| AsEnum -> global_opt.expand_enums <- AsConst; (* only override the default *)
| AsInt | AsConst | AsBool -> ());
......@@ -264,7 +267,7 @@ let set_ec_options opt =
let set_c_options opt =
opt.gen_c <- true;
global_opt.one_op_per_equation <- true;
if not global_opt.one_op_per_equation_set then global_opt.one_op_per_equation <- true;
(match global_opt.expand_enums with
| AsEnum -> global_opt.expand_enums <- AsInt;
(* only override the default in this case *)
......@@ -294,7 +297,7 @@ let mkoptab (opt:t) : unit = (
["-exec"]
(Arg.Unit (fun _ ->
opt.exec <- true;
global_opt.one_op_per_equation <- true;
if not global_opt.one_op_per_equation_set then global_opt.one_op_per_equation <- true;
global_opt.expand_enums <- AsInt;
))
["Interpret the program using RIF conventions for I/O (force -eei)"]
......@@ -328,13 +331,13 @@ let mkoptab (opt:t) : unit = (
mkopt opt ~doc_level:Dev
["-knc"; "--keep-nested-calls"]
(Arg.Unit (fun _ -> global_opt.one_op_per_equation <- false))
(Arg.Unit (fun _ -> global_opt.one_op_per_equation_set <- true; global_opt.one_op_per_equation <- false))
["Keep nested calls (inhibited by -en). By default, only one node ";
"per equation is generated (ignored with -exec or -2c*)"]
;
mkopt opt ~doc_level:Dev
["-rnc"; "--remove-nested-calls"]
(Arg.Unit (fun _ -> global_opt.one_op_per_equation <- true))
(Arg.Unit (fun _ -> global_opt.one_op_per_equation_set <- true; global_opt.one_op_per_equation <- true))
["Remove nested calls"]
;
mkopt opt ~doc_level:Advanced
......@@ -587,7 +590,9 @@ let mkoptab (opt:t) : unit = (
;
mkopt opt ~doc_level:Dev
["--gen-autotest"]
(Arg.Unit (fun () -> global_opt.one_op_per_equation <- true;global_opt.gen_autotest <- true))
(Arg.Unit (fun () ->
if not global_opt.one_op_per_equation_set then global_opt.one_op_per_equation <- true;
global_opt.gen_autotest <- true))
["Generate a Lutin Stimulator and a Lustre oracle to compare the ";
"result of 2 Lustre compilers"]
;
......
(* Time-stamp: <modified the 05/05/2022 (at 13:38) by Erwan Jahier> *)
(* Time-stamp: <modified the 12/05/2022 (at 09:53) by Erwan Jahier> *)
type enum_mode =
AsInt (* translate enums into int (for rif-friendlyness *)
......@@ -62,6 +62,7 @@ type global_opt = {
mutable expand_enums : enum_mode;
mutable inline_iterator : bool;
mutable one_op_per_equation : bool;
mutable one_op_per_equation_set : bool; (* to be able to give priority to cli option *)
mutable when_on_ident : bool;
mutable no_when_not : bool;
mutable no_prefix : bool;
......
==> lus2lic0.sum <==
Test run by jahier on Thu May 5 17:35:18
Test run by jahier on Thu May 12 10:47:08
Native configuration is x86_64-pc-linux-gnu
=== lus2lic0 tests ===
......@@ -66,7 +66,7 @@ XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/lecte
XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/s.lus
==> lus2lic1.sum <==
Test run by jahier on Thu May 5 17:35:19
Test run by jahier on Thu May 12 10:47:09
Native configuration is x86_64-pc-linux-gnu
=== lus2lic1 tests ===
......@@ -112,6 +112,11 @@ PASS: sh Gyroscope.sh
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c Gyroscope.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en Gyroscope.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang Gyroscope.lus {}
PASS: ./lus2lic {-2c Gyroscope2.lus -n Gyroscope2}
PASS: sh Gyroscope2.sh
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c Gyroscope2.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en Gyroscope2.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang Gyroscope2.lus {}
PASS: ./lus2lic {-2c aa.lus -n aa}
PASS: sh aa.sh
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c aa.lus {}
......@@ -621,7 +626,7 @@ PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multipar.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en multipar.lus {}
==> lus2lic2.sum <==
Test run by jahier on Thu May 5 17:39:31
Test run by jahier on Thu May 12 10:51:44
Native configuration is x86_64-pc-linux-gnu
=== lus2lic2 tests ===
......@@ -849,16 +854,16 @@ PASS: sh ply01.sh
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c ply01.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en ply01.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang ply01.lus {}
PASS: ./lus2lic {-2c ply02.lus -n ply02}
PASS: ./lus2lic -rnc {-2c ply02.lus -n ply02}
PASS: sh ply02.sh
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c ply02.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en ply02.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang ply02.lus {}
PASS: ./lus2lic {-2c ply03.lus -n ply03}
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c ply02.lus { -rnc}
PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en ply02.lus { -rnc}
PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang ply02.lus { -rnc}
PASS: ./lus2lic -rnc {-2c ply03.lus -n ply03}
PASS: sh ply03.sh
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c ply03.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en ply03.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang ply03.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c ply03.lus { -rnc}
PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en ply03.lus { -rnc}
PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang ply03.lus { -rnc}
PASS: ./lus2lic {-2c polymorphic_pack.lus -n polymorphic_pack}
PASS: ./lus2lic {-2c poussoir.lus -n poussoir}
PASS: sh poussoir.sh
......@@ -920,6 +925,7 @@ PASS: sh redoptest.sh
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c redoptest.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en redoptest.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang redoptest.lus {}
PASS: ./lus2lic {-2c remplissage.lus -n remplissage}
PASS: ./lus2lic {-2c rs.lus -n rs}
PASS: sh rs.sh
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c rs.lus {}
......@@ -1005,7 +1011,7 @@ PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en testCA.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang testCA.lus {}
PASS: ./lus2lic {-2c testCapt.lus -n testCapt}
PASS: ./lus2lic {-2c testPilote.lus -n testPilote}
PASS: ./lus2lic {-2c test_Int.lus -n test_Int}
PASS: ./lus2lic -rnc {-2c test_Int.lus -n test_Int}
PASS: ./lus2lic {-2c test_arrow.lus -n test_arrow}
PASS: sh test_arrow.sh
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c test_arrow.lus {}
......@@ -1061,11 +1067,11 @@ PASS: sh test_node_expand2.sh
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c test_node_expand2.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en test_node_expand2.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang test_node_expand2.lus {}
PASS: ./lus2lic {-2c test_poly.lus -n test_poly}
PASS: ./lus2lic -rnc {-2c test_poly.lus -n test_poly}
PASS: sh test_poly.sh
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c test_poly.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en test_poly.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang test_poly.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c test_poly.lus { -rnc}
PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en test_poly.lus { -rnc}
PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang test_poly.lus { -rnc}
PASS: ./lus2lic {-2c test_sqrt.lus -n test_sqrt}
PASS: ./lus2lic {-2c test_struct.lus -n test_struct}
PASS: sh test_struct.sh
......@@ -1165,7 +1171,7 @@ PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en zzz2.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang zzz2.lus {}
==> lus2lic3.sum <==
Test run by jahier on Thu May 5 17:44:13
Test run by jahier on Thu May 12 10:56:36
Native configuration is x86_64-pc-linux-gnu
=== lus2lic3 tests ===
......@@ -1205,7 +1211,10 @@ PASS: ./lus2lic {} {-lic -o Gyroscope.lic Gyroscope.lus -n Gyroscope}
PASS: ./lus2lic {-ec -o Gyroscope.ec Gyroscope.lus -n Gyroscope}
PASS: ./myec2c {-o Gyroscope.c Gyroscope.ec}
PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node Gyroscope.lus {}
FAIL: without any option: ./lus2lic {} {-lic -o Gyroscope2.lic Gyroscope2.lus -n Gyroscope2}
PASS: ./lus2lic {} {-lic -o Gyroscope2.lic Gyroscope2.lus -n Gyroscope2}
PASS: ./lus2lic {-ec -o Gyroscope2.ec Gyroscope2.lus -n Gyroscope2}
PASS: ./myec2c {-o Gyroscope2.c Gyroscope2.ec}
PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node Gyroscope2.lus {}
PASS: ./lus2lic {} {-lic -o aa.lic aa.lus -n aa}
PASS: ./lus2lic {-ec -o aa.ec aa.lus -n aa}
PASS: ./myec2c {-o aa.c aa.ec}
......@@ -1677,7 +1686,7 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node multipar.lus {}
==> lus2lic4.sum <==
Test run by jahier on Thu May 5 17:45:12
Test run by jahier on Thu May 12 10:58:05
Native configuration is x86_64-pc-linux-gnu
=== lus2lic4 tests ===
......@@ -1880,14 +1889,14 @@ PASS: ./lus2lic {} {-lic -o ply01.lic ply01.lus -n ply01}
PASS: ./lus2lic {-ec -o ply01.ec ply01.lus -n ply01}
PASS: ./myec2c {-o ply01.c ply01.ec}
PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node ply01.lus {}
PASS: ./lus2lic {} {-lic -o ply02.lic ply02.lus -n ply02}
PASS: ./lus2lic { -rnc} {-lic -o ply02.lic ply02.lus -n ply02}
PASS: ./lus2lic {-ec -o ply02.ec ply02.lus -n ply02}
PASS: ./myec2c {-o ply02.c ply02.ec}
PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node ply02.lus {}
PASS: ./lus2lic {} {-lic -o ply03.lic ply03.lus -n ply03}
PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node ply02.lus { -rnc}
PASS: ./lus2lic { -rnc} {-lic -o ply03.lic ply03.lus -n ply03}
PASS: ./lus2lic {-ec -o ply03.ec ply03.lus -n ply03}
PASS: ./myec2c {-o ply03.c ply03.ec}
PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node ply03.lus {}
PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node ply03.lus { -rnc}
PASS: ./lus2lic {} {-lic -o polymorphic_pack.lic polymorphic_pack.lus -n polymorphic_pack}
PASS: ./lus2lic {-ec -o polymorphic_pack.ec polymorphic_pack.lus -n polymorphic_pack}
PASS: ./myec2c {-o polymorphic_pack.c polymorphic_pack.ec}
......@@ -1939,7 +1948,9 @@ PASS: ./lus2lic {} {-lic -o redoptest.lic redoptest.lus -n redoptest}
PASS: ./lus2lic {-ec -o redoptest.ec redoptest.lus -n redoptest}
PASS: ./myec2c {-o redoptest.c redoptest.ec}
PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node redoptest.lus {}
FAIL: without any option: ./lus2lic {} {-lic -o remplissage.lic remplissage.lus -n remplissage}
PASS: ./lus2lic {} {-lic -o remplissage.lic remplissage.lus -n remplissage}
PASS: ./lus2lic {-ec -o remplissage.ec remplissage.lus -n remplissage}
PASS: ./myec2c {-o remplissage.c remplissage.ec}
PASS: ./lus2lic {} {-lic -o rs.lic rs.lus -n rs}
PASS: ./lus2lic {-ec -o rs.ec rs.lus -n rs}
PASS: ./myec2c {-o rs.c rs.ec}
......@@ -2019,7 +2030,7 @@ PASS: ./myec2c {-o testCapt.c testCapt.ec}
PASS: ./lus2lic {} {-lic -o testPilote.lic testPilote.lus -n testPilote}
PASS: ./lus2lic {-ec -o testPilote.ec testPilote.lus -n testPilote}
PASS: ./myec2c {-o testPilote.c testPilote.ec}
PASS: ./lus2lic {} {-lic -o test_Int.lic test_Int.lus -n test_Int}
PASS: ./lus2lic { -rnc} {-lic -o test_Int.lic test_Int.lus -n test_Int}
PASS: ./lus2lic {-ec -o test_Int.ec test_Int.lus -n test_Int}
PASS: ./myec2c {-o test_Int.c test_Int.ec}
PASS: ./lus2lic {} {-lic -o test_arrow.lic test_arrow.lus -n test_arrow}
......@@ -2074,10 +2085,10 @@ PASS: ./lus2lic {} {-lic -o test_node_expand2.lic test_node_expand2.lus -n test_
PASS: ./lus2lic {-ec -o test_node_expand2.ec test_node_expand2.lus -n test_node_expand2}
PASS: ./myec2c {-o test_node_expand2.c test_node_expand2.ec}
PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node test_node_expand2.lus {}
PASS: ./lus2lic {} {-lic -o test_poly.lic test_poly.lus -n test_poly}
PASS: ./lus2lic { -rnc} {-lic -o test_poly.lic test_poly.lus -n test_poly}
PASS: ./lus2lic {-ec -o test_poly.ec test_poly.lus -n test_poly}
PASS: ./myec2c {-o test_poly.c test_poly.ec}
PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node test_poly.lus {}
PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node test_poly.lus { -rnc}
PASS: ./lus2lic {} {-lic -o test_sqrt.lic test_sqrt.lus -n test_sqrt}
PASS: ./lus2lic {-ec -o test_sqrt.ec test_sqrt.lus -n test_sqrt}
PASS: ./myec2c {-o test_sqrt.c test_sqrt.ec}
......@@ -2175,36 +2186,36 @@ PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang multipar.lus {}
=== lus2lic1 Summary ===
# of expected passes 544
# of expected passes 549
==> lus2lic2.sum <==
=== lus2lic2 Summary ===
# of expected passes 528
# of expected passes 529
# of unexpected failures 4
==> lus2lic3.sum <==
=== lus2lic3 Summary ===
# of expected passes 489
# of unexpected failures 9
# of expected passes 493
# of unexpected failures 8
# of unresolved testcases 1
==> lus2lic4.sum <==
=== lus2lic4 Summary ===
# of expected passes 470
# of unexpected failures 6
# of expected passes 473
# of unexpected failures 5
===============================
# Total number of failures: 19
# Total number of failures: 17
lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 1 seconds
lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 252 seconds
lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 282 seconds
lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 59 seconds
lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 274 seconds
lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 292 seconds
lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 89 seconds
lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 43 seconds
* Ref time:
210.80user 71.32system 10:37.07elapsed 44%CPU (0avgtext+0avgdata 77252maxresident)k
197768inputs+409560outputs (560major+21705367minor)pagefaults 0swaps
234.87user 64.78system 11:39.53elapsed 42%CPU (0avgtext+0avgdata 73968maxresident)k
7627992inputs+462696outputs (22736major+19473366minor)pagefaults 0swaps
* Quick time (-j 4):
-- nonreg: -rnc
(* ne passe pas DoNotPoly ... *)
node truc = map<<+,42>>;
(* PASSE DoNotPoly en spécialisant truc ! ... *)
node ply02(x,y: int) returns (o: int^42);
function ply02(x,y: int) returns (o: int^42);
let
o = if (x < y) then 0^42 else truc(x^42, y^42);
tel
-- nonreg: -rnc
function ply03(x,y: int) returns (o: int^42);
let
o = if (x < y) then 0^42 else map<<+,42>>(x^42, y^42);
......
-- nonreg: -rnc
model IntM
needs
const n:int;
......
-- nonreg: -rnc
node truc = map<<+,42>>;
......
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