#
# Makefile for running TSI unit tests
#

TESTS = $(wildcard test_*)
REPORT = report.txt

all: init report

init:
	@echo "Have tests: $(TESTS)"
	@echo "Tests started at $(shell date)\n" >> $(REPORT)

.PHONY: runtest $(TESTS)

runtest: $(TESTS)

$(TESTS):
	@echo "\n***********************************************" >> $(REPORT)
	@echo "**" >> report.txt
	@echo "** Running test suite $@" >> report.txt
	@echo "**" >> report.txt
	@echo "***********************************************\n" >> $(REPORT)
	make -C $@

report: runtest
	@echo "\nTests finished at $(shell date)" >> $(REPORT)
	@cat $(REPORT)

clean:
	@rm -f $(REPORT)
