# Makefile for the tests # Sergio Antoy, Thu Jan 5 23:04:13 PST 2006 # There is no stated dependency between *.txt and test.* # thus, recompiling a curry file does not trigger running # a test that depends on it. TXT = $(patsubst %.curry,%.txt,$(wildcard *.curry)) NEW = $(patsubst test.%,new.%,$(wildcard test.*)) TEST = $(shell ls test.* | sed -e "s/test\.//g") # How do I make this system independent ??? # CURRY2VM = /home/antoy/COMMON/programs/curry/curry2vm/curry2vm CURRY2VM = $(shell which curry2vm) LIBRARYPATH = ../home/lib:. FLVM = ../home/bin/flvm all: compile execute compare compile: $(TXT) %.txt : %.curry $(CURRY2VM) @ # the following is needed when curry2vm is rebuilt !!! @ rm -f $@ @ echo compiling $< @ curry2vm -path ${LIBRARYPATH} $< execute: $(NEW) new.% : test.% trace.% $(FLVM) @ echo executing $* @ echo "-- Test start at" `date` > $@ @ ( cat $< \ | egrep -v "^--" \ | egrep -v "^ *$$" \ | $(FLVM) -script >> $@ 2>&1; \ if [ $$? -ne 0 ]; then \ echo Execution of $* terminated abnormally; \ fi) @ echo "-- Test end at" `date` >> $@ compare: FORCE @ for i in $(NEW); do \ f=`expr $$i : 'new\.\(.*\)'`; \ cat new.$$f | egrep -v "^--" > tmp.1; \ cat trace.$$f | egrep -v "^--" > tmp.2; \ (diff -C0 tmp.1 tmp.2 > tmp.3; \ if [ $$? -ne 0 ]; then \ echo "FAILED" $$f "output in" new.$$f; \ else \ echo "PASSED" $$f; \ fi); \ rm -f tmp.*; \ done FORCE: .PHONY : clean clean : @ rm -f *.fcy *.fint *.txt *.tmp new.*