Add makefile
This commit is contained in:
29
Makefile
Normal file
29
Makefile
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
.PHONY: help test
|
||||||
|
|
||||||
|
PROJECT := Bg
|
||||||
|
VERSION := 0.0.1
|
||||||
|
|
||||||
|
GIT_REPO := ssh://git@git.famcosi.duckdns.org:222/gcordova/go-do.git
|
||||||
|
GIT_REF := $(shell git symbolic-ref --short HEAD)
|
||||||
|
GIT_HASH := $(shell git rev-parse --short HEAD)
|
||||||
|
|
||||||
|
help:
|
||||||
|
@echo "Project: $(PROJECT) v$(VERSION)"
|
||||||
|
@echo "Repository: $(GIT_REPO)"
|
||||||
|
@echo "Branch: $(GIT_REF) [$(GIT_HASH)]"
|
||||||
|
@echo ""
|
||||||
|
@echo "Usage:"
|
||||||
|
@echo " make [help] - Display this message"
|
||||||
|
@echo " make test - Run unit tests"
|
||||||
|
|
||||||
|
test: $(patsubst %.test,%.stdout,$(call rwildcard,,%.test))
|
||||||
|
|
||||||
|
rwildcard = $(foreach d,$(wildcard $1*),$(call rwildcard,$d/$2) $(filter $2,$d))
|
||||||
|
|
||||||
|
%.stdout: %.test
|
||||||
|
./$< > $@ 2> $(patsubst %.stdout,%.stderr,%@) \
|
||||||
|
|| (touch --date=@0 $@; false)
|
||||||
|
git diff --exit-code --src-prefix=expected/ --dst-prefix=actual/ $@ $(patsubst %.stdout,%.stderr,$@) \
|
||||||
|
|| (touch --date=@0 $@; false)
|
||||||
|
|
||||||
|
# vim: ai noet ts=8 sw=8:
|
||||||
Reference in New Issue
Block a user