Commit 252aa781 authored by Erwan Jahier's avatar Erwan Jahier
Browse files

Merging Pascal and R1 branches (there were some conflicts in mainArg.ml).

parents 38651b5d 4b3e5d78
......@@ -43,6 +43,7 @@ test-lutin:
cd lutin/external_code && make test;
cd lutin/luciole && make test ;
cd lutin/lustre && make test ;
cd lutin/test_ok && make test ;
echo "All lutin tests ran correctly."
test: test-lucky test-lutin
......
#!/bin/bash
LUTIN="$LURETTE_PATH/$HOSTTYPE/bin/lutin -seed 9 -l 100"
TDIR=,test
IDIR=,ins
function getnodes {
cat $1 | grep "^node " | sed -e "s/^node [ ]*\([^ (]*\)[ (].*$/\1/"
}
function dolutin {
local base=$1
local n=$2
local ins="$IDIR/$base-$n.ins"
local rif=$TDIR/$base-$n.rif
if [ ! -f "$ins" ]; then
#ins="/dev/null"
cat /dev/null | $LUTIN "$base.lut" -m $n -l 1 | grep -e "#inputs"
echo "-- please provide a file \"$ins\" (even empty !)"
exit 1
fi
#set -x
echo "cat \"$ins\" | $LUTIN \"$base.lut\" -m $n > \"$rif\""
cat "$ins" | $LUTIN "$base.lut" -m $n > "$rif"
if [ $? != 0 ]; then exit 1; fi
#set +x
}
function testit {
local f="$1"
local n=$2
local base=`basename "$f" .lut`
local rif="$TDIR/$base-$n.rif"
local ref="$rif.ref"
local res="$base-$n.res"
if [ ! -f "$ref" ]; then
echo "-- RUN \"make utest\" first !"
exit 1
fi
dolutin "$base" $n
diff -u -i "$rif" "$ref" > "$res"
if [ $? != 0 ]; then exit 1; fi
local problem=`cat "$res" | wc -c`
if [ $problem != 0 ]; then
exit 1
else
echo rm -f "$res"
rm -f "$res"
fi
}
function utestit {
local f="$1"
local n=$2
local base=`basename "$f" .lut`
dolutin "$base" $n
local rif="$TDIR/$base-$n.rif"
local ref="$rif.ref"
mv -f "$rif" "$ref"
}
if [ "$1" = "-u" ]; then
treat=utestit
else
treat=testit
fi
for f in *.lut; do
for n in `getnodes $f`; do
$treat $f $n
done
done
0 1
0 1
1 0
1 1
0 1
1 0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