Skip to content

Commit 0104604

Browse files
committed
Various fixes to detest:
* Compare SVRL output of Schematron validation of ODD file. * Deleted redundant "testingSpan" section of XML file (which I think I accidentally introduced on a previous attempt to merge in dev). * Updated expected-results/ accordingly.
1 parent 7d808ad commit 0104604

7 files changed

+1181
-257
lines changed

P5/Test/Makefile

+4-7
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,10 @@ detest: checkrnv
106106
@echo " "
107107
@echo "--------- work on target $@ ---------"
108108
@echo BUILD: Test file with deliberate mistakes
109-
# Note that output below is called 'detest_odd_schematron' even though
110-
# detest.xml is validated against both RelaxNG and Schematron, because
111-
# if there is a RelaxNG error the build dies and there is no output at
112-
# all. (So if there is any output, it is Schematron messages.)
113109
@echo "--- run ant to validate ODD file (./detest.odd) against p5odds.rng & p5odds.isosch:"
114110
$(ANT) -f antruntest.xml -Doutputname=detest -DoddFile=detest.odd validateodd > detest_odd_schematron.log 2>&1
111+
# If a RELAX NG error is found by the above cmd, it dies, and this (the "detest") target fails.
112+
# Any Schematron errors that are found are written to detest_odd_schematron.svrl.
115113
@echo "--- run ant to compile ODD file into RelaxNG and Schematron (detest.odd → detest.rng & detest.isosch):"
116114
$(ANT) -f antruntest.xml -Doutputname=detest -DoddFile=detest.odd compileodd rng isoschematron
117115
@echo "--- convert RelaxNG to compact syntax with trang (./detest.rng → ./detest.rnc):"
@@ -129,9 +127,8 @@ detest: checkrnv
129127
# The log file contains some lines (like "Processing…" and "Loading…") that include filepaths that are different
130128
# when executed in different environments (like the Travis server, e.g.). Thus rather than comparing the files
131129
# directly, we delete those lines first, and compare the results of deletions.
132-
bash -c "diff -C0 -bBw \
133-
<(grep -F '[xslt]' expected-results/detest_odd_schematron.log | grep -Ev 'xslt\] Processing.*detest.odd|xslt\] Loading.*.isosch.xsl') \
134-
<(grep -F '[xslt]' ./detest_odd_schematron.log | grep -Ev 'xslt\] Processing.*detest.odd|xslt\] Loading.*.isosch.xsl')"
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)"
135132

136133
clean:
137134
@echo " "

P5/Test/antruntest.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,12 @@
176176
<echo level="info">Validate ${oddFile} as ODD ...</echo>
177177
<echo level="info"> ... against RelaxNG (../p5odds.rng) with jing ...</echo>
178178
<runjing rngfile="../p5odds.rng" file="${oddFile}" checkid="${DTDcompat}"/>
179-
<echo level="info"> ... against Schematron (../p5odds.isosch.xsl) with Saaxon via trax</echo>
179+
<echo level="info"> ... against Schematron (../p5odds.isosch.xsl) with Saxon via trax</echo>
180180
<xslt processor="trax"
181181
force="yes"
182182
style="../p5odds.isosch.xsl"
183183
in="${oddFile}"
184-
out="/dev/null">
184+
out="detest_odd_schematron.svrl">
185185
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
186186
</xslt>
187187
</target>

P5/Test/detest.xml

-9
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,6 @@
116116
</list>
117117
</p>
118118

119-
<div type="testingSpan">
120-
<p><del>This has some content which is OK </del>
121-
<delSpan spanTo="#ds1"/>This one doesn't<anchor xml:id="ds1"/> but
122-
that's also OK.
123-
<delSpan/> That last one is illegal
124-
<delSpan spanTo="#ds2"/> as are that one
125-
<delSpan spanTo="notMeaningful"/> and that one</p>
126-
</div>
127-
128119
<div>
129120
<p>Added by MDH. This tests the Schematron constraint that any
130121
element with <att>calendar</att> must have some textual

P5/Test/expected-results/detest_odd_schematron.log

-55
This file was deleted.

0 commit comments

Comments
 (0)