Skip to content
Snippets Groups Projects
Commit 5c16363d authored by Erwan Jahier's avatar Erwan Jahier
Browse files

non-reg tests: try to remove tests that fail for bad reasons.

For instance, do not launch tests that perform result comparison (via
lurette) on files that contains extern nodes (as they cannot be
executed) or package.  Package do not work because appending the
tested lustre file with the generated oracle as I do is wrong in
presence of package.

Moreover, my current test process is not able to test programs which
main node IOs are not all on the base clock. I have fixed this by
patching the examples.

# of expected passes 		1508 -> 1512
# of unexpected failures	130 -> 84
parent ab082bb2
No related branches found
No related tags found
No related merge requests found
Showing
with 285 additions and 145 deletions
This diff is collapsed.
......@@ -14,25 +14,27 @@ foreach f $ok_files {
set id1 [should_work "without any option" "$lus2lic" "-o $bf.lic $f"]
wait -i $id1
set id2 [should_work "Generate ec code " "$lus2lic" "-ec -o $bf.ec $f"]
wait -i $id2
if { [nonemptyfile "$bf.ec"] } {
set id3 [should_work "Try ec2c on the result" "$ec2c" "-o $bf.c $bf.ec"]
wait -i $id3
catch { exp_close -i $id3 }
# if { [nonemptyfile "$bf.lic"] } {
set id2 [should_work "Generate ec code " "$lus2lic" "-ec -o $bf.ec $f"]
wait -i $id2
if { [nonemptyfile "$bf.ec"] } {
set id3 [should_work "Try ec2c on the result" "$ec2c" "-o $bf.c $bf.ec"]
wait -i $id3
catch { exp_close -i $id3 }
catch { exp_wait -i $id3 } output
}
if { [nonemptyfile "$bf.c"] } {
set id4 [should_work "Try to compare lus2lic -exec and ecexe" "$test_lus2lic_no_node" "$f"]
catch { exp_close -i $id4 }
catch { exp_wait -i $id4 } output
}
if { [nonemptyfile "$bf.c"] && [do_ecexe_vs_exec "$f"] } {
set id4 [should_work "Try to compare lus2lic -exec and ecexe" "$test_lus2lic_no_node" "$f"]
catch { exp_close -i $id4 }
catch { exp_wait -i $id4 } output
}
set id5 [should_work "Generate c code " "$lus2lic" "-2c $f -n $basef"]
wait -i $id5
if { [nonemptyfile "${basef}_${basef}.c"] } {
eval spawn "rm -f a.out"
eval spawn "rm -f a.out"
if { [nonemptyfile "${basef}_${basef}_ext.c"] } {
set id6 [should_work "Check that the generated C code compiles " "gcc ${basef}_${basef}.c ${basef}_${basef}_ext.c ${basef}_${basef}_loop.c"]
} else {
......@@ -41,24 +43,21 @@ foreach f $ok_files {
wait -i $id6
catch { exp_close -i $id6 }
catch { exp_wait -i $id6 } output
# do_test is used to avoid to perforn a comparison on files that contains extern nodes
if { [nonemptyfile a.out] && [contains_extern "$f"] } {
if { [nonemptyfile a.out] && [do_2c_vs_exec "$f"] } {
set id7 [should_work "Try to compare lus2lic -exec and -2c" "$compare_exec_and_2c" "$f"]
catch { exp_close -i $id7 }
catch { exp_wait -i $id7 } output
}
}
}
catch { exp_close -i $id5 }
catch { exp_wait -i $id5 } output
}
catch { exp_close -i $id2 }
catch { exp_wait -i $id2 } output
#}
catch { exp_close -i $id1 }
catch { exp_wait -i $id1 } output
catch { exp_close -i $id2 }
catch { exp_wait -i $id2 } output
}
}
# Programs that should fail
......
testcase ./lus2lic.tests/non-reg.exp completed in 259 seconds
testcase ./lus2lic.tests/progression.exp completed in 0 seconds
node CURRENT(x: bool; y: bool when x)
node CURRENT(x: bool; y: bool)
returns (z: bool);
let
z = current(CURRENT_clk(x,y when x));
tel
node CURRENT_clk(x: bool; y: bool when x)
returns (z: bool when x);
let
z = y;
......
node PCOND(
h0:bool;
hA,hB,hC:bool;
A:int ;
B:int ;
C:bool;
hD:bool;
D:bool )
returns (hX:bool; X:int);
var
hX_on_h0 : bool when h0;
X_on_hX : int when hX_on_h0;
let
hX = current(hX_on_h0);
X = current(X_on_hX);
hX_on_h0, X_on_hX = PCOND_clk(
h0,
hA,hB,hC when h0,
A when hA,
B when hB,
C when hC,
hD when hC,
D when hD);
tel
node PCOND_clk(
h0:bool;
hA,hB,hC:bool when h0;
A:int when hA;
......@@ -8,14 +33,14 @@ node PCOND(
D:bool when hD)
returns (hX:bool when h0; X:int when hX);
let
hX = hC and current(hD) and ( ( hA and
current(current(D)) )
or
( hB and not
current(current(D)) ) );
hX = hC and current(hD) and ( ( hA and
current(current(D)) )
or
( hB and not
current(current(D)) ) );
X = ( if ( hA and current(current(D)) )
then current(A)
else current(B)
) when hX;
X = ( if ( hA and current(current(D)) )
then current(A)
else current(B)
) when hX;
tel
node PCOND1( h0:bool; hA,hB,hC:bool when h0;
A:int when hA; B:int when hB; C:bool when hC;
node PCOND1(h0:bool; hA,hB,hC:bool ;
A:int ; B:int ; C:bool;
hD:bool; D:bool)
returns (hX:bool);
var
hX_on_h0: bool when h0;
hA_on_h0: bool when h0;
hB_on_h0: bool when h0;
hC_on_h0: bool when h0;
hD_on_hC_on_h0: bool when hC_on_h0;
let
hX = current(hX_on_h0);
hA_on_h0 = hA when h0;
hB_on_h0 = hB when h0;
hC_on_h0 = hC when h0;
hD_on_hC_on_h0 = hD when hC_on_h0;
hX_on_h0 = PCOND1_clk(h0,hA when h0,hB when h0,
hC when h0,A when hA_on_h0,B when hB_on_h0,C when hC_on_h0,
hD when hC_on_h0,D when hD_on_hC_on_h0);
tel
node PCOND1_clk(h0:bool; hA,hB,hC:bool when h0;
A:int when hA; B:int when hB; C:bool when hC;
hD:bool when hC; D:bool when hD)
returns (hX:bool when h0);
let
hX = hC and current(hD) and h0 when h0;
hX = hC and current(hD) and h0 when h0;
tel
node X (c: bool; n:int when c)
node X (c: bool; n:int)
returns (d: bool; m: int; p:int);
var
m_on_c :int when c;
p_on_d:int when d;
let
d,m_on_c,p_on_d = X_clk(c, n when c);
m = current (m_on_c);
p = current (p_on_d);
tel
node X_clk (c: bool; n:int when c)
returns (d: bool; m: int when c; p:int when d);
let
m = 0 when c -> pre(m) + n;
......
node X6(n:int; b: bool)
returns
(m: int;
c: bool;
d: bool;
p,u : int;
q,r: int);
var
c': bool when b;
d': bool when c;
p',u' : int when b;
q',r': int when c ;
let
m,c',d',p',u',q',r'= X6_clk(n,b);
c = current(c');
d = current(d');
p = current(p');
u = current(u');
q = current(q');
r = current(r');
tel
node X6_clk(n:int; b: bool)
returns
(m: int;
c: bool when b;
......
node bob(i : bool ) returns (o : bool when i);
node bob(i : bool ) returns (o : bool);
let
o = current(bob_clk(i));
tel
node bob_clk(i : bool ) returns (o : bool when i);
let
o = (true -> pre(false -> pre(i))) when i;
assert (true -> i <> pre(i)) ;
......
node ck2 (c: bool; d: bool when c ; e: int when d)
node ck2 (c: bool; d: bool ; e: int)
returns (n: int);
var
d_on_c : bool when c;
let
d_on_c = d when c;
n = ck2_clk(c, d_on_c , e when d_on_c);
tel
node ck2_clk (c: bool; d: bool when c ; e: int when d)
returns (n: int);
let
n = if c and current(d) then 0 else current(current(e));
......
node ck3 (a: bool; b: bool when a; c: bool when b)
node ck3 (a: bool; b: bool; c: bool)
returns (x: bool);
var
b_on_a : bool when a;
let
b_on_a = b when a;
x = ck3_clk(a,b when a, c when b_on_a);
tel
node ck3_clk (a: bool; b: bool when a; c: bool when b)
returns (x: bool);
let
x = current(current(c));
......
node ck4 (a: int when b; b: bool)
node ck4 (a: int; b: bool)
returns (c: int);
let
c = ck4_clk(a when b, b);
tel
node ck4_clk (a: int when b; b: bool)
returns (c: int);
let
c = current(a);
......
node ck7(a: bool; m,n:int)
returns(q:int; r: int);
var
r_on_a : int when a;
let
q,r_on_a = ck7_clk(a,m,n);
r = current (r_on_a);
tel
node ck7_clk(a: bool; m,n:int)
returns(q:int; r: int when a);
let
q = m+n;
......
......@@ -11,10 +11,17 @@ let
Clock2ms = true -> ( not pre(Clock2ms) ) ;
tel
node clock1_2ms(dummy : bool)
node clock1_2ms_clk(dummy : bool)
returns (Clock1ms: bool; Clock2ms : bool when Clock1ms) ;
let
Clock1ms = Clock1ms_node(dummy);
Clock2ms = Clock2ms_node(dummy when Clock1ms);
tel
node clock1_2ms(dummy : bool) returns (Clock1ms: bool; Clock2ms : bool) ;
var
Clock2ms_on_Clock1ms : bool when Clock1ms;
let
Clock1ms, Clock2ms_on_Clock1ms = clock1_2ms_clk(dummy);
Clock2ms = current( Clock2ms_on_Clock1ms);
tel
node clock_ite(a: bool; b: bool) returns (c: bool when a);
node clock_ite(a: bool; b: bool) returns (c: bool);
var
c_on_a: bool when a;
let
c_on_a = clock_ite_clk(a,b);
c = current(c_on_a);
tel
node clock_ite_clk(a: bool; b: bool) returns (c: bool when a);
-- var
-- z: bool;
......
......@@ -16,8 +16,16 @@ let
acc_out = res + 1;
tel
node filliter(c: bool; i1, i2: int when c) returns (s1, s2: int^NBC when c);
node filliter(c: bool; i1, i2: int) returns (s1, s2: int^NBC);
var
s1_on_c,s2_on_c: int^NBC when c;
let
s1_on_c,s2_on_c = filliter_clk(c, i1 when c, i2 when c);
s1 = current (s1_on_c);
s2 = current (s2_on_c);
tel
node filliter_clk(c: bool; i1, i2: int when c) returns (s1, s2: int^NBC when c);
var x : int^4 when c;
bid1, bid2 : int when c;
......
......@@ -9,7 +9,12 @@ const
b: bool = true;
c: real = 3.14;
node hanane(a1: bool; b1: string2d when a1; c1: tabStruct when a1)
node hanane(a1: bool; b1: string2d; c1: tabStruct)
returns (res: bool);
let
res = current(hanane_clk(a1,b1 when a1, c1 when a1));
tel
node hanane_clk(a1: bool; b1: string2d when a1; c1: tabStruct when a1)
returns (res: bool when a1);
var
h1: int^4;
......
......@@ -10,6 +10,14 @@ let
tel
node lustre_test1_ok
(In1:real;cl1_2:bool;cl1_4:bool; In2:real;cl2_6:bool; In3:bool)
returns (out1:real;Out2:real;Out3:real);
let
out1, Out2, Out3 = lustre_test1_ok_clk(In1,cl1_2,cl1_4, In2,cl2_6 when cl1_2, In3 when cl1_4);
tel
node lustre_test1_ok_clk
(In1:real;cl1_2:bool;cl1_4:bool; In2:real;cl2_6:bool when cl1_2; In3:bool when cl1_4)
returns (out1:real;Out2:real;Out3:real);
var Sum:real;
......
node multiclock ( x, y: int; c: bool; z: int when c )
node multiclock ( x, y: int; c: bool; z: int )
returns ( s: int);
var
h: bool when c ;
u: int when h ;
let
s = current(multiclock_clk ( x, y; c; z when c ));
tel
node multiclock_clk ( x, y: int; c: bool; z: int when c )
returns ( s: int when c);
var
h: bool when c ;
......
......@@ -5,7 +5,7 @@ using the compiler : Simulink to Lustre CURRENT VERSION!!!
/**************** The MainNode node of the model ****************/
node MainNode (In3:real)
node sample_time_change_MainNode (In3:real)
returns (Out2:real);
var cl1_4_2, cl1_12_3 :bool;
Out2_ :real when cl1_4_2 ;
......@@ -18,6 +18,7 @@ tel
/****************** All the nodes of the Model ******************/
node sample_time_change (cl1_4_2, cl1_12_3:bool; In3:real when cl1_12_3)
returns (Out2:real when cl1_4_2);
var Unit_Delay1:real when cl1_12_3;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment