-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (24 loc) · 700 Bytes
/
Copy pathMakefile
File metadata and controls
30 lines (24 loc) · 700 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
.PHONY: test libxml saxon xalan
XSLT:=test.xsl
XML:=test.xml
# saxon has an issue, uses scientific notation for to-frames
#test: libxml saxon xalan
test: libxml xalan
libxml: COMMAND := xsltproc $(XSLT) $(XML) 2>&1 > /dev/null
libxml:
$(run-tests)
# w/o Homebrew: java -jar /usr/share/java/Saxon-HE.jar
saxon: COMMAND := saxon -xsl:$(XSLT) -s:$(XML) 2>&1 > /dev/null
saxon:
$(run-tests)
xalan: COMMAND := xalan -in $(XML) -xsl $(XSLT) 2>&1 > /dev/null
xalan:
$(run-tests)
define run-tests
@$(COMMAND) | perl -pe' \
BEGIN { $$success = 0 } \
$$success = 1 if /\bfail\b/; \
s|\bpass\b|\033[32mpass\033[0m|; \
s|\bfail\b|\033[31mfail\033[0m|; \
END { exit $$success }'
endef