Commit 884d2fbb authored by Erwan Jahier's avatar Erwan Jahier
Browse files

Various improvements in displayed information (stdout/stderr)

- put the seed and the lutin version on stdour (as stderr) so that it appears in the .rif file
- add a '#' before "The oracle returned false at step" in the rif file
- Replace every occurence of "the oracle is violated" by "the oracle returned false".
- Display more information in lutin and check-rif when an oracle returned false.
parent 5099f5dc
......@@ -43,7 +43,6 @@ test-lutin:
cd lutin/external_code && make test;
cd lutin/luciole && make test ;
cd lutin/lustre && make test ;
cd lutin/test_ok && make test ;
cd lutin/C && make test;
cd lutin/oracle && make test;
echo "All lutin tests ran correctly."
......
#include <stdlib.h>
#include <stdio.h>
#include "foo.h"
// Output procedures
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;
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++){
// 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",
i, ctx->_a, ctx->_b, ctx->_c, ctx->_x, ctx->_y, ctx->_z);
}
return 0;
}
......@@ -74,7 +74,7 @@ test1: clean $(OBJDIR)/$(MAIN).$(DLEXT)
test2:
echo "1.0 1.0" | ../../../$(HOSTTYPE)/bin/lutin -l 1 -L libm.so polar.lut -m cartesian \
-seed 1 > test2.rif
-seed 1 | grep -v " Version" > test2.rif
rm -f test2.res && diff -u -i -B test2.rif.exp test2.rif > test2.res
[ ! -s test2.res ] && make clean
......
# The random engine was initialized with the seed 834966010
#inputs
#outputs "f1":real "f2":real "i":int
#step 1
#outs 87.36 0.84 9
#step 2
#outs 61.26 0.08 4
#step 3
#outs 31.94 1.00 8
#step 4
#outs 64.31 -0.59 8
#step 5
#outs 96.69 0.99 10
#step 6
#outs 66.59 -0.40 2
#step 7
#outs 15.51 0.95 3
#step 8
#outs 77.29 -0.72 8
#step 9
#outs 26.98 0.59 3
#step 10
#outs 24.66 -0.89 6
#end
# The random engine was initialized with the seed 1
#inputs "r":real "alpha":real
#outputs "x":real "y":real
#step 1
#outs 0.54 0.84
#end
......@@ -3,7 +3,7 @@
#
EXE=
ifeq ($(HOSTTYPE),win32)
ifeq ($(HOSTTYPE),cross-win32)
EXE=.exe
endif
......@@ -20,14 +20,14 @@ not_a_sauna.ec: heater_control.lus
test1 : not_a_sauna.ec
echo -e "t\nt\nt\nt\nt\nt\nt\nt\nt\nt\nt\nt\nt\nt\nt\nt\nt\nt\nt\nt\nt\n" | \
$(LUTIN) env.lut -main main --oracle-ec $< | sed -e "s/^M//" > test1.rif
$(LUTIN) env.lut -main main --oracle-ec $< | sed -e "s/^M//" | grep -v "This is lutin" > test1.rif
rm -f test1.res && diff -B -u -i -w test1.rif.exp test1.rif > test1.res
test2 : not_a_sauna.ec
echo -e "t\nf\nt\nf\nt\nf\nt\nf\nt\nf\nt\nf\nt\nf\nt\nf\nt\nf\nt\nf\nt\n" | \
$(LUTIN) env.lut -main main --oracle-ec $< | sed -e "s/^M//" > test2.rif
$(LUTIN) env.lut -main main --oracle-ec $< | sed -e "s/^M//" | grep -v "This is lutin" > test2.rif
rm -f test2.res && diff -B -u -i -w test2.rif.exp test2.rif > test2.res
[ ! -s test2.res ] && make clean
......@@ -45,4 +45,3 @@ clean:
# The random engine was initialized with the seed 1
#inputs "Heat_on":bool
#outputs "T":real "T1":real "T2":real "T3":real
#step 1
......@@ -28,4 +29,4 @@
#outs 9.99 8.52 11.48 10.11
#step 14
#outs 10.30 9.87 11.27 9.45
The oracle returned false at step 14
# The oracle returned false at step 14
# The random engine was initialized with the seed 1
#inputs "Heat_on":bool
#outputs "T":real "T1":real "T2":real "T3":real
#step 1
......
# The random engine was initialized with the seed 9
#inputs
#outputs "a":int "b":int "c":int "d":int "e":int
#step 1
......
# The random engine was initialized with the seed 9
#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
# The random engine was initialized with the seed 9
#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.
# The random engine was initialized with the seed 9
#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.
# The random engine was initialized with the seed 9
#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.
# The random engine was initialized with the seed 9
#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.
# The random engine was initialized with the seed 9
#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
#outs t t f t
#step 5
#outs T F T F
#outs t f t f
#step 6
#outs T F F F
#outs t f f f
#step 7
#outs T F F T
#outs t f f t
#step 8
#outs T F F T
#outs t f f t
#step 9
#outs T F F F
#outs t f f f
#step 10
#outs T F F T
#outs t f f t
#step 11
#outs T F F T
#outs t f f t
#step 12
#outs T T F T
#outs t t f t
#step 13
#outs T T F T
#outs t t f t
#step 14
#outs T F T F
#outs t f t f
#step 15
#outs T F F F
#outs t f f f
#step 16
#outs T T F T
#outs t t f t
#step 17
#outs T T T T
#outs t t t t
#step 18
#outs T T F T
#outs t t f t
#step 19
#outs T F F F
#outs t f f f
#step 20
#outs T F F F
#outs t f f f
#step 21
#outs T T F T
#outs t t f t
#step 22
#outs T T T T
#outs t t t t
#step 23
#outs T T T T
#outs t t t t
#step 24
#outs T T T F
#outs t t t f
#step 25
#outs T T T F
#outs t t t f
#step 26
#outs T T T F
#outs t t t f
#step 27
#outs T F T T
#outs t f t t
#step 28
#outs T T F T
#outs t t f t
#step 29
#outs T T F F
#outs t t f f
#step 30
#outs T F T T
#outs t f t t
#step 31
#outs T F F F
#outs t f f f
#step 32
#outs T T T T
#outs t t t t
#step 33
#outs T F T T
#outs t f t t
#step 34
#outs T F F F
#outs t f f f
#step 35
#outs T F F T
#outs t f f t
#step 36