Commit 78346cd9 authored by Erwan Jahier's avatar Erwan Jahier

Fix the non-regression tests that were broken for a month !

parent e46a79dc
......@@ -44,7 +44,6 @@ test-lutin:
cd lutin/luciole && make test ;
cd lutin/lustre && make test ;
cd lutin/C && make test;
cd lutin/oracle && make test;
echo "All lutin tests ran correctly."
# problem ~
......
......@@ -15,7 +15,7 @@ solve :
draw...
lucky_draw
Les solutions sont :
y = 5471, x = -7433
y = 5277, x = -7982
y = -2262, x = -9252
x = -10000, y = -10000
y = -212860406, x = -229431731
y = 5070364, x = -133059749
y = -168793659, x = -268435456
x = -268435456, y = -268435456
......@@ -20,8 +20,8 @@ x=19.4213686456
x=16.0742588076
x=20.
x=20.
Z=6398 y=-82 x=53 z=79
Z=9741 y=-147 x=99 z=98
Z=10000 x=99 y=99 z=-148
Z=-10000 x=99 y=99 z=-148
Z=-129056160 y=-82 x=53 z=79
Z=46720041 y=-147 x=99 z=98
Z=268435455 x=99 y=99 z=-148
Z=-268435456 x=99 y=99 z=-148
Z=f x=t y=f
......@@ -20,8 +20,8 @@ x=19.4213686456
x=16.0742588076
x=20.
x=20.
Z=6398 y=-82 x=53 z=79
Z=9741 y=-147 x=99 z=98
Z=10000 x=99 y=99 z=-148
Z=-10000 x=99 y=99 z=-148
Z=-129056160 y=-82 x=53 z=79
Z=46720041 y=-147 x=99 z=98
Z=268435455 x=99 y=99 z=-148
Z=-268435456 x=99 y=99 z=-148
Z=f x=t y=f
LINKER= $(CC)
EXE=
DEBUG=-D_DEBUG
DEBUG=
DEBUG=-D_DEBUG
CFLAGS = \
-L../../../lib \
-I../../../include $(DEBUG) -D_LAUNCH_LUTIN_AUTOMATICALLY
-I../../../include $(DEBUG)
LIBS = -lluc4c_nc -llucky_nc -lgmp -lm -ldl -lstdc++
LUC2C=../../../$(HOSTTYPE)/bin/lutin --2c-4c -seed 42
LUC2CSOCK=../../../$(HOSTTYPE)/bin/lutin --2c-4c-socks 127.0.0.1 -seed 42
CALLVIASOCKET=../../../$(HOSTTYPE)/bin/call-via-socket -addr 127.0.0.1 -port 2000
LUTIN=../../../$(HOSTTYPE)/bin/lutin -seed 42 -only-outputs -exe
ifeq ($(HOSTTYPE),mac)
LINKER=g++ -g
......@@ -21,7 +23,7 @@ ifneq (,$(findstring win32,$(HOSTTYPE)))
LINKER=$(CC)
CFLAGS = \
-L../../../lib \
-I../../../include -D_WIN32 -D_WINSOCK $(DEBUG) -D_LAUNCH_LUTIN_AUTOMATICALLY \
-I../../../include -D_WIN32 -D_WINSOCK $(DEBUG) \
-Winline -Wimplicit-function-declaration
LIBS = -lluc4c_nc -llucky_nc -lgmp -lws2_32 -lm -lstdc++ -lole32
......@@ -81,7 +83,8 @@ ifeq ($(HOSTTYPE),win32)
foo$(EXE)
else
./foo > test1.rif
rm -f test1.res && diff -B -u -i test1.rif.exp test1.rif > test1.res
rm -f test1.res && diff -B -u -i test1.rif.exp test1.rif > test1.res || true
cat test1.res
[ ! -s test1.res ] && make clean
endif
......@@ -91,8 +94,10 @@ utest1:
test2: clean foo-sock$(EXE)
$(CALLVIASOCKET) "$(LUTIN) foo.lut" &
./foo-sock$(EXE) > test2.rif
rm -f test2.res && diff -B -u -i test2.rif.exp test2.rif > test2.res
rm -f test2.res && diff -B -u -i test2.rif.exp test2.rif > test2.res || true
cat test2.res
[ ! -s test2.res ] && make clean
......
......@@ -7,24 +7,28 @@ void foo_O_x(foo_ctx* ctx, _int v) { ctx->_x = v; };
void foo_O_y(foo_ctx* ctx, _bool v) { ctx->_y = v; };
void foo_O_z(foo_ctx* ctx, _real v) { ctx->_z = v; };
// a little main that calls the foo.lut program
int main(){
int i = 0;
foo_ctx* ctx;
#ifdef _DEBUG
fp = fopen("debug.log", "w");
#endif
ctx = foo_new_ctx(NULL);
printf("#inputs \"a\":int \"b\":bool \"c\":real\n");
printf("#outputs \"x\":int \"y\":bool \"z\":real\n");
for (i=1; i<10; i++){
for (i=1; i<10; i++){
// setting inputs
foo_I_a(ctx, i);
foo_I_b(ctx, i % 2);
foo_I_c(ctx, (_real) i);
foo_step(ctx);
printf("# step %d \n%d %d %f #outs %d %d %f\n",
printf("# step %d \n%d %d %f #outs %d %d %f\n",
i, ctx->_a, ctx->_b, ctx->_c, ctx->_x, ctx->_y, ctx->_z);
}
return 0;
......
......@@ -2,22 +2,22 @@
#inputs "a":int "b":bool "c":real
#outputs "x":int "y":bool "z":real
# step 0
10 0 20.000000 #outs 6 0 16.278233
10 0 20.000000 #outs 0 0 0.000000
# step 1
10 0 20.000000 #outs 6 1 21.603283
10 0 20.000000 #outs 12 0 20.694150
# step 2
10 0 20.000000 #outs 9 1 17.399245
10 0 20.000000 #outs 7 1 20.130376
# step 3
10 0 20.000000 #outs 13 1 19.172617
10 0 20.000000 #outs 8 0 22.113411
# step 4
10 0 20.000000 #outs 11 0 19.251183
10 0 20.000000 #outs 10 0 18.662404
# step 5
10 0 20.000000 #outs 8 1 15.253516
10 0 20.000000 #outs 14 0 20.554576
# step 6
10 0 20.000000 #outs 7 0 21.425417
10 0 20.000000 #outs 9 1 18.146439
# step 7
10 0 20.000000 #outs 9 1 17.336461
10 0 20.000000 #outs 13 0 20.734679
# step 8
10 0 20.000000 #outs 7 0 19.618259
10 0 20.000000 #outs 7 0 24.963124
# step 9
10 0 20.000000 #outs 14 0 16.016641
10 0 20.000000 #outs 10 0 19.399387
Waiting for someone to connect on 127.0.0.1:2000
#inputs "a":int "b":bool "c":real
#outputs "x":int "y":bool "z":real
# step 1
......
......@@ -69,13 +69,15 @@ run: $(OBJDIR)/$(MAIN).$(DLEXT)
test1: clean $(OBJDIR)/$(MAIN).$(DLEXT)
../../../$(HOSTTYPE)/bin/lutin call_external_c_code.lut -m Fun_Call -L libm.so -L obj/foo.so \
-l 10 -seed 834966010 | sed -e "s/^M//" | grep -v " Version" > test1.rif
rm -f test1.res && diff -u -i -B test1.rif.exp test1.rif > test1.res
rm -f test1.res && diff -u -i -B test1.rif.exp test1.rif > test1.res || true
cat test1.res
[ ! -s test1.res ] && make clean
test2:
echo "1.0 1.0" | ../../../$(HOSTTYPE)/bin/lutin -l 1 -L libm.so polar.lut -m cartesian \
echo "1.0 1.0" | ../../../$(HOSTTYPE)/bin/lutin -exe -l 1 -L libm.so polar.lut -m cartesian \
-seed 1 | grep -v " Version" > test2.rif
rm -f test2.res && diff -u -i -B test2.rif.exp test2.rif > test2.res
rm -f test2.res && diff -u -i -B test2.rif.exp test2.rif > test2.res || true
cat test2.res
[ ! -s test2.res ] && make clean
test: test1 test2
......
......@@ -2,24 +2,24 @@
#inputs
#outputs "f1":real "f2":real "i":int
#step 1
#outs 87.36 0.84 9
#outs 87.36 0.84 9
#step 2
#outs 61.26 0.08 4
#outs 61.26 0.08 4
#step 3
#outs 31.94 1.00 8
#outs 31.94 1.00 8
#step 4
#outs 64.31 -0.59 8
#outs 64.31 -0.59 8
#step 5
#outs 96.69 0.99 10
#outs 96.69 0.99 10
#step 6
#outs 66.59 -0.40 2
#outs 66.59 -0.40 2
#step 7
#outs 15.51 0.95 3
#outs 15.51 0.95 3
#step 8
#outs 77.29 -0.72 8
#outs 77.29 -0.72 8
#step 9
#outs 26.98 0.59 3
#outs 26.98 0.59 3
#step 10
#outs 24.66 -0.89 6
#outs 24.66 -0.89 6
#end
......@@ -2,6 +2,5 @@
#inputs "r":real "alpha":real
#outputs "x":real "y":real
#step 1
#outs 0.54 0.84
#end
1.0 1.0#outs 0.54 0.84
# Simulation reached max steps.
......@@ -2,10 +2,10 @@
#inputs
#outputs "a":int "b":int "c":int "d":int "e":int
#step 1
#outs 3684 505 -5344 -3651 640
#outs 76431400 178933346 -252774087 42646446 70428056
#step 2
#outs 7650 -4464 7322 1929 -389
#outs 66858957 121525507 -216979632 -92014707 -117262357
#step 3
#outs 4084 -4581 8533 1697 -843
#outs 233203708 -233548293 253529173 -67693723 125709337
#step 4
# Simulation ended normally.
......@@ -2,204 +2,204 @@
#inputs
#outputs "a":bool
#step 1
#outs t
#outs t
#step 2
#outs t
#outs t
#step 3
#outs t
#outs t
#step 4
#outs t
#outs t
#step 5
#outs t
#outs t
#step 6
#outs t
#outs t
#step 7
#outs t
#outs t
#step 8
#outs t
#outs t
#step 9
#outs t
#outs t
#step 10
#outs t
#outs t
#step 11
#outs t
#outs t
#step 12
#outs f
#outs f
#step 13
#outs f
#outs f
#step 14
#outs f
#outs f
#step 15
#outs f
#outs f
#step 16
#outs f
#outs f
#step 17
#outs f
#outs f
#step 18
#outs f
#outs f
#step 19
#outs f
#outs f
#step 20
#outs f
#outs f
#step 21
#outs f
#outs f
#step 22
#outs f
#outs f
#step 23
#outs f
#outs f
#step 24
#outs f
#outs f
#step 25
#outs f
#outs f
#step 26
#outs f
#outs f
#step 27
#outs f
#outs f
#step 28
#outs f
#outs f
#step 29
#outs f
#outs f
#step 30
#outs f
#outs f
#step 31
#outs f
#outs f
#step 32
#outs f
#outs f
#step 33
#outs f
#outs f
#step 34
#outs f
#outs f
#step 35
#outs f
#outs f
#step 36
#outs f
#outs f
#step 37
#outs f
#outs f
#step 38
#outs f
#outs f
#step 39
#outs f
#outs f
#step 40
#outs f
#outs f
#step 41
#outs f
#outs f
#step 42
#outs f
#outs f
#step 43
#outs f
#outs f
#step 44
#outs f
#outs f
#step 45
#outs f
#outs f
#step 46
#outs f
#outs f
#step 47
#outs f
#outs f
#step 48
#outs f
#outs f
#step 49
#outs f
#outs f
#step 50
#outs f
#outs f
#step 51
#outs f
#outs f
#step 52
#outs f
#outs f
#step 53
#outs f
#outs f
#step 54
#outs f
#outs f
#step 55
#outs f
#outs f
#step 56
#outs f
#outs f
#step 57
#outs f
#outs f
#step 58
#outs f
#outs f
#step 59
#outs f
#outs f
#step 60
#outs f
#outs f
#step 61
#outs f
#outs f
#step 62
#outs f
#outs f
#step 63
#outs f
#outs f
#step 64
#outs f
#outs f
#step 65
#outs f
#outs f
#step 66
#outs f
#outs f
#step 67
#outs f
#outs f
#step 68
#outs f
#outs f
#step 69
#outs f
#outs f
#step 70
#outs f
#outs f
#step 71
#outs f
#outs f
#step 72
#outs f
#outs f
#step 73
#outs f
#outs f
#step 74
#outs f
#outs f
#step 75
#outs f
#outs f
#step 76
#outs f
#outs f
#step 77
#outs f
#outs f
#step 78
#outs f
#outs f
#step 79
#outs f
#outs f
#step 80
#outs f
#outs f
#step 81
#outs f
#outs f
#step 82
#outs f
#outs f
#step 83
#outs f
#outs f
#step 84
#outs f
#outs f
#step 85
#outs f
#outs f
#step 86
#outs f
#outs f
#step 87
#outs f
#outs f
#step 88
#outs f
#outs f
#step 89
#outs f
#outs f
#step 90
#outs f
#outs f
#step 91
#outs f
#outs f
#step 92
#outs f
#outs f
#step 93
#outs f
#outs f
#step 94
#outs f
#outs f
#step 95
#outs f
#outs f
#step 96
#outs f
#outs f
#step 97
#outs f
#outs f
#step 98
#outs f
#outs f
#step 99
#outs f
#outs f
#step 100
#outs f
#outs f
#end
......@@ -2,10 +2,10 @@
#inputs
#outputs "a":bool "b":bool "c":bool "d":bool "e":bool
#step 1
#outs t t f f f
#outs t t f f f
#step 2
#outs t f t t f
#outs t f t t f
#step 3
#outs t f t f t
#outs t f t f t
#step 4
# Simulation ended normally.
......@@ -2,10 +2,10 @@
#inputs
#outputs "a":bool "b":bool "c":bool "d":bool "e":bool
#step 1
#outs t f t t t
#outs t f t t t
#step 2
#outs t t f t t
#outs t t f t t
#step 3
#outs t f f t t
#outs t f f t t
#step 4
# Simulation ended normally.
......@@ -2,10 +2,10 @@
#inputs
#outputs "a":bool "b":bool "c":bool "d":bool "e":bool "f":bool
#step 1
#outs t t t t f t
#outs t t t t f t
#step 2
#outs t t t t t f
#outs t t t t t f
#step 3
#outs t t t f f t
#outs t t t f f t
#step 4
# Simulation ended normally.
......@@ -2,10 +2,10 @@
#inputs
#outputs "x":bool "y":bool "z":bool "t":bool
#step 1
#outs t t t t
#outs t t t t
#step 2
#outs f t t t
#outs f t t t
#step 3
#outs t t f t
#outs t t f t
#step 4
# Simulation ended normally.
......@@ -2,204 +2,204 @@
#inputs
#outputs "x":bool "y":bool "z":bool "t":bool
#step 1
#outs t t t t
#outs t t t t
#step 2
#outs t t t t
#outs t t t t
#step 3
#outs t f f t
#outs t f f t
#step 4
#outs t t f t
<