-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.xml
More file actions
executable file
·1315 lines (1142 loc) · 38.6 KB
/
test.xml
File metadata and controls
executable file
·1315 lines (1142 loc) · 38.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!--
This is an ant build file for Dynamator regression testing.
It is separate from build.xml so Dynamator can be built
even when the dynamate ant task doesn't exist.
Requirements:
- Ant 1.5
Classpath Requirements:
- dynamator.jar
- servlet.jar
(required by regression_java, which compiles generated code)
$ANT_HOME/lib must contain:
- jakarta-oro-2.0.8.jar
(http://jakarta.apache.org/oro
- antcontrib-0.5.jar
(http://ant-contrib.sourceforge.net)
-->
<project name="dynamator" default="regression">
<!-- user-defined configuration -->
<property name="configuration.file" value="build.properties"/>
<property file="${user.home}/dynamator.build.properties" />
<property file="${user.home}/build.properties" />
<property file="${basedir}/${configuration.file}" />
<!-- destination directories -->
<property name="dir.build" location="${basedir}/build"/>
<!-- classpath -->
<!-- allow classpath override (e.g. by jcoverage.xml) -->
<property name="classpath.override" value=""/>
<path id="classpath.project">
<pathelement path="${classpath.override}"/>
<pathelement location="${dir.build}/dynamator.jar"/>
<pathelement location="${basedir}/dynamator.jar"/>
<fileset dir="${basedir}">
<include name="lib/**/*.jar"/>
</fileset>
<pathelement path="${java.class.path}"/>
</path>
<property name="classpath.project" refid="classpath.project"/>
<target name="show-classpath">
<fail>${classpath.project}</fail>
</target>
<taskdef name="dynamate"
classname="dynamator.ant.DynamateTask"
classpathref="classpath.project"
/>
<taskdef name="foreach"
classname="net.sf.antcontrib.logic.ForEach" classpath="lib/ant-contrib-0.5-jdk1.2.2.jar"/>
<taskdef name="if"
classname="net.sf.antcontrib.logic.IfTask" classpath="lib/ant-contrib-0.5-jdk1.2.2.jar"/>
<taskdef name="propertyregexp"
classname="net.sf.antcontrib.property.RegexTask" classpath="lib/ant-contrib-0.5-jdk1.2.2.jar"/>
<property name="trace" value="false"/>
<property name="dir.test-output" location="${basedir}/test"/>
<!--
============================================================
Internally used targets
============================================================
-->
<!--
Compare two files generated by Dynamator,
ignoring the Dynamator generation signature.
Fails the build if the files don't match.
property params:
- diff.expected: The location of the expected file
- diff.actual: The location of the actual file
- diff.ignore-whitespace: 'true' to ignore whitespace
- diff.uncommented 'true' to strip comments and
indents from the expected file
before comparing
-->
<target name="diff">
<loadfile property="expected" srcFile="${diff.expected}"/>
<loadfile property="actual" srcFile="${diff.actual}"/>
<propertyregexp property="expected"
input="${expected}"
defaultValue="${expected}"
global="true"
override="true"
regexp="(\r\n|\n\r|\r|\n)"
replace="✏"
/>
<propertyregexp property="expected"
input="${expected}"
defaultValue="${expected}"
override="true"
regexp="(✏)?.{0,5}generated by Dynamator.*?✏"
replace="\1"
/>
<propertyregexp property="actual"
input="${actual}"
defaultValue="${actual}"
global="true"
override="true"
regexp="(\r\n|\n\r)"
replace="✏"
/>
<propertyregexp property="actual"
input="${actual}"
defaultValue="${actual}"
global="true"
override="true"
regexp="(\n|\r)"
replace="✏"
/>
<propertyregexp property="actual"
input="${actual}"
defaultValue="${actual}"
override="true"
regexp="(✏)?.{0,5}generated by Dynamator.*?✏"
replace="\1"
/>
<if>
<istrue value="${diff.ignore-whitespace}"/>
<then>
<propertyregexp property="actual"
input="${actual}"
defaultValue="${actual}"
global="true"
override="true"
regexp="[ \t]+"
replace=" "
/>
<propertyregexp property="expected"
input="${expected}"
defaultValue="${expected}"
global="true"
override="true"
regexp="[ \t]+"
replace=" "
/>
</then>
</if>
<if>
<istrue value="${diff.uncommented}"/>
<then>
<propertyregexp property="expected"
input="${expected}"
defaultValue="${expected}"
global="true"
override="true"
regexp="✏[ \t]+"
replace="✏"
/>
<!--
FIXME: The next one removes leading spaces from the
'actual' files, because raw content might have
indents.
At the moment I don't remember whether having the
indents is supposed to test something, so I'm not
willing to remove the indents from the content.
Maybe the content can be replaced with
RETAIN comments?
-->
<propertyregexp property="actual"
input="${actual}"
defaultValue="${actual}"
global="true"
override="true"
regexp="✏[ \t]+"
replace="✏"
/>
<!--
Remove only those comments that begin and end
with a space or newline. Other comments need
to remain for the comparison to work.
-->
<propertyregexp property="expected"
defaultValue="${expected}"
global="true"
input="${expected}"
override="true"
regexp="(✏)?<!--[ ✏].*?[ ✏]-->"
replace=""
/>
<!-- remove leftover trailing newlines -->
<propertyregexp property="expected"
input="${expected}"
defaultValue="${expected}"
global="true"
override="true"
regexp="[✏ \t]+$"
replace="✏"
/>
</then>
</if>
<!--
Replace newlines with ^s for easier (?) reading
-->
<propertyregexp property="expected"
defaultValue="${expected}"
global="true"
input="${expected}"
override="true"
regexp="✏"
replace="^"
/>
<propertyregexp property="actual"
defaultValue="${actual}"
global="true"
input="${actual}"
override="true"
regexp="✏"
replace="^"
/>
<condition property="different" value="true">
<not>
<equals arg1="${expected}" arg2="${actual}"/>
</not>
</condition>
<fail if="different">
${diff.actual} doesn't match ${diff.expected}:
Actual:
'${actual}'
Expected:
'${expected}'
</fail>
</target>
<!--
Compare two files generated by Dynamator,
ignoring all comments in the generated file and
whitespace in both files.
Fails the build if the files don't match.
property params:
- diff.expected: The location of the expected file
- diff.actual: The location of the actual file
-->
<target name="diff-uncommented">
<antcall target="diff">
<param name="diff.expected" value="${diff.expected}"/>
<param name="diff.actual" value="${diff.actual}"/>
<param name="diff.ignore-whitespace" value="true"/>
<param name="diff.uncommented" value="true"/>
</antcall>
</target>
<!--
Compare two files.
Property parameters:
- compare.test-output: The directory containing the tests.
Has subdirectories expected and
actual.
- compare.filename: The simple name of the file to be
compared; exists in both expected
and actual.
-->
<target name="compare">
<antcall target="diff">
<param name="diff.expected"
location="${compare.test-output}/expected/${compare.filename}"/>
<param name="diff.actual"
location="${compare.test-output}/actual/${compare.filename}"/>
</antcall>
</target>
<property name="CHECK_WHITESPACE" value=""/>
<property name="IGNORE_WHITESPACE" value="-ignore-whitespace"/>
<!--
Compare two files.
Property parameters:
- filename The location of the actual file.
The text "actual" is replaced with
"expected" to find the expected file.
- diff.ignore-whitespace ${IGNORE_WHITESPACE} to ignore
whitespace for the comparision,
${CHECK_WHITESPACE} if whitespace
is significant.
-->
<target name="diff-each">
<propertyregexp property="diff-each.expected"
input="${filename}"
regexp="actual(_uncommented)?"
replace="expected"
/>
<antcall target="diff">
<param name="diff.actual"
location="${filename}"/>
<param name="diff.expected"
location="${diff-each.expected}"/>
</antcall>
</target>
<!--
Compare two directories of files.
Property parameters:
- diff-dir.actual The directory containing the actual
files.
Expected files are assumed to be
in a corresponding directory, with
"actual" in the directory path
changed to "expected".
- diff.ignore-whitespace ${CHECK_WHITESPACE} if whitespace
is significant (default);
${IGNORE_WHITESPACE} to ignore
whitespace for the comparision
- diff.uncommented 'true' to strip comments and
indents from the expected file
before comparing
-->
<target name="diff-dir">
<property name="diff.ignore-whitespace" value=""/>
<property name="diff.uncommented" value="false"/>
<echo message="Checking ${diff-dir.actual}"/>
<!-- derive the expected directory -->
<propertyregexp property="diff-dir.expected"
input="${diff-dir.actual}"
regexp="actual(_uncommented)?"
replace="expected"
/>
<!-- Compare each file -->
<foreach
target="diff-each"
param="filename"
>
<path>
<fileset dir="${diff-dir.actual}"
includes="*"
excludes="CVS"
/>
</path>
<param name="diff.ignore-whitespace"
value="${diff.ignore-whitespace}"/>
<param name="diff.uncommented"
value="${diff.uncommented}"/>
</foreach>
<!-- Compare the set of files -->
<pathconvert pathsep="," property="diff-dir.actual-files">
<path>
<fileset dir="${diff-dir.actual}" id="diff-dir.actual-dir"/>
</path>
</pathconvert>
<pathconvert pathsep="," property="diff-dir.expected-files">
<path>
<fileset dir="${diff-dir.expected}" id="diff-dir.expected-dir"/>
</path>
</pathconvert>
<propertyregexp property="diff-dir.actual-files"
input="${diff-dir.actual-files}"
global="true"
override="true"
regexp="[^,]+(/|\\)"
replace=""
/>
<propertyregexp property="diff-dir.expected-files"
input="${diff-dir.expected-files}"
global="true"
override="true"
regexp="[^,]+(/|\\)"
replace=""
/>
<condition property="different" value="true">
<not>
<equals arg1="${diff-dir.expected-files}" arg2="${diff-dir.actual-files}"/>
</not>
</condition>
<fail if="different">
Directories don't match:
${diff-dir.actual}: ${diff-dir.actual-files}
${diff-dir.expected}: ${diff-dir.expected-files}
</fail>
</target>
<!--
============================================================
Externally executable targets
============================================================
-->
<target name="init"
description="Initialize test/actual directory"
>
<delete quiet="true">
<fileset dir="${dir.test-output}/actual" includes="*"/>
</delete>
<mkdir dir="${dir.test-output}/actual"/>
</target>
<target name="filenotfound"
depends="init"
unless="com.ms.windir"
description="Test input file not found condition"
>
<mkdir dir="${dir.test-output}/expected"/>
<echo file="${dir.test-output}/expected/filenotfound.out"
>Dynamator: File not found: ${basedir}${file.separator}filenotfound.html
</echo>
<java classname="dynamate"
classpathref="classpath.project"
fork="true"
output="${dir.test-output}/actual/filenotfound.out">
<arg value="filenotfound.html"/>
</java>
<antcall target="compare">
<param name="compare.filename" value="filenotfound.out"/>
<param name="compare.test-output" value="${dir.test-output}"/>
</antcall>
</target>
<target name="dynnotfound"
depends="init"
unless="com.ms.windir"
description="Test Dynamator file not found condition"
>
<mkdir dir="${dir.test-output}/expected"/>
<echo file="${dir.test-output}/expected/dynnotfound.out"
>Dynamator: Dynamator file not found: ${basedir}${file.separator}empty.dyn
</echo>
<replace file="${dir.test-output}/expected/dynnotfound.out"
token="\"
value="/"
/>
<java classname="dynamate" fork="true"
classpathref="classpath.project"
output="${dir.test-output}/actual/dynnotfound.out">
<arg value="languages/dynamator/none/test/regression/empty.html"/>
</java>
<replace file="${dir.test-output}/actual/dynnotfound.out"
token="\"
value="/"
/>
<antcall target="compare">
<param name="compare.filename" value="dynnotfound.out"/>
<param name="compare.test-output" value="${dir.test-output}"/>
</antcall>
</target>
<target name="usage"
depends="init"
unless="com.ms.windir"
description="Test usage message"
>
<mkdir dir="${dir.test-output}/expected"/>
<echo file="${dir.test-output}/expected/usage.out"
>Usage: java dynamate [options] file ...
Options:
[-a] -- always convert HTML to XML
[-B] -- only output the content of the HTML body
[-C] -- remove all comments from template
[-d dir] -- place output in [dir]
[-e enc] -- use Java encoding 'enc'
[-f dir] -- obtain Dynamator files from [dir]
[-F file] -- apply Dynamator [file] to following templates
[-G] -- don't output generation comment
[-H] -- treat following files as HTML
[-I dir]* -- look in [dir] for includes
(default and last resort is .dyn dir)
[-N] -- don't indent output
[-t dir] -- look for templates in dir
[-T{file}] -- trace execution to {file} or STDERR
[-v] -- display dynamator version
[-V] -- don't validate Dynamator files
[-X] -- treat following files as XML
</echo>
<property name="filename" value="usage.out"/>
<java classname="dynamate"
classpathref="classpath.project"
output="${dir.test-output}/actual/usage.out">
</java>
<antcall target="compare">
<param name="compare.filename" value="usage.out"/>
<param name="compare.test-output" value="${dir.test-output}"/>
</antcall>
</target>
<!--
Only do the version test if a compile has been performed
in this environment. Otherwise the version comparison file
won't exist.
-->
<target name="check-version.out">
<available property="version.out.exists"
file="${dir.test-output}/expected/version.out"
/>
</target>
<target name="direct"
depends="init"
description="Test dynamation of a specific file."
>
<delete file="${dir.test-output}/actual/empty.html"/>
<dynamate
srcdir="languages/dynamator/none/test/regression"
destdir="${dir.test-output}/actual"
destsuffix="html"
includes="empty.html"
/>
<antcall target="diff">
<param name="diff.expected"
location="${basedir}/languages/dynamator/none/test/regression/expected/empty.html"/>
<param name="diff.actual"
location="${dir.test-output}/actual/empty.html"/>
</antcall>
</target>
<target name="version"
depends="init, check-version.out"
if="version.out.exists"
unless="com.ms.windir"
description="Test version message"
>
<java classname="dynamate"
classpathref="classpath.project"
output="${dir.test-output}/actual/version.out">
<arg value="-v"/>
</java>
<antcall target="compare">
<param name="compare.filename" value="version.out"/>
<param name="compare.test-output" value="${dir.test-output}"/>
</antcall>
</target>
<target name="regression_invalid"
unless="com.ms.windir"
description="Execute regression tests for error cases">
<property name="invalid.dir.src"
value="languages/dynamator/none/test/regression"/>
<property name="invalid.dir.out"
value="${invalid.dir.src}/invalid"/>
<mkdir dir="${invalid.dir.out}"/>
<delete dir="${invalid.dir.out}" includeEmptyDirs="true"/>
<mkdir dir="${invalid.dir.out}"/>
<mkdir dir="test"/>
<java classname="org.apache.tools.ant.Main"
fork="true"
output="${dir.test-output}/invalid.out"
classpath="${classpath.project}"
>
<arg value="-Ddir.src=${invalid.dir.src}"/>
<arg value="-Ddir.out=${invalid.dir.out}"/>
<arg value="-f"/>
<arg value="test-invalid.xml"/>
</java>
<delete includeEmptyDirs="true">
<fileset dir="${invalid.dir.out}">
<exclude name="*.html"/>
<exclude name="*.xml"/>
</fileset>
</delete>
<available property="invalid.succeeded"
file="${invalid.dir.out}"/>
<antcall target="check_invalid"/>
</target>
<target name="check_invalid"
if="invalid.succeeded">
<fail message="One or more invalid files were successfully processed."/>
</target>
<target name="regression_syntax"
unless="com.ms.windir"
description="Execute regression tests for Dynamator syntax error cases">
<property name="syntax.dir.src"
value="languages/dynamator/none/test/regression"/>
<property name="syntax.dir.out"
value="${syntax.dir.src}/invalid"/>
<mkdir dir="${syntax.dir.out}"/>
<delete dir="${syntax.dir.out}" includeEmptyDirs="true"/>
<mkdir dir="${syntax.dir.out}"/>
<mkdir dir="test"/>
<java classname="org.apache.tools.ant.Main"
fork="true"
output="${dir.test-output}/syntax.out"
classpath="${classpath.project}"
>
<arg value="-Ddir.src=${syntax.dir.src}"/>
<arg value="-Ddir.out=${syntax.dir.out}"/>
<arg value="-f"/>
<arg value="test-syntax.xml"/>
</java>
<delete includeEmptyDirs="true">
<fileset dir="${syntax.dir.out}">
<exclude name="*.html"/>
<exclude name="*.xml"/>
</fileset>
</delete>
<property name="syntax.actual.src"
location="${dir.test-output}/syntax.out"/>
<property name="syntax.expected.src"
location="${syntax.dir.src}/DynamatorSyntax.expected"/>
<loadfile property="syntax.actual"
srcFile="${syntax.actual.src}"/>
<loadfile property="syntax.expected"
srcFile="${syntax.expected.src}"/>
<!-- remove directory paths -->
<propertyregexp property="syntax.actual"
input="${syntax.actual}"
defaultValue="${syntax.actual}"
global="true"
override="true"
regexp="[^ \n\r]*[\\/]([^\\/]+) "
replace="\1 "
/>
<propertyregexp property="syntax.expected"
input="${syntax.expected}"
defaultValue="${syntax.expected}"
global="true"
override="true"
regexp="[^ \n\r]*[\\/]([^\\/]+) "
replace="\1 "
/>
<!-- remove time -->
<propertyregexp property="syntax.actual"
input="${syntax.actual}"
defaultValue="${syntax.actual}"
global="true"
override="true"
regexp="Total time.*"
replace=""
/>
<propertyregexp property="syntax.expected"
input="${syntax.expected}"
defaultValue="${syntax.expected}"
global="true"
override="true"
regexp="Total time.*"
replace=""
/>
<!-- remove summary message -->
<propertyregexp property="syntax.actual"
input="${syntax.actual}"
defaultValue="${syntax.actual}"
global="true"
override="true"
regexp=".* files not processed"
replace=""
/>
<propertyregexp property="syntax.expected"
input="${syntax.expected}"
defaultValue="${syntax.expected}"
global="true"
override="true"
regexp=".* files not processed"
replace=""
/>
<!-- normalize newlines -->
<propertyregexp property="syntax.actual"
input="${syntax.actual}"
defaultValue="${syntax.actual}"
global="true"
override="true"
regexp="(\r\n|\n\r|\n|\r)"
replace=" "
/>
<propertyregexp property="syntax.expected"
input="${syntax.expected}"
defaultValue="${syntax.expected}"
global="true"
override="true"
regexp="(\r\n|\n\r|\n|\r)"
replace=" "
/>
<condition property="different" value="true">
<not>
<equals arg1="${syntax.expected}" arg2="${syntax.actual}"/>
</not>
</condition>
<fail if="different">
${syntax.actual.src} doesn't match ${syntax.expected.src}:
Actual:
'${syntax.actual}'
Expected:
'${syntax.expected}'
</fail>
</target>
<target name="regression_none"
description="Execute regression tests for language=none">
<property name="dir.test.none"
location="${basedir}/languages/dynamator/none/test/regression"/>
<antcall target="regression_none_">
<param name="test.input.dir"
value="${dir.test.none}"/>
<param name="test.output.dir"
value="${dir.test.none}/actual"/>
<param name="dyn.gencomment" value="true"/>
<param name="dyn.stripcomments" value="false"/>
<param name="dyn.indent" value="true"/>
</antcall>
<!--
Test using stripcomments, noindent, and no gen comment.
Whitespace is ignored for this test because the sed
script removes whitespace in the .dyn file, which
Dynamator does not remove.
-->
<antcall target="regression_none_">
<param name="test.input.dir"
value="${dir.test.none}"/>
<param name="test.output.dir"
value="${dir.test.none}/actual_uncommented"/>
<param name="diff.check.whitespace" value="${IGNORE_WHITESPACE}"/>
<param name="dyn.gencomment" value="false"/>
<param name="dyn.stripcomments" value="true"/>
<param name="dyn.indent" value="false"/>
</antcall>
</target>
<target name="regression_none_">
<mkdir dir="${test.output.dir}"/>
<delete>
<fileset dir="${test.output.dir}"
includes="*"
/>
</delete>
<!--
<delete>
<fileset dir="${test.input.dir}"
includes="*.asxml"
/>
</delete>
-->
<!-- language=none -->
<dynamate
srcdir="${test.input.dir}"
destdir="${test.output.dir}"
destsuffix="xml"
includes="*.xml"
trace="${trace}"
stripComments="${dyn.stripcomments}"
indent="${dyn.indent}"
gencomment="${dyn.gencomment}"
/>
<dynamate
srcdir="${test.input.dir}"
destdir="${test.output.dir}"
destsuffix="html"
includes="*.html"
includeds="*.include"
excludes="
**/expected/*,
**/big5*,
**/utf8*,
**/unknownencoding*,
**/Include.html
**/Invalid*
**/DynamatorSyntax*
"
trace="${trace}"
stripComments="${dyn.stripcomments}"
indent="${dyn.indent}"
gencomment="${dyn.gencomment}"
/>
<dynamate
srcdir="${test.input.dir}"
destdir="${test.output.dir}"
destsuffix="html"
includes="static.dyn"
trace="${trace}"
stripComments="${dyn.stripcomments}"
indent="${dyn.indent}"
gencomment="${dyn.gencomment}"
/>
<dynamate
srcdir="${test.input.dir}"
destdir="${test.output.dir}"
destsuffix="html"
includes="Include.html"
includepath="languages/dynamator/none/test"
trace="${trace}"
stripComments="${dyn.stripcomments}"
indent="${dyn.indent}"
gencomment="${dyn.gencomment}"
/>
<dynamate
srcdir="${test.input.dir}"
destdir="${test.output.dir}"
destsuffix="frag"
includes="*.frag"
bodyonlyhtml="true"
trace="${trace}"
stripComments="${dyn.stripcomments}"
indent="${dyn.indent}"
gencomment="${dyn.gencomment}"
/>
<antcall target="diff-dir">
<param name="diff-dir.actual"
value="${test.output.dir}"/>
<param name="diff.uncommented"
value="${dyn.stripcomments}"/>
</antcall>
</target>
<target name="regression_encoding"
description="Execute regression tests for character encodings">
<antcall target="regression_encoding_">
<param name="test.input.dir"
value="languages/dynamator/none/test/regression"/>
<param name="test.output.dir"
value="languages/dynamator/none/test/regression/actual_encoding"/>
<param name="dyn.gencomment" value="true"/>
<param name="dyn.stripcomments" value="false"/>
<param name="dyn.indent" value="true"/>
</antcall>
</target>
<target name="regression_encoding_"
unless="com.ms.windir"
>
<mkdir dir="${test.output.dir}"/>
<delete>
<fileset dir="${test.output.dir}"
includes="*"
/>
</delete>
<!--
<delete>
<fileset dir="${test.input.dir}"
includes="*.asxml"
/>
</delete>
-->
<dynamate
srcdir="${test.input.dir}"
destdir="${test.output.dir}"
destsuffix="html"
encoding="big5"
includes="big5*.html"
trace="${trace}"
stripComments="${dyn.stripcomments}"
indent="${dyn.indent}"
gencomment="${dyn.gencomment}"
/>
<dynamate
srcdir="${test.input.dir}"
destdir="${test.output.dir}"
destsuffix="html"
encoding="utf-8"
includes="utf8*.html"
trace="${trace}"
stripComments="${dyn.stripcomments}"
indent="${dyn.indent}"
gencomment="${dyn.gencomment}"
/>
<dynamate
srcdir="${test.input.dir}"
destdir="${test.output.dir}"
destsuffix="html"
encoding="windows-1252"
includes="unknownencoding*.html"
ignoreasxml="true"
trace="${trace}"
stripComments="${dyn.stripcomments}"
indent="${dyn.indent}"
gencomment="${dyn.gencomment}"
/>
<antcall target="diff-dir">
<param name="diff-dir.actual"
value="${test.output.dir}"/>
<param name="diff.uncommented"
value="${dyn.stripcomments}"/>
</antcall>
</target>
<target name="regression_jsp"
description="Execute regression tests for language=jsp">
<property name="dir.test.jsp"
location="${basedir}/languages/dynamator/jsp/test"/>
<antcall target="regression_jsp_">
<param name="test.input.dir"
value="${dir.test.jsp}/basic"/>
<param name="test.output.dir"
value="${dir.test.jsp}/basic/actual"/>
<param name="dyn.gencomment" value="true"/>
<param name="dyn.stripcomments" value="false"/>
<param name="dyn.indent" value="true"/>
</antcall>
<antcall target="regression_jsp_">
<param name="test.input.dir"
value="${dir.test.jsp}/regression"/>
<param name="test.output.dir"
value="${dir.test.jsp}/regression/actual"/>
<param name="dyn.gencomment" value="true"/>
<param name="dyn.stripcomments" value="false"/>
<param name="dyn.indent" value="true"/>
</antcall>
<!--
The uncommented tests fail because all whitespace in prolog is
copied, and all prologs start with a newline. The sed script
results in no newline at start of file.
The sed script also removes the comment div.
<antcall target="regression_jsp_">
<param name="test.input.dir"
value="${dir.test.jsp}/basic"/>
<param name="test.output.dir"
value="${dir.test.jsp}/basic/actual_uncommented"/>
<param name="dyn.gencomment" value="false"/>
<param name="dyn.stripcomments" value="true"/>
<param name="dyn.indent" value="false"/>
</antcall>
<antcall target="regression_jsp_">
<param name="test.input.dir"
value="${dir.test.jsp}/regression"/>
<param name="test.output.dir"
value="${dir.test.jsp}/regression/actual_uncommented"/>
<param name="dyn.gencomment" value="false"/>
<param name="dyn.stripcomments" value="true"/>
<param name="dyn.indent" value="false"/>
</antcall>
-->
</target>