Project

Profile

Help

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

he / latest9.6 / 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
    <!-- directory holding test results -->
14
    <property name="test-results.dir" value="${repository}/build96/test-results"/>
15

    
16
    <!-- directory holding Saxon qt3extra tests -->
17
    <property name="qt3extra.dir" value="${repository}/tests/qt3extra"/>
18

    
19

    
20

    
21

    
22
    <!-- Samples tests -->
23

    
24
    <!-- Command line books tests -->
25
    <macrodef name="cmd-books-xslt1"
26
        description="Test command line transform1">
27
        <attribute name="version"/>
28
        <element name="other-arg" optional="yes"/>
29
        <sequential>
30
            <exec executable="java"
31
                failonerror="true">
32
                <arg line="-cp ${build-@{version}j.dir}/saxon9@{version}.jar;${license.dir}"/>
33
                <arg line="net.sf.saxon.Transform"/>
34
                <arg line="-t"/>
35
                <arg line="-s:${build-resources.dir}/samples/data/books.xml"/>
36
                <arg line="-xsl:${build-resources.dir}/samples/styles/books.xsl"/>
37
                <arg line="-o:${temp-output.dir}/@{version}j/output.html"/>
38
                <other-arg/>
39
            </exec>
40
        </sequential>
41
    </macrodef>
42

    
43
    <macrodef name="cmd-books-xslt2"
44
              description="Test command line transform2">
45
        <attribute name="version"/>
46
        <sequential>
47
            <exec executable="java"
48
                  failonerror="true">
49
                <arg line="-cp ${build-@{version}j.dir}/saxon9@{version}.jar;${license.dir}"/>
50
                <arg line="net.sf.saxon.Transform"/>
51
                <arg line="-t"/>
52
                <arg line="-s:${build-resources.dir}/samples/data/books.xml"/>
53
                <arg line="-xsl:${build-resources.dir}/samples/styles/books-csv.xsl"/>
54
            </exec>
55
        </sequential>
56
    </macrodef>
57
    
58
    <macrodef name="cmd-books-xquery1"
59
        description="Test command line query1">
60
        <attribute name="version"/>
61
        <sequential>
62
            <exec executable="java"
63
                failonerror="true">
64
                <arg line="-cp ${build-@{version}j.dir}/saxon9@{version}.jar;${license.dir}"/>
65
                <arg line="net.sf.saxon.Query"/>   
66
                <arg line="-t"/>
67
                <arg line="-s:${build-resources.dir}/samples/data/books.xml"/>
68
                <arg line="-q:${build-resources.dir}/samples/query/books.xq"/>                
69
            </exec>
70
        </sequential>
71
    </macrodef>  
72
    
73
    <macrodef name="cmd-books-xquery2"
74
        description="Test command line query2">
75
        <attribute name="version"/>
76
        <sequential>
77
            <exec executable="java"
78
                failonerror="true">
79
                <arg line="-cp ${build-@{version}j.dir}/saxon9@{version}.jar;${license.dir}"/>
80
                <arg line="net.sf.saxon.Query"/>   
81
                <arg line="-t"/>
82
                <arg line="-s:${build-resources.dir}/samples/data/books.xml"/>
83
                <arg line="-qs:saxon:line-number((//*)[last()])"/>
84
                <arg line="-l:on"/>
85
            </exec>
86
        </sequential>
87
    </macrodef> 
88
    
89
    <target name="test-cmd-books-hej" depends="samples-j">
90
        <cmd-books-xslt1 version="he">
91
            <other-arg>
92
                <arg line="top-author='Thomas Hardy'"/>
93
            </other-arg>
94
        </cmd-books-xslt1>
95
        <cmd-books-xslt2 version="he"/>
96
        <cmd-books-xquery1 version="he"/>
97
    </target>   
98
    
99
    <target name="test-cmd-books-pej" depends="samples-j">
100
        <cmd-books-xslt1 version="pe"/>
101
        <cmd-books-xslt2 version="pe"/>
102
        <cmd-books-xquery1 version="pe"/>
103
        <cmd-books-xquery2 version="pe"/>
104
    </target>
105
    
106
    <target name="test-cmd-books-eej" depends="samples-j">
107
        <cmd-books-xslt1 version="ee">
108
            <other-arg>
109
                <arg line="top-author='Jane Austen'"/>
110
            </other-arg>
111
        </cmd-books-xslt1>
112
        <cmd-books-xslt2 version="ee"/>
113
        <cmd-books-xquery1 version="ee"/>
114
        <cmd-books-xquery2 version="ee"/>
115
        <exec executable="java"
116
            failonerror="true">
117
            <arg line="-cp ${build-eej.dir}/saxon9ee.jar;${license.dir}"/>
118
            <arg line="com.saxonica.Validate"/>  
119
            <arg line="-t"/>
120
            <arg line="-s:${build-resources.dir}/samples/data/books.xml"/>
121
            <arg line="-xsd:${build-resources.dir}/samples/data/books.xsd"/>
122
        </exec>
123
    </target>
124

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

    
127
    <!-- Command line Knight's Tour tests -->
128
    <macrodef name="cmd-knights-tour-xslt"
129
              description="Test command line Knight's Tour transform">
130
        <attribute name="version"/>
131
        <element name="other-arg" optional="yes"/>
132
        <sequential>
133
            <exec executable="java"
134
                  failonerror="true">
135
                <arg line="-cp ${license.dir}"/>
136
                <arg line="-jar ${build-@{version}j.dir}/saxon9@{version}.jar"/>
137
                <arg line="-it:main"/>
138
                <arg line="${build-resources.dir}/samples/styles/tour.xsl"/>
139
                <other-arg/>
140
                <arg line="-o:${temp-output.dir}/@{version}j/tour-t.html"/>
141
            </exec>
142
        </sequential>
143
    </macrodef>
144

    
145
    <macrodef name="cmd-knights-tour-xquery"
146
              description="Test command line Knight's Tour query">
147
        <attribute name="version"/>
148
        <element name="other-arg" optional="yes"/>
149
        <sequential>
150
            <exec executable="java"
151
                  failonerror="true">
152
                <arg line="-cp ${build-@{version}j.dir}/saxon9@{version}.jar;${license.dir}"/>
153
                <arg line="net.sf.saxon.Query"/>
154
                <arg line="${build-resources.dir}/samples/query/tour.xq"/>
155
                <other-arg/>
156
                <arg line="-o:${temp-output.dir}/@{version}j/tour-q.html"/>
157
            </exec>
158
        </sequential>
159
    </macrodef>
160

    
161
    <target name="test-cmd-knights-tour-j" depends="samples-j">
162
        <cmd-knights-tour-xslt version="he">
163
            <other-arg>
164
                <arg line="start=a6"/>
165
            </other-arg>
166
        </cmd-knights-tour-xslt>
167
        <cmd-knights-tour-xslt version="pe">
168
            <other-arg>
169
                <arg line="start=g2"/>
170
            </other-arg>
171
        </cmd-knights-tour-xslt>
172
        <cmd-knights-tour-xslt version="ee"/>
173
        <!--TODO: fix xquery tests -->
174
        <!--<cmd-knights-tour-xquery version="he">
175
            <other-arg>
176
                <arg line="start=e5"/>
177
            </other-arg>
178
        </cmd-knights-tour-xquery>
179
        <cmd-knights-tour-xquery version="pe">
180
            <other-arg>
181
                <arg line="start=d2 end=42"/>
182
            </other-arg>
183
        </cmd-knights-tour-xquery>
184
        <cmd-knights-tour-xquery version="ee">
185
            <other-arg>
186
                <arg line="end=61"/>
187
            </other-arg>
188
        </cmd-knights-tour-xquery>-->
189
    </target>
190

    
191
    <!-- Command line Shakespeare transform tests -->
192
    <macrodef name="cmd-othello-xslt"
193
              description="Test command line Othello transform">
194
        <attribute name="version"/>
195
        <sequential>
196
            <exec executable="java"
197
                  dir="${build-resources.dir}/samples"
198
                  failonerror="true">
199
                <arg line="-cp ${basedir}/${build-resources.dir}/samples;${basedir}/${build-@{version}j.dir}/saxon9@{version}.jar;${license.dir}"/>
200
                <arg line="net.sf.saxon.Transform"/>
201
                <arg line="-t"/>
202
                <arg line="data/othello.xml"/>
203
                <arg line="styles/play.xsl"/>
204
                <arg line="dir=../../temp/@{version}j/playhtml"/>
205
            </exec>
206
        </sequential>
207
    </macrodef>
208

    
209
    <target name="test-cmd-othello-j" depends="samples-j">
210
        <cmd-othello-xslt version="he"/>
211
        <cmd-othello-xslt version="pe"/>
212
        <cmd-othello-xslt version="ee"/>
213
    </target>
214

    
215
    <!-- XPathExample sample tests -->
216
    <property name="LF" value="&#x0A;" />
217
    <macrodef name="samples-XPathExample"
218
              description="Run test of XPathExample sample">
219
        <attribute name="version"/>
220
        <attribute name="search-word"/>
221
        <attribute name="app" default="XPathExample"/>
222
        <sequential>
223
            <exec executable="java"
224
                  dir="${build-resources.dir}/samples"
225
                  inputstring="@{search-word}&#x0A;."
226
                  failonerror="true">
227
                <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes;${basedir}/${build-@{version}j.dir}/saxon9@{version}.jar;${license.dir}"/>
228
                <arg line="@{app} data/othello.xml"/>
229
            </exec>
230
        </sequential>
231
    </macrodef>
232

    
233
    <target name="test-samples-XPathExample-j" depends="samples-j">
234
        <samples-XPathExample version="he" search-word="handkerchief"/>
235
        <samples-XPathExample version="pe" search-word="castle"/>
236
        <samples-XPathExample version="ee" search-word="monkey"/>
237
        <samples-XPathExample version="he" search-word="trouble" app="XPathExampleDOM"/>
238
        <samples-XPathExample version="pe" search-word="William" app="XPathExampleDOM"/>
239
        <samples-XPathExample version="ee" search-word="cloth" app="XPathExampleDOM"/>
240
    </target>
241

    
242
    <!-- Command line Bible transform tests -->
243
    <macrodef name="cmd-bible-xslt"
244
              description="Test command line Bible transform">
245
        <attribute name="version"/>
246
        <sequential>
247
            <exec executable="java"
248
                  dir="${build-resources.dir}/samples"
249
                  failonerror="true">
250
                <arg line="-cp ${basedir}/${build-resources.dir}/samples;${basedir}/${build-@{version}j.dir}/saxon9@{version}.jar;${license.dir}"/>
251
                <arg line="net.sf.saxon.Transform"/>
252
                <arg line="-t"/>
253
                <arg line="C:/Users/debbie/Documents/Work/Private/Saxon-Dev/bible/nt/nt.xml"/>
254
                <arg line="styles/bible.xsl"/>
255
                <arg line="dir=${basedir}/${temp-output.dir}/@{version}j/biblehtml"/>
256
            </exec>
257
        </sequential>
258
    </macrodef>
259

    
260
    <target name="test-cmd-bible-j" depends="samples-j">
261
        <cmd-bible-xslt version="he"/>
262
        <cmd-bible-xslt version="pe"/>
263
        <cmd-bible-xslt version="ee"/>
264
    </target>
265

    
266

    
267

    
268
    <!-- S9APIExamples sample tests -->
269
    <macrodef name="samples-s9api"
270
        description="Run test of s9api samples">
271
        <attribute name="version"/>
272
        <attribute name="target"/>
273
        <sequential>
274
            <!--<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}"/>-->
275
            <exec executable="java"
276
                dir="${build-resources.dir}/samples"
277
                failonerror="true">
278
                <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes;${basedir}/${build-@{version}j.dir}/saxon9@{version}.jar;${basedir}/${lib.dir}/jdom-2.0.4.jar;${basedir}/${lib.dir}/xom-1.2.1.jar;${basedir}/${lib.dir}/dom4j-1.6.1.jar;${license.dir}"/>
279
                <arg line="S9APIExamples"/>  
280
                <arg line="@{target}"/>
281
            </exec>
282
        </sequential>
283
    </macrodef>
284
    
285
    <target name="test-samples-s9api-hej" depends="samples-j">
286
        <samples-s9api version="he" target="QueryA"/>
287
        <samples-s9api version="he" target="QueryB"/>
288
        <samples-s9api version="he" target="QueryC"/>
289
        <samples-s9api version="he" target="QueryD"/>
290
        <samples-s9api version="he" target="QueryE"/>
291
        <samples-s9api version="he" target="QueryF"/>
292
<!--        <samples-s9api version="he" target="QueryG"/>-->
293
<!--        <samples-s9api version="he" target="QueryUpdateA"/>-->
294
        <samples-s9api version="he" target="TransformA"/>
295
        <samples-s9api version="he" target="TransformB"/>
296
        <samples-s9api version="he" target="TransformC"/>
297
        <samples-s9api version="he" target="TransformD"/>
298
        <samples-s9api version="he" target="TransformE"/>
299
        <samples-s9api version="he" target="TransformF"/>
300
<!--        <samples-s9api version="he" target="SchemaA"/>-->
301
<!--        <samples-s9api version="he" target="SchemaB"/>-->
302
        <samples-s9api version="he" target="XPathA"/>
303
        <samples-s9api version="he" target="XPathB"/>
304
<!--        <samples-s9api version="he" target="XPathC"/>-->
305
        <samples-s9api version="he" target="XPathDOM"/>
306
<!--        <samples-s9api version="he" target="XPathJDOM"/>-->
307
<!--        <samples-s9api version="he" target="XPathXOM"/>-->
308
<!--        <samples-s9api version="he" target="XPathDOM4J"/>-->
309
        <samples-s9api version="he" target="SerializeA"/>
310
        <samples-s9api version="he" target="SerializeB"/>
311
        <samples-s9api version="he" target="SerializeC"/>
312
        <samples-s9api version="he" target="SerializeD"/>
313
    </target> 
314
        
315
    <target name="test-samples-s9api-pej" depends="samples-j">
316
        <samples-s9api version="pe" target="nonschema"/>
317
    </target>
318
    
319
    <target name="test-samples-s9api-eej" depends="samples-j">
320
        <samples-s9api version="ee" target="all"/>
321
    </target>
322

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

    
325
    <!-- JAXPExamples sample tests -->
326
    <macrodef name="samples-JAXPExamples"
327
              description="Run test of JAXPExamples samples">
328
        <attribute name="version"/>
329
        <attribute name="target"/>
330
        <sequential>
331
            <exec executable="java"
332
                  dir="${build-resources.dir}/samples"
333
                  failonerror="true">
334
                <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes;${basedir}/${build-@{version}j.dir}/saxon9@{version}.jar;${license.dir}"/>
335
                <arg line="JAXPExamples"/>
336
                <arg line="@{target}"/>
337
            </exec>
338
        </sequential>
339
    </macrodef>
340

    
341
    <target name="test-samples-JAXPExamples-j" depends="samples-j">
342
        <samples-JAXPExamples version="he" target="all"/>
343
        <samples-JAXPExamples version="pe" target="all"/>
344
        <samples-JAXPExamples version="ee" target="all"/>
345
    </target>
346

    
347
    <!-- XQJExamples sample tests -->
348
    <macrodef name="samples-XQJExamples"
349
              description="Run test of XQJExamples samples">
350
        <attribute name="version"/>
351
        <attribute name="target"/>
352
        <sequential>
353
            <exec executable="java"
354
                  dir="${build-resources.dir}/samples"
355
                  failonerror="true">
356
                <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes;${basedir}/${build-@{version}j.dir}/saxon9@{version}.jar;${basedir}/${lib.dir}/xqjapi.jar;${license.dir}"/>
357
                <arg line="XQJExamples"/>
358
                <arg line="@{target}"/>
359
            </exec>
360
        </sequential>
361
    </macrodef>
362

    
363
    <target name="test-samples-XQJExamples-j" depends="samples-j">
364
        <!--<samples-XQJExamples version="he" target="all"/>--> <!-- TODO xqt jar not found -->
365
        <samples-XQJExamples version="pe" target="all"/>
366
        <samples-XQJExamples version="ee" target="all"/>
367
    </target>
368

    
369
    <!-- ApplyXPathJAXP sample tests -->
370
    <macrodef name="samples-ApplyXPathJAXP"
371
        description="Run test of ApplyXPathJAXP sample">
372
        <attribute name="version"/>
373
        <attribute name="file"/>
374
        <attribute name="xpath"/>
375
        <attribute name="object-model" default=""/>
376
        <sequential>
377
            <exec executable="java"
378
                dir="${build-resources.dir}/samples"
379
                failonerror="true">
380
                <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes;${basedir}/${build-@{version}j.dir}/saxon9@{version}.jar;${basedir}/${lib.dir}/jdom.jar;${basedir}/${lib.dir}/xom-1.2.1.jar;${basedir}/${lib.dir}/dom4j-1.6.1.jar;${basedir}/${lib.dir}/jdom-2.0.4.jar;${license.dir}"/>
381
                <arg line="ApplyXPathJAXP"/>  
382
                <arg line="data/@{file}"/>     
383
                <arg line="@{xpath}"/>
384
                <arg line="@{object-model}"/>
385
            </exec>
386
        </sequential>
387
    </macrodef>
388
    
389
    <target name="test-samples-ApplyXPathJAXP-hej" depends="samples-j">
390
        <samples-ApplyXPathJAXP version="he" file="books.xml" xpath="BOOKLIST/BOOKS/ITEM[1]/AUTHOR" object-model="saxon"/>
391
        <samples-ApplyXPathJAXP version="he" file="books.xml" xpath="count(//ITEM)" object-model="dom"/>
392
    </target>
393
    
394
    <target name="test-samples-ApplyXPathJAXP-pej" depends="samples-j">
395
        <samples-ApplyXPathJAXP version="pe" file="books.xml" xpath="BOOKLIST/BOOKS/ITEM[1]/AUTHOR" object-model="saxon"/>
396
        <samples-ApplyXPathJAXP version="pe" file="books.xml" xpath="count(//ITEM)" object-model="dom"/>
397
        <samples-ApplyXPathJAXP version="pe" file="books.xml" xpath="BOOKLIST/BOOKS/ITEM[1]/AUTHOR" object-model="jdom"/>
398
        <samples-ApplyXPathJAXP version="pe" file="books.xml" xpath="BOOKLIST/BOOKS/ITEM[1]/AUTHOR" object-model="xom"/>
399
        <samples-ApplyXPathJAXP version="pe" file="books.xml" xpath="BOOKLIST/BOOKS/ITEM[1]/AUTHOR" object-model="dom4j"/>
400
    </target>
401
    
402
    <target name="test-samples-ApplyXPathJAXP-eej" depends="samples-j">
403
        <samples-ApplyXPathJAXP version="ee" file="books.xml" xpath="BOOKLIST/BOOKS/ITEM[1]/AUTHOR" object-model="saxon"/>
404
        <samples-ApplyXPathJAXP version="ee" file="books.xml" xpath="count(//ITEM)" object-model="dom"/>
405
        <samples-ApplyXPathJAXP version="ee" file="books.xml" xpath="BOOKLIST/BOOKS/ITEM[1]/AUTHOR" object-model="jdom"/>
406
        <samples-ApplyXPathJAXP version="ee" file="books.xml" xpath="BOOKLIST/BOOKS/ITEM[1]/AUTHOR" object-model="xom"/>
407
        <samples-ApplyXPathJAXP version="ee" file="books.xml" xpath="BOOKLIST/BOOKS/ITEM[1]/AUTHOR" object-model="dom4j"/>
408
    </target>
409

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

    
412
    <!-- JDOM2Example sample tests, requires PE or EE -->
413
    <macrodef name="samples-JDOM2Example"
414
              description="Run test of JDOM2Example sample">
415
        <attribute name="version"/>
416
        <sequential>
417
            <exec executable="java"
418
                  dir="${build-resources.dir}/samples"
419
                  failonerror="true">
420
                <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes;${basedir}/${build-@{version}j.dir}/saxon9@{version}.jar;${basedir}/${lib.dir}/jdom-2.0.4.jar;${license.dir}"/>
421
                <arg line="JDOM2Example"/>
422
                <arg line="data/books.xml"/>
423
                <arg line="styles/total.xsl"/>
424
            </exec>
425
        </sequential>
426
    </macrodef>
427

    
428
    <target name="test-samples-JDOM2Example-j" depends="samples-j">
429
        <samples-JDOM2Example version="pe"/>
430
        <samples-JDOM2Example version="ee"/>
431
    </target>
432

    
433
    <!-- PullExamples sample tests, requires EE -->
434
    <target name="test-samples-PullExamples-j" description="Run test of PullExamples sample" depends="samples-j">
435
        <exec executable="java"
436
              dir="${build-resources.dir}/samples"
437
              failonerror="true">
438
            <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes;${basedir}/${build-eej.dir}/saxon9ee.jar;${license.dir}"/>
439
            <arg line="PullExamples"/>
440
            <arg line="#"/>
441
        </exec>
442
    </target>
443

    
444
    <!-- QuickValidator sample test, requires EE -->
445
    <target name="test-samples-QuickValidator-j" description="Run test of QuickValidator sample" depends="samples-j">
446
        <exec executable="java"
447
              dir="${build-resources.dir}/samples"
448
              failonerror="true">
449
            <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes;${basedir}/${build-eej.dir}/saxon9ee.jar;${license.dir}"/>
450
            <arg line="QuickValidator"/>
451
            <arg line="data/books.xml"/>
452
            <arg line="data/books.xsd"/>
453
        </exec>
454
    </target>
455

    
456
    <!-- SchemaValidatorExample sample test, requires EE -->
457
    <target name="test-samples-SchemaValidatorExample-j" description="Run test of SchemaValidatorExample sample" depends="samples-j">
458
        <exec executable="java"
459
              dir="${build-resources.dir}/samples"
460
              failonerror="true">
461
            <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes;${basedir}/${build-eej.dir}/saxon9ee.jar;${license.dir}"/>
462
            <arg line="SchemaValidatorExample"/>
463
            <arg line="data/books.xsd"/>
464
            <arg line="data/books.xml"/>
465
        </exec>
466
    </target>
467

    
468
    <!-- SchemaValidatorHandlerExample sample test, requires EE --> <!-- TODO: fix -->
469
    <target name="test-samples-SchemaValidatorHandlerExample-j" description="Run test of SchemaValidatorHandlerExample sample" depends="samples-j">
470
        <exec executable="java"
471
              dir="${build-resources.dir}/samples"
472
              failonerror="true">
473
            <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes;${basedir}/${build-eej.dir}/saxon9ee.jar;${license.dir}"/>
474
            <arg line="SchemaValidatorHandlerExample"/>
475
            <arg line="data/books.xsd"/>
476
            <arg line="data/books.xml"/>
477
        </exec>
478
    </target>
479

    
480
    <!-- XPathExampleSA sample test, requires EE --> <!-- TODO: fix -->
481
    <target name="test-samples-XPathExampleSA-j" description="Run test of XPathExampleSA sample" depends="samples-j">
482
        <exec executable="java"
483
              dir="${build-resources.dir}/samples"
484
              failonerror="true">
485
            <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes;${basedir}/${build-eej.dir}/saxon9ee.jar;${license.dir}"/>
486
            <arg line="XPathExampleSA"/>
487
            <arg line="data/books.xml"/>
488
            <arg line="data/books.xsd"/>
489
        </exec>
490
    </target>
491

    
492

    
493
    <target name="test-cmd-j" depends="test-cmd-books-j, test-cmd-knights-tour-j, test-cmd-othello-j, test-cmd-bible-j"/>
494
    
495
    <target name="test-samples-j" depends="test-cmd-j, test-samples-XPathExample-j,
496
    test-samples-s9api-j, test-samples-JAXPExamples-j, test-samples-XQJExamples-j,
497
    test-samples-ApplyXPathJAXP-j, test-samples-JDOM2Example-j,
498
    test-samples-PullExamples-j, test-samples-QuickValidator-j, test-samples-SchemaValidatorExample-j"/>
499

    
500
    <!-- TODO: include test-samples-SchemaValidatorHandlerExample-j, test-samples-XPathExampleSA-j -->
501

    
502

    
503
    <!-- XMarkBenchmark sample test, requires EE (takes approx 6 mins) -->
504
    <target name="test-samples-XMarkBenchmark-j" depends="samples-j" description="Run test of XMarkBenchmark sample">
505
        <exec executable="java"
506
              dir="${build-resources.dir}/samples"
507
              failonerror="true">
508
            <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes;${basedir}/${build-eej.dir}/saxon9ee.jar;${license.dir}"/>
509
            <arg line="XMarkBenchmark"/>
510
            <arg line="-dir:${xmark.dir}"/>
511
        </exec>
512
    </target>
513

    
514

    
515

    
516

    
517

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

    
520
    <target name="compile-testdrivers-j">
521
    <mkdir dir="${repository}/build96/test-drivers"/>
522
        <copy todir="${repository}/build96/test-drivers">
523
            <fileset dir="${source-eej.dir}">
524
                <include name="com/saxonica/testdriver/*.java"/>
525
            </fileset>
526
            <fileset dir="${source-hej.dir}">
527
                <include name="net/sf/saxon/testdriver/*.java"/>
528
            </fileset>
529
        </copy>
530
    <javac debug="true" debuglevel="${build.debuglevel}"
531
           destdir="${repository}/build96/test-drivers"
532
           srcdir="${repository}/build96/test-drivers" source="${build.compiler.source}"
533
           target="${build.compiler.target}" includeantruntime="false">
534
        <include name="com/saxonica/testdriver/*.java"/>
535
        <include name="net/sf/saxon/testdriver/*.java"/>
536
        <classpath>
537
            <path refid="classpath-samples"/>
538
        </classpath>
539
    </javac>
540
    </target>
541

    
542
    <!-- generating reports of different test suites (XSLT, QT3) results for different Saxon editions/configurations -->
543
    <macrodef name="generate-test-report"
544
              description="Generate report from named test suite results">
545
        <attribute name="test-suite"/>
546
        <sequential>
547
            <exec executable="java"
548
                  failonerror="true">
549
                <arg line="-cp ${build-eej.dir}/saxon9ee.jar${Z}${license.dir}"/>
550
                <arg line="net.sf.saxon.Transform"/>
551
                <arg line="-t"/>
552
                <arg line="-s:${repository}/build96/build.xml"/>
553
                <arg line="-xsl:${test-results.dir}/@{test-suite}/report.xsl"/>
554
                <arg line="-o:${test-results.dir}/@{test-suite}/${DSTAMP}/report.xml"/>
555
            </exec>
556
        </sequential>
557
    </macrodef>
558

    
559

    
560
    <!-- XSLT 3.0 test suite -->
561

    
562
    <!-- Create date-stamped directory for new XSLT 3.0 test results, containing exceptions file -->
563
    <target name="xslt30-test-results-dir">
564
        <tstamp/>
565
        <mkdir dir="${test-results.dir}/xslt30/${DSTAMP}"/>
566
        <mkdir dir="${test-results.dir}/xslt30/${DSTAMP}/results"/>
567
        <copy file="${test-results.dir}/xslt30/exceptions.xml"
568
              tofile="${test-results.dir}/xslt30/${DSTAMP}/exceptions.xml">
569
        </copy>
570
    </target>
571

    
572
    <!-- Running XSLT 3.0 test catalog -->
573
    <macrodef name="xslt30-tests"
574
              description="Run XSLT 3.0 test catalog">
575
        <attribute name="version"/>
576
        <attribute name="lang"/>
577
        <attribute name="bc" default=""/>
578
        <attribute name="test-driver" default="com.saxonica.testdriver.Xslt30TestSuiteDriver"/>
579
        <element name="other-arg" optional="yes"/>
580
        <sequential>
581
            <exec executable="java"
582
                  failonerror="true">
583
                <arg line="-Xmx1G"/>
584
                <arg line="-cp ${repository}/build96/test-drivers;${build-@{version}j.dir}/saxon9@{version}.jar;${license.dir};${product.dir}/pej/saxon9-icu.jar"/>
585
                <!--                <arg line="-cp ${repository}/build96/test-drivers;${build-@{version}j.dir}/saxon9@{version}.jar;${license.dir}"/>-->
586
                <arg line="@{test-driver}"/>
587
                <arg line="${xslt30.dir}"/>
588
                <arg line="${xslt30.dir}/catalog.xml"/>
589
                <arg line="-o:${test-results.dir}/xslt30/${DSTAMP}"/>
590
                <arg line="-lang:XT@{lang}0"/>
591
                <!--<arg line="-s:number"/>-->
592
                <!--<arg line="-t:result-document-110.*"/>
593
                <arg line="-debug"/>-->
594
                <other-arg/>
595
            </exec>
596
            <copy file="${test-results.dir}/xslt30/${DSTAMP}/results_XSLT@{lang}.0_9.6.0.1.xml"
597
                  tofile="${test-results.dir}/xslt30/${DSTAMP}/results/saxon-@{version}-XT@{lang}0@{bc}.xml">
598
            </copy>
599
        </sequential>
600
    </macrodef>
601

    
602
    <!-- Running XSLT 3.0 test catalog with HE -->
603
    <target name="xslt30-tests-hej" depends="compile-testdrivers-j, xslt30-test-results-dir">
604
        <xslt30-tests version="he" lang="2" test-driver="net.sf.saxon.testdriver.Xslt30TestSuiteDriverHE"/>
605
        <!-- Saxon-HE does not support XSLT3.0-->
606
    </target>
607
 
608
    <!-- Running XSLT 3.0 test catalog with PE -->
609
    <target name="xslt30-tests-pej" depends="compile-testdrivers-j, xslt30-test-results-dir">
610
        <xslt30-tests version="pe" lang="2"/>
611
        <xslt30-tests version="pe" lang="3"/>
612
    </target>
613

    
614
    <!-- Running XSLT 3.0 test catalog with EE -->
615
    <target name="xslt30-tests-eej" depends="compile-testdrivers-j, xslt30-test-results-dir">
616
        <xslt30-tests version="ee" lang="2" bc="-on">
617
            <other-arg>
618
                <arg line= "-bytecode:on"/>
619
            </other-arg>
620
        </xslt30-tests>
621
        <xslt30-tests version="ee" lang="2" bc="-off">
622
            <other-arg>
623
                <arg line= "-bytecode:off"/>
624
            </other-arg>
625
        </xslt30-tests>
626
        <xslt30-tests version="ee" lang="3" bc="-on">
627
            <other-arg>
628
                <arg line= "-bytecode:on"/>
629
            </other-arg>
630
        </xslt30-tests>
631
        <xslt30-tests version="ee" lang="3" bc="-off">
632
            <other-arg>
633
                <arg line= "-bytecode:off"/>
634
            </other-arg>
635
        </xslt30-tests>
636
    </target>
637

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

    
641
    <!-- generate a report of the XSLT 3.0 test suite results for different Saxon editions/configurations -->
642
    <target name="generate-xslt30-tests-report" depends="xslt30-test-results-dir">
643
        <generate-test-report test-suite="xslt30"/>
644
    </target>
645

    
646

    
647
    <!-- QT3 test suites -->
648

    
649
    <!-- Create date-stamped directory for new QT3 test results -->
650
    <target name="qt3-test-results-dir">
651
        <tstamp/>
652
        <mkdir dir="${test-results.dir}/qt3/${DSTAMP}"/>
653
        <mkdir dir="${test-results.dir}/qt3/${DSTAMP}/results"/>
654
        <copy file="${test-results.dir}/qt3/exceptions.xml"
655
              tofile="${test-results.dir}/qt3/${DSTAMP}/exceptions.xml">
656
        </copy>
657
        <mkdir dir="${test-results.dir}/qt3extra/${DSTAMP}"/>
658
        <mkdir dir="${test-results.dir}/qt3extra/${DSTAMP}/results"/>
659
    </target>
660

    
661
    <!-- Running QT3 test catalog -->
662
    <property name="XQ30" value="XQuery3.0"/>
663
    <property name="XP30" value="XPath3.0"/>
664
    <property name="XQ10" value="XQuery1.0"/>
665
    <property name="XP20" value="XPath2.0"/>
666
    <macrodef name="qt3-tests"
667
              description="Run QT3 test catalog">
668
        <attribute name="catalog"/>
669
        <attribute name="version"/>
670
        <attribute name="lang"/>
671
        <attribute name="bc" default=""/>
672
        <attribute name="test-driver" default="com.saxonica.testdriver.QT3TestDriverPE"/>
673
        <element name="other-arg" optional="yes"/>
674
        <sequential>
675
            <exec executable="java"
676
                  failonerror="true">
677
                <arg line="-cp ${repository}/build96/test-drivers${Z}${build-@{version}j.dir}/saxon9@{version}.jar${Z}${license.dir}"/>
678
                <arg line="@{test-driver}"/>
679
                <arg line="${@{catalog}.dir}"/>
680
                <arg line="${@{catalog}.dir}/catalog.xml"/>
681
                <arg line="-o:${test-results.dir}/@{catalog}/${DSTAMP}"/>
682
                <arg line="-lang:@{lang}"/>
683
                <other-arg/>
684
            </exec>
685
            <copy file="${test-results.dir}/@{catalog}/${DSTAMP}/results_${@{lang}}_9.6.0.1.xml"
686
                  tofile="${test-results.dir}/@{catalog}/${DSTAMP}/results/saxon-@{version}-@{lang}@{bc}.xml">
687
            </copy>
688
        </sequential>
689
    </macrodef>
690

    
691
    <!-- Running W3C QT3 test catalog with HE -->
692
    <target name="qt3-tests-hej" depends="compile-testdrivers-j, qt3-test-results-dir">
693
        <qt3-tests catalog="qt3" version="he" lang="XP20" test-driver="net.sf.saxon.testdriver.QT3TestDriverHE"/>
694
        <qt3-tests catalog="qt3" version="he" lang="XP30" test-driver="net.sf.saxon.testdriver.QT3TestDriverHE"/>
695
        <qt3-tests catalog="qt3" version="he" lang="XQ10" test-driver="net.sf.saxon.testdriver.QT3TestDriverHE"/>
696
        <qt3-tests catalog="qt3" version="he" lang="XQ30" test-driver="net.sf.saxon.testdriver.QT3TestDriverHE"/>
697
    </target>
698

    
699
    <!-- Running W3C QT3 test catalog with PE -->
700
    <target name="qt3-tests-pej" depends="compile-testdrivers-j, qt3-test-results-dir">
701
        <qt3-tests catalog="qt3" version="pe" lang="XP20"/>
702
        <qt3-tests catalog="qt3" version="pe" lang="XP30"/>
703
        <qt3-tests catalog="qt3" version="pe" lang="XQ10"/>
704
        <qt3-tests catalog="qt3" version="pe" lang="XQ30"/>
705
    </target>
706

    
707
    <!-- Running W3C QT3 test catalog with EE 
708
         These are split into 4 subtargets such that each can be run independently -->
709
    <target name="qt3-tests-eej" depends="compile-testdrivers-j, qt3-test-results-dir, 
710
        qt3-tests-eej-XP20, qt3-tests-eej-XP30, qt3-tests-eej-XQ10, qt3-tests-eej-XQ30">
711
        <qt3-tests catalog="qt3" version="ee" lang="XP20" bc="-off">
712
            <other-arg>
713
                <arg line= "-bytecode:off"/>
714
            </other-arg>
715
        </qt3-tests>
716
        <qt3-tests catalog="qt3" version="ee" lang="XP20" bc="-on">
717
            <other-arg>
718
                <arg line= "-bytecode:on"/>
719
            </other-arg>
720
        </qt3-tests>
721
        <qt3-tests catalog="qt3" version="ee" lang="XP30" bc="-off">
722
            <other-arg>
723
                <arg line= "-bytecode:off"/>
724
            </other-arg>
725
        </qt3-tests>
726
        <qt3-tests catalog="qt3" version="ee" lang="XP30" bc="-on">
727
            <other-arg>
728
                <arg line= "-bytecode:on"/>
729
            </other-arg>
730
        </qt3-tests>
731
        <qt3-tests catalog="qt3" version="ee" lang="XQ10" bc="-off">
732
            <other-arg>
733
                <arg line= "-bytecode:off"/>
734
            </other-arg>
735
        </qt3-tests>
736
        <qt3-tests catalog="qt3" version="ee" lang="XQ10" bc="-on">
737
            <other-arg>
738
                <arg line= "-bytecode:on"/>
739
            </other-arg>
740
        </qt3-tests>
741
        <qt3-tests catalog="qt3" version="ee" lang="XQ30" bc="-off">
742
            <other-arg>
743
                <arg line= "-bytecode:off"/>
744
            </other-arg>
745
        </qt3-tests>
746
        <qt3-tests catalog="qt3" version="ee" lang="XQ30" bc="-on">
747
            <other-arg>
748
                <arg line= "-bytecode:on"/>
749
            </other-arg>
750
        </qt3-tests>
751
        <qt3-tests catalog="qt3" version="ee" lang="XQ30" bc="-on-unfolded">
752
            <other-arg>
753
                <arg line= "-bytecode:on"/>
754
                <arg line="-unfolded:yes"/>
755
            </other-arg>
756
        </qt3-tests>
757
    </target>
758
    <target name="qt3-tests-eej-XP20" depends="compile-testdrivers-j, qt3-test-results-dir">        
759
        <qt3-tests catalog="qt3" version="ee" lang="XP20" bc="-off">
760
            <other-arg>
761
                <arg line= "-bytecode:off"/>
762
            </other-arg>
763
        </qt3-tests>
764
        <qt3-tests catalog="qt3" version="ee" lang="XP20" bc="-on">
765
            <other-arg>
766
                <arg line= "-bytecode:on"/>
767
            </other-arg>
768
        </qt3-tests>
769
    </target>
770
    <target name="qt3-tests-eej-XQ10" depends="compile-testdrivers-j, qt3-test-results-dir">        
771
        <qt3-tests catalog="qt3" version="ee" lang="XQ10" bc="-off">
772
            <other-arg>
773
                <arg line= "-bytecode:off"/>
774
            </other-arg>
775
        </qt3-tests>
776
        <qt3-tests catalog="qt3" version="ee" lang="XQ10" bc="-on">
777
            <other-arg>
778
                <arg line= "-bytecode:on"/>
779
            </other-arg>
780
        </qt3-tests>
781
    </target>
782
    <target name="qt3-tests-eej-XP30" depends="compile-testdrivers-j, qt3-test-results-dir">        
783
        <qt3-tests catalog="qt3" version="ee" lang="XP30" bc="-off">
784
            <other-arg>
785
                <arg line= "-bytecode:off"/>
786
            </other-arg>
787
        </qt3-tests>
788
        <qt3-tests catalog="qt3" version="ee" lang="XP30" bc="-on">
789
            <other-arg>
790
                <arg line= "-bytecode:on"/>
791
            </other-arg>
792
        </qt3-tests>
793
    </target>
794
    <target name="qt3-tests-eej-XQ30" depends="compile-testdrivers-j, qt3-test-results-dir">        
795
        <qt3-tests catalog="qt3" version="ee" lang="XQ30" bc="-off">
796
            <other-arg>
797
                <arg line= "-bytecode:off"/>
798
            </other-arg>
799
        </qt3-tests>
800
        <qt3-tests catalog="qt3" version="ee" lang="XQ30" bc="-on">
801
            <other-arg>
802
                <arg line= "-bytecode:on"/>
803
            </other-arg>
804
        </qt3-tests>
805
        <qt3-tests catalog="qt3" version="ee" lang="XQ30" bc="-on-unfolded">
806
            <other-arg>
807
                <arg line= "-bytecode:on"/>
808
                <arg line="-unfolded:yes"/>
809
            </other-arg>
810
        </qt3-tests>
811
    </target>
812
    
813

    
814
    <!-- generate a report of the QT3 test suite results for different Saxon editions/configurations -->
815
    <target name="generate-qt3-tests-report" depends="qt3-test-results-dir">
816
        <generate-test-report test-suite="qt3"/>
817
    </target>
818

    
819

    
820
    <!-- Running Saxon's QT3extra test catalog with HE -->
821
    <!--<target name="qt3extra-tests-hej" depends="compile-testdrivers-j, qt3-test-results-dir">
822
        <qt3-tests catalog="qt3extra" version="he" lang="XP20" test-driver="net.sf.saxon.testdriver.QT3TestDriverHE"/>
823
        <qt3-tests catalog="qt3extra" version="he" lang="XP30" test-driver="net.sf.saxon.testdriver.QT3TestDriverHE"/>
824
        <qt3-tests catalog="qt3extra" version="he" lang="XQ10" test-driver="net.sf.saxon.testdriver.QT3TestDriverHE"/>
825
        <qt3-tests catalog="qt3extra" version="he" lang="XQ30" test-driver="net.sf.saxon.testdriver.QT3TestDriverHE"/>
826
    </target>-->
827

    
828
    <!-- Running Saxon's QT3extra test catalog with PE -->
829
    <target name="qt3extra-tests-pej" depends="compile-testdrivers-j, qt3-test-results-dir">
830
        <qt3-tests catalog="qt3extra" version="pe" lang="XP20"/>
831
        <qt3-tests catalog="qt3extra" version="pe" lang="XP30"/>
832
        <qt3-tests catalog="qt3extra" version="pe" lang="XQ10"/>
833
        <qt3-tests catalog="qt3extra" version="pe" lang="XQ30"/>
834
    </target>
835

    
836
    <!-- Running Saxon's QT3extra test catalog with EE -->
837
    <target name="qt3extra-tests-eej" depends="compile-testdrivers-j, qt3-test-results-dir">
838
        <qt3-tests catalog="qt3extra" version="ee" lang="XP20" bc="-off">
839
            <other-arg>
840
                <arg line= "-bytecode:off"/>
841
            </other-arg>
842
        </qt3-tests>
843
        <qt3-tests catalog="qt3extra" version="ee" lang="XP20" bc="-on">
844
            <other-arg>
845
                <arg line= "-bytecode:on"/>
846
            </other-arg>
847
        </qt3-tests>
848
        <qt3-tests catalog="qt3extra" version="ee" lang="XP30" bc="-off">
849
            <other-arg>
850
                <arg line= "-bytecode:off"/>
851
            </other-arg>
852
        </qt3-tests>
853
        <qt3-tests catalog="qt3extra" version="ee" lang="XP30" bc="-on">
854
            <other-arg>
855
                <arg line= "-bytecode:on"/>
856
            </other-arg>
857
        </qt3-tests>
858
        <qt3-tests catalog="qt3extra" version="ee" lang="XQ10" bc="-off">
859
            <other-arg>
860
                <arg line= "-bytecode:off"/>
861
            </other-arg>
862
        </qt3-tests>
863
        <qt3-tests catalog="qt3extra" version="ee" lang="XQ10" bc="-on">
864
            <other-arg>
865
                <arg line= "-bytecode:on"/>
866
            </other-arg>
867
        </qt3-tests>
868
        <qt3-tests catalog="qt3extra" version="ee" lang="XQ30" bc="-off">
869
            <other-arg>
870
                <arg line= "-bytecode:off"/>
871
            </other-arg>
872
        </qt3-tests>
873
        <qt3-tests catalog="qt3extra" version="ee" lang="XQ30" bc="-on">
874
            <other-arg>
875
                <arg line= "-bytecode:on"/>
876
            </other-arg>
877
        </qt3-tests>
878
    </target>
879

    
880
    <!-- generate a report of the QT3extra test suite results for different Saxon editions/configurations -->
881
    <target name="generate-qt3extra-tests-report" depends="qt3-test-results-dir">
882
        <generate-test-report test-suite="qt3extra"/>
883
    </target>
884

    
885
    
886
</project>
(9-9/9)