# Makefile
# $Id: Makefile,v 1.5 2001/09/30 01:33:46 gwiley Exp $
# Glen Wiley, gwiley@ieee.org
#
# test targets for PDV
#
# TODO interactive tests, negative tests
#

TESTS   = unit basic execute tarZ spec
OUTPUT  = ${TESTS:=.test}
RESULTS = ${TESTS:=.results}

.PRECIOUS: $(OUTPUT)

.SUFFIXES: .results .test .sh

.sh.test :
	@printf "\nrunning test $?\n"
	@./$? > $@ 2>&1

.test.results :
	-@diff $?.can $? > $@
	@if [ ! -s $@ ]; \
	then \
		printf "$@ indicates a passed test\n"; \
	else \
		printf "\n***** $@ indicates a failed test *****\n"; \
	fi

all : env $(RESULTS)
	@printf "all tests completed, make clean to rerun tests\n"

canon :
	for f in $(OUTPUT); do cp $$f $$f.can; done

env : envchk
	@./envchk

clean :
	rm -f $(RESULTS) $(OUTPUT)
	rm -Rf *.tmp foo* bar* TMPFILE NOTAFILE

# Makefile
