Debian Codegraph @

tests/feature/Makefile

raw
1 .PHONY: check
2
3 tests = \
4 alt \
5 anonlex \
6 anonlex-modifier \
7 anonpat \
8 anonpat-filter \
9 anonpat-filter-ops \
10 anonpat-modifier \
11 anonpat-nospaces \
12 anonpat-ops \
13 conflicting-tags \
14 diacritic \
15 disjoint-opt \
16 empty \
17 empty-patterns \
18 filter-crosstalk \
19 lexdeftag \
20 lexicon-side-tags \
21 lexname-space \
22 lextag \
23 lexnegtag \
24 nontree \
25 oneside \
26 opt \
27 or-filter \
28 pairs \
29 pattag \
30 pattag-coherent \
31 pattag-details \
32 pattern-independence \
33 regex \
34 revsieve \
35 sieve \
36 sieveopt \
37 slots-and-operators-nospace \
38 xor-filter \
39 xor-multi \
40
41 sources = $(foreach test,$(tests),test-$(test).lexd)
42
43 check-pos: $(foreach src,$(sources),$(O)/$(src).txt.strings.check)
44
45 negtests = \
46 col0 \
47 trailing-bracket \
48
49 negsources = $(foreach test,$(negtests),negtest-$(test).lexd)
50
51 check-neg: $(foreach src,$(negsources),$(O)/$(src).txt.error)
52
53 check: check-pos check-neg
54
55 O=.
56
57 $(O):
58 mkdir $(O)
59 $(O)/%.lexd.txt: ../../src/lexd %.lexd | $(O)
60 $^ $(LEXD_TEST_FLAGS) > $@
61 $(O)/%.lexd.txt.strings: $(O)/%.lexd.txt
62 hfst-txt2fst $< | hfst-fst2strings -X obey-flags -c 10 | LC_ALL=C sort -u > $@
63 $(O)/%.strings.diff: $(O)/%.strings %.strings.gold
64 diff -U0 $^ > $@; [ $$? != 2 ]
65 $(O)/%.strings.check: $(O)/%.strings.diff
66 [ -s "$<" ] && cat "$<" && exit 1; touch $@
67 $(O)/%.lexd.txt.error: ../../src/lexd %.lexd | $(O)
68 $^ $(LEXD_TEST_FLAGS) > /dev/null 2> $@; [ $$? = 1 ]
69 clean:
70 rm $(foreach src,$(sources),$(O)/$(src).txt.strings.check)
71 rm $(foreach src,$(negsources),$(O)/$(src).txt.error)
72 rmdir $(O)