@@ -124,11 +124,29 @@ detest: checkrnv
124
124
diff -C0 -bBw expected-results/detest_xml_relaxng.log ./
125
125
diff -C0 -bBw expected-results/detest_xml_schematron.log ./
126
126
# Note on following somewhat complicated 'diff' command:
127
- # The log file contains some lines (like "Processing…" and "Loading…") that include filepaths that are different
128
- # when executed in different environments (like the Travis server, e.g.). Thus rather than comparing the files
129
- # directly, we delete those lines first, and compare the results of deletions.
130
- bash -c "diff -C0 -bBw <(grep -vF 'dct:created' expected-results/detest_odd_schematron.svrl) \
131
- <(grep -vF 'dct :created' ./detest_odd_schematron.svrl)"
127
+ # The SVRL file contains lots of stuff, like timestamps,
128
+ # filepaths, and auto-assigned namespace prefixes that are
129
+ # different when executed in different environments (like the
130
+ # Travis server, e.g.). Thus rather than comparing the files
131
+ # directly, we extract only the <svrl:text> elements first, and
132
+ # compare the results of only that. (Yes, it would be more
133
+ # efficient to store expected-results/detest_odd_schematron.txt
134
+ # in the repo rather than generating it every time it is to be
135
+ # tested, but it seems to me this generation process is wonky
136
+ # enough that it would be difficult to reproduce every time the
137
+ # Schematron is updated.)
138
+ @xmllint --xpath '//*[local-name(.)="text"]/text()[normalize-space(.)!=""]' \
139
+ expected-results/detest_odd_schematron.svrl \
140
+ | perl -pe 's, +, ,g;' \
141
+ | egrep -v '^ *$$' \
142
+ > expected-results/detest_odd_schematron.txt
143
+ @xmllint --xpath '//*[local-name(.)="text"]/text()[normalize-space(.)!=""]' \
144
+ detest_odd_schematron.svrl \
145
+ | perl -pe 's, +, ,g;' \
146
+ | egrep -v '^ *$$' \
147
+ > detest_odd_schematron.txt
148
+ diff -C0 -bBw expected-results/detest_odd_schematron.txt ./
149
+
132
150
133
151
clean :
134
152
@echo " "
0 commit comments