summaryrefslogtreecommitdiffabout
path: root/test/Makefile.am
Unidiff
Diffstat (limited to 'test/Makefile.am') (more/less context) (ignore whitespace changes)
-rw-r--r--test/Makefile.am32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
new file mode 100644
index 0000000..705278d
--- a/dev/null
+++ b/test/Makefile.am
@@ -0,0 +1,32 @@
1TESTS=\
2 r01_closing_at_the_line_start.clichec \
3 r02_anchor_after_literal.clichec \
4 r03_percent_after_empty.clichec \
5 r04_too_seamless_transitions.clichec
6
7EXTRA_DIST=$(TESTS)
8CLEANFILES = $(basename $(TESTS)) \
9 $(foreach s,.out .diff,$(addsuffix $s,$(basename $(TESTS))))
10.INTERMEDIATE: $(CLEANFILES)
11
12TEST_EXTENSIONS=.clichec
13CLICHEC_LOG_COMPILER=test_clichec() { \
14 $(MAKE) "$$(basename $$1 .clichec)"{,.{out,diff,check}} ;\
15}; test_clichec
16
17gitignore: .gitignore
18.gitignore: Makefile
19 for t in ${TESTS} ; do for f in "$${t%.*}"{,.{out,diff,check,log}} ; do \
20 grep -q "^/$$f" .gitignore || echo "/$$f" >>.gitignore ;\
21 done done
22
23CLICHE=${top_builddir}/src/cliche
24SUFFIXES=.clichec .cc .out .diff .check
25.clichec.cc:
26 $(CLICHE) -C -o $@ $<
27%.out: %
28 ${builddir}/$< >$@
29%.diff: ${builddir}/%.out ${srcdir}/%.expected
30 @-diff -u "$*.expected" "$*.out" >"$@"
31%.check: %.diff
32 @test -s "$<" && { cat "$*.out";cp "$*.out" "$*.unexpected" ; exit 1 ; } || true