Makefile: Updates to testing targets.
This commit is contained in:
parent
f59403ad72
commit
31f47f60c2
24
Makefile
24
Makefile
@ -1,15 +1,29 @@
|
||||
.PHONY.: test
|
||||
test:
|
||||
nimble test
|
||||
# Make does not offer a recursive wildcard function, so here's one:
|
||||
rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
|
||||
|
||||
.PHONY.: build
|
||||
SOURCES=$(call rwildcard,src/,*.nim)
|
||||
TEST_SOURCES=$(wildcard tests/*.nim)
|
||||
TESTS=$(patsubst %.nim,bin/%,$(TEST_SOURCES))
|
||||
|
||||
.PHONY: test
|
||||
test: $(TESTS) $(SOURCES)
|
||||
@for t in $(TESTS); do $$t; done
|
||||
|
||||
.PHONY: watch-tests
|
||||
watch-tests:
|
||||
watch 'make test' src tests --wait=10
|
||||
|
||||
.PHONY: build
|
||||
build: test
|
||||
nimble build
|
||||
|
||||
.PHONY.: install
|
||||
.PHONY: install
|
||||
install: test
|
||||
nimble install
|
||||
|
||||
diagrams: doc/vcard3.mmd doc/vcard4.mmd
|
||||
mmdc -i doc/vcard3.mmd -o doc/vcard3.png
|
||||
mmdc -i doc/vcard4.mmd -o doc/vcard4.png
|
||||
|
||||
bin/tests/%: tests/%.nim $(SOURCES)
|
||||
nim --outdir:bin/tests c $(patsubst bin/%,%.nim,$@)
|
||||
|
Loading…
x
Reference in New Issue
Block a user