You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
669 B
Makefile

RSTCLR := $$(tput sgr0)
REDCLR := $$(tput setaf 1)
GRNCLR := $$(tput setaf 2)
DISPRES := echo "$(GRNCLR)DONE$(RSTCLR)" || echo "$(REDCLR)FAILED$(RSTCLR)"
RUNTEST = ./$(1)/driver | . ./$(1)/cmdline >/dev/null 2>&1
TESTS := $(wildcard *)
TESTS := $(filter 0 1 2 3 4 5 6 7 8 9, $(TESTS))
TESTS := $(sort $(TESTS))
check: $(patsubst %,test%,$(TESTS))
workdir/csr workdir/newcerts workdir/newkeys:
mkdir $@
test%: %/init %/cmdline %/fini workdir/csr workdir/newcerts workdir/newkeys
@echo -n "Preparing test $*... " ; ./$*/init && $(DISPRES)
@echo -n "Running test $*... " ; $(call RUNTEST,$*) && $(DISPRES)
@echo -n "Cleaning test $*... " ; ./$*/fini && $(DISPRES)