Add testing harness to makefile
This commit is contained in:
7
Makefile
7
Makefile
@@ -7,6 +7,8 @@ GIT_REPO := ssh://git@git.famcosi.duckdns.org:222/gcordova/go-do.git
|
|||||||
GIT_REF := $(shell git symbolic-ref --short HEAD)
|
GIT_REF := $(shell git symbolic-ref --short HEAD)
|
||||||
GIT_HASH := $(shell git rev-parse --short HEAD)
|
GIT_HASH := $(shell git rev-parse --short HEAD)
|
||||||
|
|
||||||
|
rwildcard = $(foreach d,$(wildcard $1*),$(call rwildcard,$d/$2) $(filter $2,$d))
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@echo "Project: $(PROJECT) v$(VERSION)"
|
@echo "Project: $(PROJECT) v$(VERSION)"
|
||||||
@echo "Repository: $(GIT_REPO)"
|
@echo "Repository: $(GIT_REPO)"
|
||||||
@@ -18,12 +20,11 @@ help:
|
|||||||
|
|
||||||
test: $(patsubst %.test,%.stdout,$(call rwildcard,,%.test))
|
test: $(patsubst %.test,%.stdout,$(call rwildcard,,%.test))
|
||||||
|
|
||||||
rwildcard = $(foreach d,$(wildcard $1*),$(call rwildcard,$d/$2) $(filter $2,$d))
|
|
||||||
|
|
||||||
%.stdout: %.test
|
%.stdout: %.test
|
||||||
./$< > $@ 2> $(patsubst %.stdout,%.stderr,%@) \
|
./$< > $@ 2> $(patsubst %.stdout,%.stderr,%@) \
|
||||||
|| (touch --date=@0 $@; false)
|
|| (touch --date=@0 $@; false)
|
||||||
git diff --exit-code --src-prefix=expected/ --dst-prefix=actual/ $@ $(patsubst %.stdout,%.stderr,$@) \
|
git diff --exit-code --src-prefix=expected/ --dst-prefix=actual/ \
|
||||||
|
$@ $(patsubst %.stdout,%.stderr,$@) \
|
||||||
|| (touch --date=@0 $@; false)
|
|| (touch --date=@0 $@; false)
|
||||||
|
|
||||||
# vim: ai noet ts=8 sw=8:
|
# vim: ai noet ts=8 sw=8:
|
||||||
|
|||||||
Reference in New Issue
Block a user