

LURETTETOP=../../../bin/lurettetop --local-var

ifeq ($(HOSTTYPE),win32)
  RM=del /q
  LURETTETOP=u:/lurette/win32/bin/lurettetop.bat  
else
  RM=rm -f
endif

test1:
	$(RM)  test1.rif0 && \
	$(LURETTETOP) \
	-l 30  -td 10 \
	-rp "sut:v4:heater_ctrl_int.lus:heater_ctrl_int" \
	-rp "env:lutin:temp_int.lut:main" \
	--sut heater_ctrl_int.lus -msn heater_ctrl_int --seed 1 \
	 --draw-inside 10 --draw-edges 10 --draw-all-vertices --draw-vertices 10 \
	  --do-not-show-step -ns2c -go -o test1.rif0  --draw-inside 10 --draw-edges 10 \
	   -go   &&\
	grep -v "lurette chronogram" test1.rif0  | \
	grep -v "This is lurette Version"  | \
	grep -v "The execution lasted"| sed -e "s/^M//" \
	   > test1.rif  &&\
	$(RM)  test1.res && diff -u -i  test1.rif.exp test1.rif  > test1.res
	[ ! -s test1.res ] && make clean 

test2: 
	$(RM)  test2.rif0 && \
	$(LURETTETOP) --precision 4 -go -l 30 \
	 -td 10  \
	-rp "sut:v4:heater_ctrl.lus:heater_ctrl" \
	-rp "env:lutin:temp_float.lut:main" \
   --seed 1 \
	 --draw-inside 10 --draw-edges 10 --draw-all-vertices --draw-all-formula \
	   --do-not-show-step -ns2c -o test2.rif0  --draw-inside 10 --draw-edges 10 \
	    &&\
	grep -v "lurette chronogram" test2.rif0  | \
	grep -v "This is lurette Version"  | \
	grep -v "The execution lasted"| sed -e "s/^M//"\
	   > test2.rif  &&\
	$(RM)  test2.res && diff -u -i  test2.rif.exp test2.rif \
	   > test2.res
	[ ! -s test2.res ] && make clean 

test3 :
	$(RM)  test3.rif0 && \
	$(LURETTETOP) -l 100 -go -seed 1   \
	-rp "sut:v4:heater_ctrl2.lus:heater_ctrl2" \
	-rp "env:lutin:window.lut:main" \
	 --do-not-show-step -ns2c -sut heater_ctrl2.lus -msn heater_ctrl2 -o test3.rif0   &&\
	grep -v "lurette chronogram" test3.rif0  | \
	grep -v "This is lurette Version"  | \
	grep -v "The execution lasted"| sed -e "s/^M//" > test3.rif && \
	$(RM) test3.res && diff -u -i test3.rif.exp test3.rif > test3.res
	[ ! -s test3.res ] && make clean 


test : test1 test2 test3 

utest1:
	cp test1.rif test1.rif.exp

utest2:
	cp test2.rif test2.rif.exp

utest3:
	cp test3.rif test3.rif.exp

utest: utest1 utest2 utest3

clean:
	$(RM) -rf *.ec *.log *~ Data *.pp_luc *.rif0 *.rif



