Skip to content
Snippets Groups Projects
Commit 27a8eedb authored by Pascal Raymond's avatar Pascal Raymond
Browse files

qq tests manquants

parent 5e4a7cfc
No related branches found
No related tags found
No related merge requests found
OBJDIR=../obj$(HOSTTYPE)
LC0=$(OBJDIR)/lus2lic
LC=$(OBJDIR)/lus2lic -vl 2
LC2=$(OBJDIR)/lus2lic
NL="----------------------------------------------------------------------\\n"
filter_line=grep -v Opening\ file
OK_LUS=$(shell find should_work -name "*.lus" -print | LC_ALL=C sort -n)
KO_LUS=$(shell find should_fail -name "*.lus" -print | LC_ALL=C sort -n)
ALL_LUS=$(OK_LUS) $(KO_LUS)
all:
echo $(ALL_LUS)
LIC=$(shell find should_work -name "*.lic" -print | LC_ALL=C sort -n)
when:
for d in ${ALL_LUS}; do \
ls $$d; \
grep -n " when" $$d; \
done
tgz:
tar cvfz lustre_non_reg_files.tgz should_work should_fail
lic:
/bin/echo "generate all possible lic files"
for d in ${OK_LUS}; do \
/bin/echo -e "\n$(NL)====> $(LC2) $$d -o $$d.lic " ;\
$(LC2) $$d -o $$d.lic ;\
done
xxx:
/bin/echo "reentrant ?"
for d in ${LIC}; do \
/bin/echo -e "\n$(NL)====> $(LC2) $$d " ;\
$(LC2) $$d > /dev/null ;\
done
begin:
/bin/echo "Non-regression tests" > test_ok.res
/bin/echo "Those tests are supposed to generate errors" > test_ko.res
unit:
$(LC0) -unit >> test_ok.res 2>&1
help:
$(LC0) -help >> test_ok.res 2>&1
version:
$(LC0) --version
FILTER= grep -v "file was generated by" | grep -v " on " | grep -v "Opening file "
do_not_exist:
$(LC) do_not_exist.lus | $(FILTER) >> test_ko.res 2>&1 || true
test_lic: begin unit help version do_not_exist
for d in ${OK_LUS}; do \
/bin/echo -e "\n$(NL)====> $(LC) --nonreg-test $$d" >> test_ok.res; \
$(LC) --nonreg-test $$d >> test_ok.res 2>&1 ;\
done; \
for d in ${KO_LUS}; do \
/bin/echo -e "\n$(NL)====> $(LC) --nonreg-test $$d" >> test_ko.res; \
$(LC) --nonreg-test $$d >> test_ko.res 2>&1 ;\
done; \
rm -f test.res ; cat test_ok.res test_ko.res | $(FILTER) > test.res ;\
diff -u test.res.exp test.res > test.diff || \
(cat test.diff ; /bin/echo "cf test.diff"; exit 1)
utest_lic:
cp test.res test.res.exp
errors_nb:
/bin/echo -e "There were $(shell grep Error test_ok.res | wc -l) errors."
/bin/echo -e "There were $(shell grep Warning test_ok.res | wc -l) Warnings."
errors:errors_nb
/bin/echo -e "There were $(shell grep Warning test_ok.res | wc -l) Warnings."
grep Warning test_ok.res || true
/bin/echo -e "There were $(shell grep Error test_ok.res | wc -l) errors."
grep "*** Error" test_ok.res
test_ec:
rm -f test_ec.res
for d in ${OK_LUS}; do \
/bin/echo -e "\n$(NL)====> $(LC0) --nonreg-test -ec $$d -o /tmp/xx.ec" >> test_ec.res; \
$(LC0) -ec --nonreg-test $$d -o /tmp/xx.ec >> test_ec.res 2>&1 ;\
/bin/echo -e "ec2c /tmp/xx.ec" >> test_ec.res; \
(ec2c /tmp/xx.ec >> test_ec.res 2>&1 && /bin/echo -n "ok ") || /bin/echo " KO ($$d)!";\
done; \
diff -u test_ec.res.exp test_ec.res > test_ec.diff || \
(cat test_ec.diff ; /bin/echo "cf test_ec.diff"; exit 1)
utest_ec:
cp test_ec.res test_ec.res.exp
test_lv4:
rm test_lv4.res || /bin/echo "";
for d in ${OK_LUS}; do \
/bin/echo -e "\n$(NL)====> $(LC0) --nonreg-test -lv4 $$d -o /tmp/xx.lus" >> test_lv4.res; \
$(LC0) --nonreg-test -lv4 $$d -o /tmp/xx.lus >> test_lv4.res 2>&1 ;\
if [ ! -f /tmp/xx.lus ]; then echo "Error $$d: no /tmp/xx.lus file" >> test_lv4.res 2>&1; fi ;\
for node in `lusinfo /tmp/xx.lus nodes`; do \
/bin/echo -e "lus2ec /tmp/xx.lus $$node" >> test_lv4.res; \
(lus2ec /tmp/xx.lus $$node >> \
test_lv4.res 2>&1 && /bin/echo -n "ok ") \
|| /bin/echo " KO ($$d)!";\
done; \
done; \
diff -u test_lv4.res.exp test_lv4.res > test_lv4.diff || \
(cat test_lv4.diff ; /bin/echo "cf test_lv4.diff"; exit 1)
utest_lv4:
cp test_lv4.res test_lv4.res.exp
test: test_lic test_ec test_lv4
utest: utest_lic utest_ec utest_lv4
clean:
rm -f *.c *.h *.ec
for d in ${ALL_LUS}; do \
rm $$d.lic; \
done
(* ne passe pas DoNotPoly ... *)
node truc = map<<+,42>>;
(* PASSE DoNotPoly ... *)
node trac = map<<Lustre::iplus,42>>;
(* ne passe pas DoNotPoly ... *)
node main = truc;
(* ne passe pas DoNotPoly ... *)
node truc = map<<+,42>>;
(* PASSE DoNotPoly en spécialisant truc ! ... *)
node main(x,y: int) returns (o: int^42);
let
o = if (x < y) then 0^42 else truc(x^42, y^42);
tel
node main(x,y: int) returns (o: int^42);
let
o = if (x < y) then 0^42 else map<<+,42>>(x^42, y^42);
tel
node main(c: bool; x,y:int) returns (o: int);
let
o = condact<<+,0>>(c,x,y);
tel
node main(x,y: bool^42) returns (o: bool^42);
let
o = map<<or, 42>>(x,y);
tel
node main(x: bool^42) returns (o: bool);
let
o = red<<or, 42>>(false,x);
tel
node main(x: bool^13) returns (o: bool);
let
o = boolred<<1,2,13>>(x);
tel
-- ok
node ma_macro<<const i : int>>(x: int) returns (y: int);
let
y = i + x;
tel
node main = ma_macro<<32>>;
-- KO, mais pas où il faudrait ...
node ma_macro<<const i : int>>(x: int) returns (y: int);
let
y = i + x;
tel
-- n.b. ko à l'utilisation uniquement
node main = ma_macro<<32.0>>;
-- KO
node ma_macro<<const i : int>>(x: int) returns (y: int);
let
y = i + x;
tel
--*** Bad static argument nature, a constant was expected
node main = ma_macro<<+>>;
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