Project

Profile

Help

How to connect?
Download (39.8 KB) Statistics
| Branch: | Tag: | Revision:

he / tags / 9.7.0.1 / build / testing-j.xml @ 02f8308b

1
<?xml version="1.0" encoding="UTF-8"?>
2

    
3
<project basedir="." default="all" name="Test Saxon for the Java platform"
4
    xmlns:dn="antlib:org.apache.ant.dotnet">
5

    
6
    
7
    <import file="build-constants.xml"/>  
8
    <import file="build-j.xml"/>
9

    
10

    
11
    <property name="temp-output.dir" value="${product.dir}/temp"/>
12

    
13
    <!-- build directory for this version -->
14
    <property name="build.dir" value="${repository}/build97"/>
15

    
16
    <!-- directory holding test results -->
17
    <property name="test-results.dir" value="${repository}/build97/test-results"/>
18

    
19
    <!-- directory holding Saxon qt3extra tests -->
20
    <property name="qt3extra.dir" value="${repository}/tests/qt3extra"/>
21

    
22

    
23

    
24
    <!-- ============ SAMPLES TESTS =============== -->
25

    
26
    <!-- ========= Main targets to run all samples tests =========== -->
27

    
28
    <target name="test-cmd-j" depends="test-cmd-books-j, test-cmd-knights-tour-j, test-cmd-othello-j,  test-cmd-bible-j"/>
29

    
30

    
31

    
32
    <target name="test-samples-j" depends="
33
    test-samples-s9api-j, test-samples-JAXPExamples-j, test-samples-XQJExamples-j,
34
    test-samples-XPathExample-j, test-samples-JDOM2Example-j,
35
    test-samples-PullExamples-j, test-samples-QuickValidator-j"/>
36

    
37
    <!-- TODO: 2015-11-19 fix for  test-samples-ApplyXPathJAXP-j, test-samples-SchemaValidatorExample-j -->
38

    
39
    <!-- TODO: include test-samples-SchemaValidatorHandlerExample-j, test-samples-XPathExampleSA-j -->
40

    
41

    
42
    <!-- XMarkBenchmark sample test, requires EE (takes approx 6 mins) -->
43
    <target name="test-samples-XMarkBenchmark-j" depends="samples-j" description="Run test of XMarkBenchmark sample">
44
        <exec executable="java"
45
              dir="${build-resources.dir}/samples"
46
              failonerror="true">
47
            <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes${Z}${basedir}/${build-eej.dir}/saxon9ee.jar${Z}${license.dir}"/>
48
            <arg line="ee/XMarkBenchmark"/>
49
            <arg line="-dir:${xmark.dir}"/>
50
        </exec>
51
    </target>
52

    
53

    
54
    <!-- ============ TEST SUITE TESTS =============== -->
55

    
56
    <!-- ========= Main targets to run XSLT 3.0 test suite =========== -->
57

    
58
    <!-- Running XSLT 3.0 test catalog with all editions -->
59
    <target name="xslt30-tests-j" depends="xslt30-tests-hej, xslt30-tests-pej, xslt30-tests-eej"/>
60

    
61
    <!-- generate a report of the XSLT 3.0 test suite results for different Saxon editions/configurations -->
62
    <target name="generate-xslt30-tests-report" depends="xslt30-test-results-dir">
63
        <generate-test-report test-suite="xslt30"/>
64
    </target>
65

    
66

    
67
    <!-- ========= Main targets to run QT3 test suite =========== -->
68

    
69
    <!-- Running QT3 test catalog with all editions -->
70
    <target name="qt3-tests-j" depends="qt3-tests-hej, qt3-tests-pej, qt3-tests-eej"/>
71

    
72
    <!-- generate a report of the QT3 test suite results for different Saxon editions/configurations -->
73
    <target name="generate-qt3-tests-report" depends="qt3-test-results-dir">
74
        <generate-test-report test-suite="qt3"/>
75
    </target>
76

    
77

    
78
    <!-- ========= Main targets to run QT3 test suite =========== -->
79

    
80
    <!-- Running QT3 test catalog with all editions -->
81
    <target name="qt3extra-tests-j" depends="qt3extra-tests-pej, qt3extra-tests-eej"/>
82

    
83
    <!-- generate a report of the QT3extra test suite results for different Saxon editions/configurations -->
84
    <target name="generate-qt3extra-tests-report" depends="qt3-test-results-dir">
85
        <generate-test-report test-suite="qt3extra"/>
86
    </target>
87

    
88

    
89

    
90

    
91

    
92

    
93
    <!-- ========= TARGETS FOR SAMPLES TESTS =========== -->
94

    
95
    <!-- Command line books tests -->
96
    <macrodef name="cmd-books-xslt1"
97
        description="Test command line transform1">
98
        <attribute name="version"/>
99
        <element name="other-arg" optional="yes"/>
100
        <sequential>
101
            <exec executable="java"
102
                failonerror="true">
103
                <arg line="-cp ${build-@{version}j.dir}/saxon9@{version}.jar${Z}${license.dir}"/>
104
                <arg line="net.sf.saxon.Transform"/>
105
                <arg line="-t"/>
106
                <arg line="-s:${build-resources.dir}/samples/data/books.xml"/>
107
                <arg line="-xsl:${build-resources.dir}/samples/styles/books.xsl"/>
108
                <arg line="-o:${temp-output.dir}/@{version}j/output.html"/>
109
                <other-arg/>
110
            </exec>
111
        </sequential>
112
    </macrodef>
113

    
114
    <macrodef name="cmd-books-xslt2"
115
              description="Test command line transform2">
116
        <attribute name="version"/>
117
        <sequential>
118
            <exec executable="java"
119
                  failonerror="true">
120
                <arg line="-cp ${build-@{version}j.dir}/saxon9@{version}.jar${Z}${license.dir}"/>
121
                <arg line="net.sf.saxon.Transform"/>
122
                <arg line="-t"/>
123
                <arg line="-s:${build-resources.dir}/samples/data/books.xml"/>
124
                <arg line="-xsl:${build-resources.dir}/samples/styles/books-csv.xsl"/>
125
            </exec>
126
        </sequential>
127
    </macrodef>
128
    
129
    <macrodef name="cmd-books-xquery1"
130
        description="Test command line query1">
131
        <attribute name="version"/>
132
        <sequential>
133
            <exec executable="java"
134
                failonerror="true">
135
                <arg line="-cp ${build-@{version}j.dir}/saxon9@{version}.jar${Z}${license.dir}"/>
136
                <arg line="net.sf.saxon.Query"/>   
137
                <arg line="-t"/>
138
                <arg line="-s:${build-resources.dir}/samples/data/books.xml"/>
139
                <arg line="-q:${build-resources.dir}/samples/query/books.xq"/>                
140
            </exec>
141
        </sequential>
142
    </macrodef>  
143
    
144
    <macrodef name="cmd-books-xquery2"
145
        description="Test command line query2">
146
        <attribute name="version"/>
147
        <sequential>
148
            <exec executable="java"
149
                failonerror="true">
150
                <arg line="-cp ${build-@{version}j.dir}/saxon9@{version}.jar${Z}${license.dir}"/>
151
                <arg line="net.sf.saxon.Query"/>   
152
                <arg line="-t"/>
153
                <arg line="-s:${build-resources.dir}/samples/data/books.xml"/>
154
                <arg line="-qs:saxon:line-number((//*)[last()])"/>
155
                <arg line="-l:on"/>
156
            </exec>
157
        </sequential>
158
    </macrodef> 
159
    
160
    <target name="test-cmd-books-hej" depends="samples-j">
161
        <cmd-books-xslt1 version="he">
162
            <other-arg>
163
                <arg line="top-author='Thomas Hardy'"/>
164
            </other-arg>
165
        </cmd-books-xslt1>
166
        <cmd-books-xslt2 version="he"/>
167
        <cmd-books-xquery1 version="he"/>
168
    </target>   
169
    
170
    <target name="test-cmd-books-pej" depends="samples-j">
171
        <cmd-books-xslt1 version="pe"/>
172
        <cmd-books-xslt2 version="pe"/>
173
        <cmd-books-xquery1 version="pe"/>
174
        <cmd-books-xquery2 version="pe"/>
175
    </target>
176
    
177
    <target name="test-cmd-books-eej" depends="samples-j">
178
        <cmd-books-xslt1 version="ee">
179
            <other-arg>
180
                <arg line="top-author='Jane Austen'"/>
181
            </other-arg>
182
        </cmd-books-xslt1>
183
        <cmd-books-xslt2 version="ee"/>
184
        <cmd-books-xquery1 version="ee"/>
185
        <cmd-books-xquery2 version="ee"/>
186
        <exec executable="java"
187
            failonerror="true">
188
            <arg line="-cp ${build-eej.dir}/saxon9ee.jar${Z}${license.dir}"/>
189
            <arg line="com.saxonica.Validate"/>  
190
            <arg line="-t"/>
191
            <arg line="-s:${build-resources.dir}/samples/data/books.xml"/>
192
            <arg line="-xsd:${build-resources.dir}/samples/data/books.xsd"/>
193
        </exec>
194
    </target>
195

    
196
    <target name="test-cmd-books-j" depends="test-cmd-books-hej, test-cmd-books-pej, test-cmd-books-eej"/>
197

    
198
    <!-- Command line Knight's Tour tests -->
199
    <macrodef name="cmd-knights-tour-xslt"
200
              description="Test command line Knight's Tour transform">
201
        <attribute name="version"/>
202
        <element name="other-arg" optional="yes"/>
203
        <sequential>
204
            <exec executable="java"
205
                  failonerror="true">
206
                <arg line="-cp ${license.dir}"/>
207
                <arg line="-jar ${build-@{version}j.dir}/saxon9@{version}.jar"/>
208
                <arg line="-it:main"/>
209
                <arg line="${build-resources.dir}/samples/styles/tour.xsl"/>
210
                <other-arg/>
211
                <arg line="-o:${temp-output.dir}/@{version}j/tour-t.html"/>
212
            </exec>
213
        </sequential>
214
    </macrodef>
215

    
216
    <macrodef name="cmd-knights-tour-xquery"
217
              description="Test command line Knight's Tour query">
218
        <attribute name="version"/>
219
        <element name="other-arg" optional="yes"/>
220
        <sequential>
221
            <exec executable="java"
222
                  failonerror="true">
223
                <arg line="-cp ${build-@{version}j.dir}/saxon9@{version}.jar${Z}${license.dir}"/>
224
                <arg line="net.sf.saxon.Query"/>
225
                <arg line="${build-resources.dir}/samples/query/tour.xq"/>
226
                <other-arg/>
227
                <arg line="-o:${temp-output.dir}/@{version}j/tour-q.html"/>
228
            </exec>
229
        </sequential>
230
    </macrodef>
231

    
232
    <target name="test-cmd-knights-tour-j" depends="samples-j">
233
        <cmd-knights-tour-xslt version="he">
234
            <other-arg>
235
                <arg line="start=a6"/>
236
            </other-arg>
237
        </cmd-knights-tour-xslt>
238
        <cmd-knights-tour-xslt version="pe">
239
            <other-arg>
240
                <arg line="start=g2"/>
241
            </other-arg>
242
        </cmd-knights-tour-xslt>
243
        <cmd-knights-tour-xslt version="ee"/>
244
        <!--TODO: fix xquery tests -->
245
        <!--<cmd-knights-tour-xquery version="he">
246
            <other-arg>
247
                <arg line="start=e5"/>
248
            </other-arg>
249
        </cmd-knights-tour-xquery>
250
        <cmd-knights-tour-xquery version="pe">
251
            <other-arg>
252
                <arg line="start=d2 end=42"/>
253
            </other-arg>
254
        </cmd-knights-tour-xquery>
255
        <cmd-knights-tour-xquery version="ee">
256
            <other-arg>
257
                <arg line="end=61"/>
258
            </other-arg>
259
        </cmd-knights-tour-xquery>-->
260
    </target>
261

    
262
    <!-- Command line Shakespeare transform tests -->
263
    <macrodef name="cmd-othello-xslt"
264
              description="Test command line Othello transform">
265
        <attribute name="version"/>
266
        <sequential>
267
            <exec executable="java"
268
                  dir="${build-resources.dir}/samples"
269
                  failonerror="true">
270
                <arg line="-cp ${basedir}/${build-resources.dir}/samples${Z}${basedir}/${build-@{version}j.dir}/saxon9@{version}.jar${Z}${license.dir}"/>
271
                <arg line="net.sf.saxon.Transform"/>
272
                <arg line="-t"/>
273
                <arg line="data/othello.xml"/>
274
                <arg line="styles/play.xsl"/>
275
                <arg line="dir=../../temp/@{version}j/playhtml"/>
276
            </exec>
277
        </sequential>
278
    </macrodef>
279

    
280
    <target name="test-cmd-othello-j" depends="samples-j">
281
        <cmd-othello-xslt version="he"/>
282
        <cmd-othello-xslt version="pe"/>
283
        <cmd-othello-xslt version="ee"/>
284
    </target>
285

    
286
    <!-- XPathExample sample tests -->
287
    <property name="LF" value="&#x0A;" />
288
    <macrodef name="samples-XPathExample"
289
              description="Run test of XPathExample sample">
290
        <attribute name="version"/>
291
        <attribute name="search-word"/>
292
        <attribute name="app" default="he/XPathExample"/>
293
        <sequential>
294
            <exec executable="java"
295
                  dir="${build-resources.dir}/samples"
296
                  inputstring="@{search-word}&#x0A;."
297
                  failonerror="true">
298
                <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes${Z}${basedir}/${build-@{version}j.dir}/saxon9@{version}.jar${Z}${license.dir}"/>
299
                <arg line="@{app} data/othello.xml"/>
300
            </exec>
301
        </sequential>
302
    </macrodef>
303

    
304
    <target name="test-samples-XPathExample-j" depends="samples-j">
305
        <samples-XPathExample version="he" search-word="handkerchief"/>
306
        <samples-XPathExample version="pe" search-word="castle"/>
307
        <samples-XPathExample version="ee" search-word="monkey"/>
308
        <samples-XPathExample version="he" search-word="trouble" app="he/XPathExampleDOM"/>
309
        <samples-XPathExample version="pe" search-word="William" app="he/XPathExampleDOM"/>
310
        <samples-XPathExample version="ee" search-word="cloth" app="he/XPathExampleDOM"/>
311
    </target>
312

    
313
    <!-- Command line Bible transform tests -->
314
    <macrodef name="cmd-bible-xslt"
315
              description="Test command line Bible transform">
316
        <attribute name="version"/>
317
        <sequential>
318
            <exec executable="java"
319
                  dir="${build-resources.dir}/samples"
320
                  failonerror="true">
321
                <arg line="-cp ${basedir}/${build-resources.dir}/samples${Z}${basedir}/${build-@{version}j.dir}/saxon9@{version}.jar${Z}${license.dir}"/>
322
                <arg line="net.sf.saxon.Transform"/>
323
                <arg line="-t"/>
324
                <arg line="${basedir}/../tests/junit/testdata/bible/nt/nt.xml"/>
325
                <arg line="styles/bible.xsl"/>
326
                <arg line="dir=${basedir}/${temp-output.dir}/@{version}j/biblehtml"/>
327
            </exec>
328
        </sequential>
329
    </macrodef>
330

    
331
    <target name="test-cmd-bible-j" depends="samples-j">
332
        <cmd-bible-xslt version="he"/>
333
        <cmd-bible-xslt version="pe"/>
334
        <cmd-bible-xslt version="ee"/>
335
    </target>
336

    
337

    
338

    
339
    <!-- S9APIExamples sample tests -->
340
    <macrodef name="samples-s9api"
341
        description="Run test of s9api samples">
342
        <attribute name="version"/>
343
        <attribute name="target"/>
344
        <sequential>
345
            <!--<echo message="${build-resources.dir}/samples/java/classes;${build-@{version}j.dir}/saxon9@{version}.jar;${lib.dir}/jdom.jar;${lib.dir}/xom-1.2.1.jar;${lib.dir}/dom4j-1.6.1.jar;${license.dir}"/>-->
346
            <exec executable="java"
347
                dir="${build-resources.dir}/samples"
348
                failonerror="true">
349
                <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes${Z}${basedir}/${build-@{version}j.dir}/saxon9@{version}.jar${Z}${basedir}/${lib.dir}/jdom-2.0.4.jar${Z}${basedir}/${lib.dir}/xom-1.2.1.jar${Z}${basedir}/${lib.dir}/dom4j-1.6.1.jar${Z}${license.dir}"/>
350
                <arg line="he/S9APIExamples"/>
351
                <arg line="@{target}"/>
352
            </exec>
353
        </sequential>
354
    </macrodef>
355
    
356
    <target name="test-samples-s9api-hej" depends="samples-j">
357
        <samples-s9api version="he" target="QueryA"/>
358
        <samples-s9api version="he" target="QueryB"/>
359
        <samples-s9api version="he" target="QueryC"/>
360
        <samples-s9api version="he" target="QueryD"/>
361
        <samples-s9api version="he" target="QueryE"/>
362
        <samples-s9api version="he" target="QueryF"/>
363
<!--        <samples-s9api version="he" target="QueryG"/>-->
364
<!--        <samples-s9api version="he" target="QueryUpdateA"/>-->
365
        <samples-s9api version="he" target="TransformA"/>
366
        <samples-s9api version="he" target="TransformB"/>
367
        <samples-s9api version="he" target="TransformC"/>
368
        <samples-s9api version="he" target="TransformD"/>
369
        <samples-s9api version="he" target="TransformE"/>
370
        <samples-s9api version="he" target="TransformF"/>
371
<!--        <samples-s9api version="he" target="SchemaA"/>-->
372
<!--        <samples-s9api version="he" target="SchemaB"/>-->
373
        <samples-s9api version="he" target="XPathA"/>
374
        <samples-s9api version="he" target="XPathB"/>
375
<!--        <samples-s9api version="he" target="XPathC"/>-->
376
        <samples-s9api version="he" target="XPathDOM"/>
377
<!--        <samples-s9api version="he" target="XPathJDOM"/>-->
378
<!--        <samples-s9api version="he" target="XPathXOM"/>-->
379
<!--        <samples-s9api version="he" target="XPathDOM4J"/>-->
380
        <samples-s9api version="he" target="SerializeA"/>
381
        <samples-s9api version="he" target="SerializeB"/>
382
        <samples-s9api version="he" target="SerializeC"/>
383
        <samples-s9api version="he" target="SerializeD"/>
384
    </target> 
385
        
386
    <target name="test-samples-s9api-pej" depends="samples-j">
387
        <samples-s9api version="pe" target="nonschema"/>
388
    </target>
389
    
390
    <target name="test-samples-s9api-eej" depends="samples-j">
391
        <samples-s9api version="ee" target="all"/>
392
    </target>
393

    
394
    <target name="test-samples-s9api-j" depends="test-samples-s9api-hej, test-samples-s9api-pej, test-samples-s9api-eej"/>
395

    
396
    <!-- JAXPExamples sample tests -->
397
    <macrodef name="samples-JAXPExamples"
398
              description="Run test of JAXPExamples samples">
399
        <attribute name="version"/>
400
        <attribute name="target"/>
401
        <sequential>
402
            <exec executable="java"
403
                  dir="${build-resources.dir}/samples"
404
                  failonerror="true">
405
                <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes${Z}${basedir}/${build-@{version}j.dir}/saxon9@{version}.jar${Z}${license.dir}"/>
406
                <arg line="he/JAXPExamples"/>
407
                <arg line="@{target}"/>
408
            </exec>
409
        </sequential>
410
    </macrodef>
411

    
412
    <target name="test-samples-JAXPExamples-j" depends="samples-j">
413
        <samples-JAXPExamples version="he" target="all"/>
414
        <samples-JAXPExamples version="pe" target="all"/>
415
        <samples-JAXPExamples version="ee" target="all"/>
416
    </target>
417

    
418
    <!-- XQJExamples sample tests -->
419
    <macrodef name="samples-XQJExamples"
420
              description="Run test of XQJExamples samples">
421
        <attribute name="version"/>
422
        <attribute name="target"/>
423
        <sequential>
424
            <exec executable="java"
425
                  dir="${build-resources.dir}/samples"
426
                  failonerror="true">
427
                <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes${Z}${basedir}/${build-@{version}j.dir}/saxon9@{version}.jar${Z}${basedir}/${lib.dir}/xqjapi.jar${Z}${license.dir}"/>
428
                <arg line="ee/XQJExamples"/>
429
                <arg line="@{target}"/>
430
            </exec>
431
        </sequential>
432
    </macrodef>
433

    
434
    <target name="test-samples-XQJExamples-j" depends="samples-j">
435
        <!--<samples-XQJExamples version="he" target="all"/>--> <!-- TODO xqt jar not found -->
436
        <samples-XQJExamples version="pe" target="all"/>
437
        <samples-XQJExamples version="ee" target="all"/>
438
    </target>
439

    
440
    <!-- ApplyXPathJAXP sample tests -->
441
    <macrodef name="samples-ApplyXPathJAXP"
442
        description="Run test of ApplyXPathJAXP sample">
443
        <attribute name="version"/>
444
        <attribute name="file"/>
445
        <attribute name="xpath"/>
446
        <attribute name="object-model" default=""/>
447
        <sequential>
448
            <exec executable="java"
449
                dir="${build-resources.dir}/samples"
450
                failonerror="true">
451
                <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes${Z}${basedir}/${build-@{version}j.dir}/saxon9@{version}.jar${Z}${basedir}/${lib.dir}/jdom.jar${Z}${basedir}/${lib.dir}/xom-1.2.1.jar${Z}${basedir}/${lib.dir}/dom4j-1.6.1.jar${Z}${basedir}/${lib.dir}/jdom-2.0.4.jar${Z}${license.dir}"/>
452
                <arg line="he/ApplyXPathJAXP"/>
453
                <arg line="data/@{file}"/>     
454
                <arg line="@{xpath}"/>
455
                <arg line="@{object-model}"/>
456
            </exec>
457
        </sequential>
458
    </macrodef>
459
    
460
    <target name="test-samples-ApplyXPathJAXP-hej" depends="samples-j">
461
        <samples-ApplyXPathJAXP version="he" file="books.xml" xpath="BOOKLIST/BOOKS/ITEM[1]/AUTHOR" object-model="saxon"/>
462
        <samples-ApplyXPathJAXP version="he" file="books.xml" xpath="count(//ITEM)" object-model="dom"/>
463
    </target>
464
    
465
    <target name="test-samples-ApplyXPathJAXP-pej" depends="samples-j">
466
        <samples-ApplyXPathJAXP version="pe" file="books.xml" xpath="BOOKLIST/BOOKS/ITEM[1]/AUTHOR" object-model="saxon"/>
467
        <samples-ApplyXPathJAXP version="pe" file="books.xml" xpath="count(//ITEM)" object-model="dom"/>
468
        <samples-ApplyXPathJAXP version="pe" file="books.xml" xpath="BOOKLIST/BOOKS/ITEM[1]/AUTHOR" object-model="jdom"/>
469
        <samples-ApplyXPathJAXP version="pe" file="books.xml" xpath="BOOKLIST/BOOKS/ITEM[1]/AUTHOR" object-model="xom"/>
470
        <samples-ApplyXPathJAXP version="pe" file="books.xml" xpath="BOOKLIST/BOOKS/ITEM[1]/AUTHOR" object-model="dom4j"/>
471
    </target>
472
    
473
    <target name="test-samples-ApplyXPathJAXP-eej" depends="samples-j">
474
        <samples-ApplyXPathJAXP version="ee" file="books.xml" xpath="BOOKLIST/BOOKS/ITEM[1]/AUTHOR" object-model="saxon"/>
475
        <samples-ApplyXPathJAXP version="ee" file="books.xml" xpath="count(//ITEM)" object-model="dom"/>
476
        <samples-ApplyXPathJAXP version="ee" file="books.xml" xpath="BOOKLIST/BOOKS/ITEM[1]/AUTHOR" object-model="jdom"/>
477
        <samples-ApplyXPathJAXP version="ee" file="books.xml" xpath="BOOKLIST/BOOKS/ITEM[1]/AUTHOR" object-model="xom"/>
478
        <samples-ApplyXPathJAXP version="ee" file="books.xml" xpath="BOOKLIST/BOOKS/ITEM[1]/AUTHOR" object-model="dom4j"/>
479
    </target>
480

    
481
    <target name="test-samples-ApplyXPathJAXP-j" depends="test-samples-ApplyXPathJAXP-hej, test-samples-ApplyXPathJAXP-pej, test-samples-ApplyXPathJAXP-eej"/>
482

    
483
    <!-- JDOM2Example sample tests, requires PE or EE -->
484
    <macrodef name="samples-JDOM2Example"
485
              description="Run test of JDOM2Example sample">
486
        <attribute name="version"/>
487
        <sequential>
488
            <exec executable="java"
489
                  dir="${build-resources.dir}/samples"
490
                  failonerror="true">
491
                <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes${Z}${basedir}/${build-@{version}j.dir}/saxon9@{version}.jar${Z}${basedir}/${lib.dir}/jdom-2.0.4.jar${Z}${license.dir}"/>
492
                <arg line="ee/JDOM2Example"/>
493
                <arg line="data/books.xml"/>
494
                <arg line="styles/total.xsl"/>
495
            </exec>
496
        </sequential>
497
    </macrodef>
498

    
499
    <target name="test-samples-JDOM2Example-j" depends="samples-j">
500
        <samples-JDOM2Example version="pe"/>
501
        <samples-JDOM2Example version="ee"/>
502
    </target>
503

    
504
    <!-- PullExamples sample tests, requires EE -->
505
    <target name="test-samples-PullExamples-j" description="Run test of PullExamples sample" depends="samples-j">
506
        <exec executable="java"
507
              dir="${build-resources.dir}/samples"
508
              failonerror="true">
509
            <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes${Z}${basedir}/${build-eej.dir}/saxon9ee.jar${Z}${license.dir}"/>
510
            <arg line="ee/PullExamples"/>
511
            <arg line="#"/>
512
        </exec>
513
    </target>
514

    
515
    <!-- QuickValidator sample test, requires EE -->
516
    <target name="test-samples-QuickValidator-j" description="Run test of QuickValidator sample" depends="samples-j">
517
        <exec executable="java"
518
              dir="${build-resources.dir}/samples"
519
              failonerror="true">
520
            <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes${Z}${basedir}/${build-eej.dir}/saxon9ee.jar${Z}${license.dir}"/>
521
            <arg line="ee/QuickValidator"/>
522
            <arg line="data/books.xml"/>
523
            <arg line="data/books.xsd"/>
524
        </exec>
525
    </target>
526

    
527
    <!-- SchemaValidatorExample sample test, requires EE -->
528
    <target name="test-samples-SchemaValidatorExample-j" description="Run test of SchemaValidatorExample sample" depends="samples-j">
529
        <exec executable="java"
530
              dir="${build-resources.dir}/samples"
531
              failonerror="true">
532
            <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes;${basedir}/${build-eej.dir}/saxon9ee.jar;${license.dir}"/>
533
            <arg line="ee/SchemaValidatorExample"/>
534
            <arg line="data/books.xsd"/>
535
            <arg line="data/books.xml"/>
536
        </exec>
537
    </target>
538

    
539
    <!-- SchemaValidatorHandlerExample sample test, requires EE --> <!-- TODO: fix -->
540
    <target name="test-samples-SchemaValidatorHandlerExample-j" description="Run test of SchemaValidatorHandlerExample sample" depends="samples-j">
541
        <exec executable="java"
542
              dir="${build-resources.dir}/samples"
543
              failonerror="true">
544
            <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes;${basedir}/${build-eej.dir}/saxon9ee.jar;${license.dir}"/>
545
            <arg line="ee/SchemaValidatorHandlerExample"/>
546
            <arg line="data/books.xsd"/>
547
            <arg line="data/books.xml"/>
548
        </exec>
549
    </target>
550

    
551
    <!-- XPathExampleSA sample test, requires EE --> <!-- TODO: fix -->
552
    <target name="test-samples-XPathExampleSA-j" description="Run test of XPathExampleSA sample" depends="samples-j">
553
        <exec executable="java"
554
              dir="${build-resources.dir}/samples"
555
              failonerror="true">
556
            <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes;${basedir}/${build-eej.dir}/saxon9ee.jar;${license.dir}"/>
557
            <arg line="ee/XPathExampleSA"/>
558
            <arg line="data/books.xml"/>
559
            <arg line="data/books.xsd"/>
560
        </exec>
561
    </target>
562

    
563

    
564

    
565

    
566

    
567

    
568

    
569
    <!-- ============ TARGETS TO RUN TEST SUITE TESTS =============== -->
570

    
571

    
572
    <!-- Running XSLT 3.0 test catalog -->
573

    
574
    <!-- Compile test drivers - to run test suites (XSLT, QT3, etc.) -->
575

    
576
    <target name="compile-testdrivers-j">
577
    <mkdir dir="${build.dir}/test-drivers"/>
578
        <copy todir="${build.dir}/test-drivers">
579
            <fileset dir="${source-eej.dir}">
580
                <include name="com/saxonica/testdriver/*.java"/>
581
            </fileset>
582
            <fileset dir="${source-hej.dir}">
583
                <include name="net/sf/saxon/testdriver/*.java"/>
584
            </fileset>
585
        </copy>
586
    <javac debug="true" debuglevel="${build.debuglevel}"
587
           destdir="${build.dir}/test-drivers"
588
           srcdir="${build.dir}/test-drivers" source="${build.compiler.source}"
589
           target="${build.compiler.target}" includeantruntime="false">
590
        <include name="com/saxonica/testdriver/*.java"/>
591
        <include name="net/sf/saxon/testdriver/*.java"/>
592
        <classpath>
593
            <path refid="classpath-samples"/>
594
        </classpath>
595
    </javac>
596
    </target>
597

    
598
    <!-- generating reports of different test suites (XSLT, QT3) results for different Saxon editions/configurations -->
599
    <macrodef name="generate-test-report"
600
              description="Generate report from named test suite results">
601
        <attribute name="test-suite"/>
602
        <sequential>
603
            <exec executable="java"
604
                  failonerror="true">
605
                <arg line="-cp ${build-eej.dir}/saxon9ee.jar${Z}${license.dir}"/>
606
                <arg line="net.sf.saxon.Transform"/>
607
                <arg line="-t"/>
608
                <arg line="-s:${build.dir}/build.xml"/>
609
                <arg line="-xsl:${test-results.dir}/@{test-suite}/report.xsl"/>
610
                <arg line="-o:${test-results.dir}/@{test-suite}/${DSTAMP}/report.xml"/>
611
            </exec>
612
        </sequential>
613
    </macrodef>
614

    
615

    
616
    <!-- XSLT 3.0 test suite -->
617

    
618
    <!-- Create date-stamped directory for new XSLT 3.0 test results, containing exceptions file -->
619
    <target name="xslt30-test-results-dir">
620
        <tstamp/>
621
        <mkdir dir="${test-results.dir}/xslt30/${DSTAMP}"/>
622
        <mkdir dir="${test-results.dir}/xslt30/${DSTAMP}/results"/>
623
        <copy file="${test-results.dir}/xslt30/exceptions.xml"
624
              tofile="${test-results.dir}/xslt30/${DSTAMP}/exceptions.xml">
625
        </copy>
626
    </target>
627

    
628
    <!-- Running XSLT 3.0 test catalog -->
629
    <macrodef name="xslt30-tests"
630
              description="Run XSLT 3.0 test catalog">
631
        <attribute name="version"/>
632
        <attribute name="lang"/>
633
        <attribute name="bc" default=""/>
634
        <attribute name="test-driver" default="com.saxonica.testdriver.Xslt30TestSuiteDriver"/>
635
        <element name="other-arg" optional="yes"/>
636
        <sequential>
637
            <exec executable="java"
638
                  failonerror="true">
639
                <arg line="-Xmx1G"/>
640
                <arg line="-cp ${build.dir}/test-drivers${Z}${build-@{version}j.dir}/saxon9@{version}.jar${Z}${license.dir}${Z}${product.dir}/pej/saxon9-icu.jar"/>
641
                <!--                <arg line="-cp ${build.dir}/test-drivers;${build-@{version}j.dir}/saxon9@{version}.jar;${license.dir}"/>-->
642
                <arg line="@{test-driver}"/>
643
                <arg line="${xslt30.dir}"/>
644
                <arg line="${xslt30.dir}/catalog.xml"/>
645
                <arg line="-o:${test-results.dir}/xslt30/${DSTAMP}"/>
646
                <arg line="-lang:XT@{lang}0"/>
647
                <arg line= "-ps:off"/>
648
                <!--<arg line="-s:as"/>
649
                <arg line="-t:as-0101"/>-->
650
                <arg line="-debug"/>
651
                <other-arg/>            </exec>
652
            <copy file="${test-results.dir}/xslt30/${DSTAMP}/results_XSLT@{lang}.0_${version}.xml"
653
                  tofile="${test-results.dir}/xslt30/${DSTAMP}/results/saxon-@{version}-XT@{lang}0@{bc}.xml">
654
            </copy>
655
        </sequential>
656
    </macrodef>
657

    
658
    <!-- Running XSLT 3.0 test catalog with HE -->
659
    <target name="xslt30-tests-hej" depends="compile-testdrivers-j, xslt30-test-results-dir">
660
        <xslt30-tests version="he" lang="2" test-driver="net.sf.saxon.testdriver.Xslt30TestSuiteDriverHE"/>
661
        <!-- Saxon-HE does not support XSLT3.0-->
662
    </target>
663
 
664
    <!-- Running XSLT 3.0 test catalog with PE -->
665
    <target name="xslt30-tests-pej" depends="compile-testdrivers-j, xslt30-test-results-dir">
666
        <!--<xslt30-tests version="pe" lang="2"/>-->
667
        <xslt30-tests version="pe" lang="3"/>
668
    </target>
669

    
670
    <!-- Running XSLT 3.0 test catalog with EE -->
671
    <target name="xslt30-tests-eej" depends="compile-testdrivers-j, xslt30-test-results-dir">
672
        <xslt30-tests version="ee" lang="2" bc="-on">
673
            <other-arg>
674
                <arg line= "-bytecode:on"/>
675
            </other-arg>
676
        </xslt30-tests>
677
        <!--<xslt30-tests version="ee" lang="2" bc="-off">
678
            <other-arg>
679
                <arg line= "-bytecode:off"/>
680
            </other-arg>
681
        </xslt30-tests>-->
682
        <!--<xslt30-tests version="ee" lang="3" bc="-on">
683
            <other-arg>
684
                <arg line= "-bytecode:on"/>
685
            </other-arg>
686
        </xslt30-tests>-->
687
        <!--<xslt30-tests version="ee" lang="3" bc="-off">
688
            <other-arg>
689
                <arg line= "-bytecode:off"/>
690
            </other-arg>
691
        </xslt30-tests>-->
692
    </target>
693

    
694

    
695

    
696
    <!-- QT3 test suites -->
697

    
698
    <!-- Create date-stamped directory for new QT3 test results -->
699
    <target name="qt3-test-results-dir">
700
        <tstamp/>
701
        <mkdir dir="${test-results.dir}/qt3/${DSTAMP}"/>
702
        <mkdir dir="${test-results.dir}/qt3/${DSTAMP}/results"/>
703
        <copy file="${test-results.dir}/qt3/exceptions.xml"
704
              tofile="${test-results.dir}/qt3/${DSTAMP}/exceptions.xml">
705
        </copy>
706
        <mkdir dir="${test-results.dir}/qt3extra/${DSTAMP}"/>
707
        <mkdir dir="${test-results.dir}/qt3extra/${DSTAMP}/results"/>
708
    </target>
709

    
710
    <!-- Running QT3 test catalog -->
711
    <property name="XQ31" value="XQuery3.1"/>
712
    <property name="XP31" value="XPath3.1"/>
713
    <property name="XQ30" value="XQuery3.0"/>
714
    <property name="XP30" value="XPath3.0"/>
715
    <property name="XQ10" value="XQuery1.0"/>
716
    <property name="XP20" value="XPath2.0"/>
717
    <macrodef name="qt3-tests"
718
              description="Run QT3 test catalog">
719
        <attribute name="catalog"/>
720
        <attribute name="version"/>
721
        <attribute name="lang"/>
722
        <attribute name="bc" default=""/>
723
        <attribute name="test-driver" default="com.saxonica.testdriver.QT3TestDriverPE"/>
724
        <element name="other-arg" optional="yes"/>
725
        <sequential>
726
            <exec executable="java"
727
                  failonerror="true">
728
                <arg line="-cp ${build.dir}/test-drivers${Z}${build-@{version}j.dir}/saxon9@{version}.jar${Z}${license.dir}${Z}${lib.dir}/mail.jar${Z}${build-@{version}j.dir}/saxon9-icu.jar${Z}${build-@{version}j.dir}/saxon9-sql.jar"/>
729
                <arg line="@{test-driver}"/>
730
                <arg line="${@{catalog}.dir}"/>
731
                <arg line="${@{catalog}.dir}/catalog.xml"/>
732
                <arg line="-o:${test-results.dir}/@{catalog}/${DSTAMP}"/>
733
                <arg line="-lang:@{lang}"/>
734
                <other-arg/>
735
            </exec>
736
            <copy file="${test-results.dir}/@{catalog}/${DSTAMP}/results_${@{lang}}_${version}.xml"
737
                  tofile="${test-results.dir}/@{catalog}/${DSTAMP}/results/saxon-@{version}-@{lang}@{bc}.xml">
738
            </copy>
739
        </sequential>
740
    </macrodef>
741

    
742
    <!-- Running W3C QT3 test catalog with HE -->
743
    <target name="qt3-tests-hej" depends="compile-testdrivers-j, qt3-test-results-dir">
744
        <qt3-tests catalog="qt3" version="he" lang="XP20" test-driver="net.sf.saxon.testdriver.QT3TestDriverHE"/>
745
        <qt3-tests catalog="qt3" version="he" lang="XP30" test-driver="net.sf.saxon.testdriver.QT3TestDriverHE"/>
746
        <qt3-tests catalog="qt3" version="he" lang="XP31" test-driver="net.sf.saxon.testdriver.QT3TestDriverHE"/>
747
        <qt3-tests catalog="qt3" version="he" lang="XQ10" test-driver="net.sf.saxon.testdriver.QT3TestDriverHE"/>
748
        <qt3-tests catalog="qt3" version="he" lang="XQ30" test-driver="net.sf.saxon.testdriver.QT3TestDriverHE"/>
749
        <qt3-tests catalog="qt3" version="he" lang="XQ31" test-driver="net.sf.saxon.testdriver.QT3TestDriverHE"/>
750
    </target>
751

    
752
    <!-- Running W3C QT3 test catalog with PE -->
753
    <target name="qt3-tests-pej" depends="compile-testdrivers-j, qt3-test-results-dir">
754
        <!--<qt3-tests catalog="qt3" version="pe" lang="XP20"/>-->
755
        <qt3-tests catalog="qt3" version="pe" lang="XP30"/>
756
        <!--<qt3-tests catalog="qt3" version="pe" lang="XP31"/>-->
757
        <!--<qt3-tests catalog="qt3" version="pe" lang="XQ10"/>
758
        <qt3-tests catalog="qt3" version="pe" lang="XQ30"/>-->
759
        <!--<qt3-tests catalog="qt3" version="pe" lang="XQ31"/>-->
760
    </target>
761

    
762
    <!-- Running W3C QT3 test catalog with EE 
763
         These are split into 4 subtargets such that each can be run independently -->
764
    <target name="qt3-tests-eej" depends="compile-testdrivers-j, qt3-test-results-dir, 
765
        qt3-tests-eej-XP20, qt3-tests-eej-XP30, qt3-tests-eej-XQ10, qt3-tests-eej-XQ30">
766
    </target>
767

    
768
    <target name="qt3-tests-eej-XP20" depends="compile-testdrivers-j, qt3-test-results-dir">        
769
        <qt3-tests catalog="qt3" version="ee" lang="XP20" bc="-off">
770
            <other-arg>
771
                <arg line= "-bytecode:off"/>
772
            </other-arg>
773
        </qt3-tests>
774
        <qt3-tests catalog="qt3" version="ee" lang="XP20" bc="-on">
775
            <other-arg>
776
                <arg line= "-bytecode:on"/>
777
            </other-arg>
778
        </qt3-tests>
779
    </target>
780
    <target name="qt3-tests-eej-XQ10" depends="compile-testdrivers-j, qt3-test-results-dir">        
781
        <qt3-tests catalog="qt3" version="ee" lang="XQ10" bc="-off">
782
            <other-arg>
783
                <arg line= "-bytecode:off"/>
784
            </other-arg>
785
        </qt3-tests>
786
        <qt3-tests catalog="qt3" version="ee" lang="XQ10" bc="-on">
787
            <other-arg>
788
                <arg line= "-bytecode:on"/>
789
            </other-arg>
790
        </qt3-tests>
791
    </target>
792
    <target name="qt3-tests-eej-XP30" depends="compile-testdrivers-j, qt3-test-results-dir">        
793
        <qt3-tests catalog="qt3" version="ee" lang="XP30" bc="-off">
794
            <other-arg>
795
                <arg line= "-bytecode:off"/>
796
            </other-arg>
797
        </qt3-tests>
798
        <qt3-tests catalog="qt3" version="ee" lang="XP30" bc="-on">
799
            <other-arg>
800
                <arg line= "-bytecode:on"/>
801
            </other-arg>
802
        </qt3-tests>
803
    </target>
804
    <target name="qt3-tests-eej-XQ30" depends="compile-testdrivers-j, qt3-test-results-dir">        
805
        <qt3-tests catalog="qt3" version="ee" lang="XQ30" bc="-off">
806
            <other-arg>
807
                <arg line= "-bytecode:off"/>
808
            </other-arg>
809
        </qt3-tests>
810
        <qt3-tests catalog="qt3" version="ee" lang="XQ30" bc="-on">
811
            <other-arg>
812
                <arg line= "-bytecode:on"/>
813
            </other-arg>
814
        </qt3-tests>
815
        <qt3-tests catalog="qt3" version="ee" lang="XQ30" bc="-on-unfolded">
816
            <other-arg>
817
                <arg line= "-bytecode:on"/>
818
                <arg line="-unfolded:yes"/>
819
            </other-arg>
820
        </qt3-tests>
821
    </target>
822
    <target name="qt3-tests-eej-XP31" depends="compile-testdrivers-j, qt3-test-results-dir">
823
        <qt3-tests catalog="qt3" version="ee" lang="XP31" bc="-off">
824
            <other-arg>
825
                <arg line= "-bytecode:off"/>
826
            </other-arg>
827
        </qt3-tests>
828
        <qt3-tests catalog="qt3" version="ee" lang="XP31" bc="-on">
829
            <other-arg>
830
                <arg line= "-bytecode:on"/>
831
            </other-arg>
832
        </qt3-tests>
833
    </target>
834
    <target name="qt3-tests-eej-XQ31" depends="compile-testdrivers-j, qt3-test-results-dir">
835
        <!--<qt3-tests catalog="qt3" version="ee" lang="XQ31" bc="-off">
836
            <other-arg>
837
                <arg line= "-bytecode:off"/>
838
            </other-arg>
839
        </qt3-tests>-->
840
        <qt3-tests catalog="qt3" version="ee" lang="XQ31" bc="-on">
841
            <other-arg>
842
                <arg line= "-bytecode:on"/>
843
            </other-arg>
844
        </qt3-tests>
845
        <!--<qt3-tests catalog="qt3" version="ee" lang="XQ31" bc="-on-unfolded">
846
            <other-arg>
847
                <arg line= "-bytecode:on"/>
848
                <arg line="-unfolded:yes"/>
849
            </other-arg>
850
        </qt3-tests>-->
851
    </target>
852
    
853

    
854

    
855

    
856

    
857
    <!-- Running Saxon's QT3extra test catalog with HE -->
858
    <!--<target name="qt3extra-tests-hej" depends="compile-testdrivers-j, qt3-test-results-dir">
859
        <qt3-tests catalog="qt3extra" version="he" lang="XP20" test-driver="net.sf.saxon.testdriver.QT3TestDriverHE"/>
860
        <qt3-tests catalog="qt3extra" version="he" lang="XP30" test-driver="net.sf.saxon.testdriver.QT3TestDriverHE"/>
861
        <qt3-tests catalog="qt3extra" version="he" lang="XQ10" test-driver="net.sf.saxon.testdriver.QT3TestDriverHE"/>
862
        <qt3-tests catalog="qt3extra" version="he" lang="XQ30" test-driver="net.sf.saxon.testdriver.QT3TestDriverHE"/>
863
    </target>-->
864

    
865
    <!-- Running Saxon's QT3extra test catalog with PE -->
866
    <target name="qt3extra-tests-pej" depends="compile-testdrivers-j, qt3-test-results-dir">
867
        <qt3-tests catalog="qt3extra" version="pe" lang="XP20"/>
868
        <qt3-tests catalog="qt3extra" version="pe" lang="XP30"/>
869
        <qt3-tests catalog="qt3extra" version="pe" lang="XQ10"/>
870
        <qt3-tests catalog="qt3extra" version="pe" lang="XQ30"/>
871
    </target>
872

    
873
    <!-- Running Saxon's QT3extra test catalog with EE -->
874
    <target name="qt3extra-tests-eej" depends="compile-testdrivers-j, qt3-test-results-dir">
875
        <qt3-tests catalog="qt3extra" version="ee" lang="XP20" bc="-off">
876
            <other-arg>
877
                <arg line= "-bytecode:off"/>
878
            </other-arg>
879
        </qt3-tests>
880
        <qt3-tests catalog="qt3extra" version="ee" lang="XP20" bc="-on">
881
            <other-arg>
882
                <arg line= "-bytecode:on"/>
883
            </other-arg>
884
        </qt3-tests>
885
        <qt3-tests catalog="qt3extra" version="ee" lang="XP30" bc="-off">
886
            <other-arg>
887
                <arg line= "-bytecode:off"/>
888
            </other-arg>
889
        </qt3-tests>
890
        <qt3-tests catalog="qt3extra" version="ee" lang="XP30" bc="-on">
891
            <other-arg>
892
                <arg line= "-bytecode:on"/>
893
            </other-arg>
894
        </qt3-tests>
895
        <qt3-tests catalog="qt3extra" version="ee" lang="XQ10" bc="-off">
896
            <other-arg>
897
                <arg line= "-bytecode:off"/>
898
            </other-arg>
899
        </qt3-tests>
900
        <qt3-tests catalog="qt3extra" version="ee" lang="XQ10" bc="-on">
901
            <other-arg>
902
                <arg line= "-bytecode:on"/>
903
            </other-arg>
904
        </qt3-tests>
905
        <qt3-tests catalog="qt3extra" version="ee" lang="XQ30" bc="-off">
906
            <other-arg>
907
                <arg line= "-bytecode:off"/>
908
            </other-arg>
909
        </qt3-tests>
910
        <qt3-tests catalog="qt3extra" version="ee" lang="XQ30" bc="-on">
911
            <other-arg>
912
                <arg line= "-bytecode:on"/>
913
            </other-arg>
914
        </qt3-tests>
915
    </target>
916

    
917

    
918

    
919
    
920
</project>
(7-7/7)