-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (26 loc) · 841 Bytes
/
Makefile
File metadata and controls
33 lines (26 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
.SUFFIXES:
.PHONY: test
.PRECIOUS: %.found
all: test
clean: clean-test
COMMON_GVPR = lib/common.gvpr
TEST_EXPECTED ?= $(wildcard test/*.expected)
TEST_FOUND = ${TEST_EXPECTED:.expected=.found}
TEST_TESTED = ${TEST_EXPECTED:.expected=.tested}
%.found: %.gv %.gvpr $(COMMON_GVPR)
@(gvpr "`cat $(COMMON_GVPR) $(subst .found,.gvpr,$@)`" $(subst .found,.gv,$@) > $@)
%.tested: %.found %.expected
@(\
(\
(diff $(subst .tested,.found,$@) $(subst .tested,.expected,$@)) && \
echo "[PASS] $(subst .tested,,$@)" && \
echo "SUCCESS" > $@ \
) || ( \
echo "[FAIL] $(subst .tested,,$@)" && \
echo " Please compare the files \"$(subst .tested,.expected,$@)\" and \"$(subst .tested,.found,$@)\"." && \
false \
) \
)
test: $(TEST_TESTED)
clean-test:; @(rm -rf $(TEST_TESTED) $(TEST_FOUND))
re-test: clean-test test