-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
executable file
·613 lines (563 loc) · 30 KB
/
build.xml
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
<!--
* JRTE is a recursive transduction engine for Java
*
* Copyright (C) 2011,2022 Kim Briggs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received copies of the GNU General Public License
* and GNU Lesser Public License along with this program. See
* LICENSE-gpl-3.0. If not, see
* <http://www.gnu.org/licenses/>.
-->
<!--
<property name="jargs" value="-jargs"/>
<property name="regex.linux.kernel" value="([JFMASOND][a-z]+ [0-9]+ ([0-9]+:)+[0-9]+) ([-.:A-Za-z_0-9]*) kernel: \[[ ]*[0-9]+\.[0-9]+\] (DROPPED|ABORTED|LIMITED) ((IN=([-.:A-Za-z_0-9]*)|OUT=([-.:A-Za-z_0-9]*)|MAC=([-.:A-Za-z_0-9]*)|SRC=([-.:A-Za-z_0-9]*)|DST=([-.:A-Za-z_0-9]*)) )+.* PROTO=([-.:A-Za-z_0-9]*)(.* SPT=([-.:A-Za-z_0-9]*) DPT=([-.:A-Za-z_0-9]*))?"/>
<property name="jargs.jit.ribose" value="-XX:CompileCommandFile=etc/jit/ribose.jit"/>
<property name="jargs.gc.ribose" value=""/>
-->
<project name="ribose-build" default="ci-test" basedir="." xmlns:if="ant:if" xmlns:unless="ant:unless">
<property environment="env"/>
<loadfile property="ribose.version" srcFile="./version"/>
<property name="ribose" location="./ribose"/>
<property name="jdk" value="${env.JAVA_HOME}"/>
<property name="java.source.dir" value="src"/>
<property name="java.test.dir" value="test"/>
<property name="jars.dir" value="jars"/>
<property name="jars.test.dir" value="${jars.dir}/test"/>
<property name="build.java" value="build/java"/>
<property name="build.testenv" value="build/testenv"/>
<property name="build.java.classes" value="${build.java}/classes"/>
<property name="build.compiler.model" value="build/compiler"/>
<property name="build.compiler.automata" value="build/automata"/>
<property name="ribose.patterns" value="patterns/ribose"/>
<property name="test.patterns" value="patterns/test"/>
<property name="test.input.dir" value="${build.testenv}/inputs"/>
<property name="regex.verbosegc" value="cycle-start id=.[0-9]+. type=.scavenge. contextid=.[0-9]+. timestamp=.(?:[0-9]+[-.:T])+[0-9]+. intervalms=.([0-9]+.[0-9]+)[^0-9]"/>
<property name="regex.nil" value=""/>
<property name="regex.linuxkernel" value="([JFMASOND][a-z]+ [0-9]+ (?:[0-9]+:)+[0-9]+) ([-.:A-Za-z_0-9]*) kernel: \[[ ]*[0-9]+\.[0-9]+\] (DROPPED|ABORTED|LIMITED) IN=([-.:A-Za-z_0-9]*) OUT=([-.:A-Za-z_0-9]*)(?: MAC=([-.:A-Za-z_0-9]*))? SRC=([-.:A-Za-z_0-9]*) DST=([-.:A-Za-z_0-9]*).* PROTO=([-.:A-Za-z_0-9]*)(?:.* SPT=([-.:A-Za-z_0-9]*) DPT=([-.:A-Za-z_0-9]*))?"/>
<property name="ribose.inbuffer.size" value="65536"/>
<property name="ribose.outbuffer.size" value="65536"/>
<property name="ribose.sum.threshold" value="128"/>
<property name="ribose.product.threshold" value="10"/>
<property name="jargs.ribose.compile" value="-ea -Dribose.product.threshold=${ribose.product.threshold} -Dribose.sum.threshold=${ribose.sum.threshold}"/>
<!--property name="jargs.ribose.compile" value="-ea"/-->
<property name="jargs.jit.diagnostic" value="-XX:+UnlockDiagnosticVMOptions -XX:+PrintCompilation -XX:+PrintInlining"/>
<property name="jargs.jit.inline" value="-XX:CompileCommandFile=etc/jit/ribose.jit"/>
<property name="jargs.gc.buffers" value="-Dribose.inbuffer.size=${ribose.inbuffer.size} -Dribose.outbuffer.size=${ribose.outbuffer.size}"/>
<property name="jargs.gc.test" value="-Xms2m ${jargs.gc.buffers} -Xlog:gc*:file=${build.testenv}"/>
<!--property name="jargs" value="-ea ${jargs.jit.inline}"/-->
<property name="jargs" value="-ea -Djava.util.logging.config.file=./logging.properties -XX:+ShowCodeDetailsInExceptionMessages"/>
<condition property="linux">
<os family="unix" />
</condition>
<path id="java.classpath">
<pathelement location="${build.java.classes}"/>
</path>
<path id="test.classpath">
<pathelement location="${build.java}"/>
<pathelement location="${jars.dir}/${ribose.version}.jar"/>
</path>
<path id="testing.classpath">
<pathelement location="${jars.dir}/${ribose.version}.jar"/>
<pathelement location="${jars.dir}/${ribose.version}-test.jar"/>
</path>
<path id="jrte.classpath">
<pathelement location="${jars.dir}/${ribose.version}.jar"/>
</path>
<target name="clean" depends="clean-ribose,clean-test,clean-javadoc">
<delete failonerror="false" dir="build"/>
<delete failonerror="false" dir="." includes="ribose-*.log*"/>
</target>
<target name="clean-ribose">
<delete failonerror="false" verbose="true">
<fileset dir="${jars.dir}" includes="*"/>
</delete>
<delete failonerror="false" dir="${build.java.classes}/com"/>
<delete failonerror="false" dir="${build.compiler.model}"/>
<delete failonerror="false" dir="/tmp" includes="*.ginrout,*.ginrerr"/>
</target>
<target name="clean-javadoc">
<delete failonerror="false" dir="javadoc" includes="**/*"/>
</target>
<target name="clean-test">
<delete failonerror="false" verbose="true">
<fileset dir="/tmp" includes="*.gc.stats"/>
</delete>
<delete failonerror="false" file="build/Test.model"/>
<delete failonerror="false" file="build/Test.map"/>
<delete failonerror="false" dir="${build.compiler.automata}" />
<delete failonerror="false" dir="${build.testenv}"/>
<delete failonerror="false" dir="/tmp" includes="*.gc"/>
</target>
<target name="init-ci" depends="clean">
<exec outputproperty="git.which" executable="bash">
<arg line="-c 'which git'"/>
</exec>
<exec outputproperty="git.version" executable="git">
<arg line="--version"/>
</exec>
<exec outputproperty="git.branch" executable="git">
<arg line="branch --show-current"/>
</exec>
<exec outputproperty="git.commit" executable="git">
<arg line="log --oneline -n 1"/>
</exec>
<echo message="git @ ${git.which}"/>
<echo message="${git.version}"/>
<echo message="Git branch: ${git.branch}"/>
<echo message="Git commit: ${git.commit}"/>
<echo/>
<echo message="Ant @ ${env.ANT_HOME}"/>
<echo message="${ant.version}"/>
<echo/>
<echo message="Java @ ${env.JAVA_HOME}"/>
<java fork="true" jvm="${jdk}/bin/java" classname="java.lang.Object">
<jvmarg line="-version"/>
</java>
<echo/>
<exec executable="bash">
<arg line="./rinr version"/>
</exec>
<echo/>
<echo message="Building ${ribose.version}"/>
</target>
<target name="init-ribose">
<mkdir dir="${build.java.classes}"/>
<mkdir dir="${build.compiler.model}"/>
</target>
<target name="init-test">
<mkdir dir="${build.compiler.automata}"/>
</target>
<target name="properties">
<echoproperties/>
</target>
<target name="all" depends="ci-test,javadoc"/>
<target name="package" depends="clean,ribose,package-test,compile-test-model,javadoc"/>
<target name="ribose" depends="package-java,build-compiler-model"
description="Clean build for java and patterns"/>
<target name="ci-test" depends="init-ci,ribose,package-test,compile-test-model,test,env"
description="Full build with CI tests for java and patterns">
<echo message="Ribose compiler log ..."/>
<concat> <fileset dir="." includes="ribose-compile-0.log"/></concat>
<echo message="Ribose runtime log ..."/>
<concat> <fileset dir="." includes="ribose-runtime-0.log"/></concat>
</target>
<target name="check-compile-java" depends="init-ribose">
<depend srcdir="${java.source.dir}" destdir="${build.java.classes}" closure="yes">
<exclude name="**/Test/*.java"/>
</depend>
</target>
<target name="compile-java" depends="check-compile-java">
<javac fork="true" executable="${jdk}/bin/javac" compiler="modern" includeantruntime="false"
srcdir="${java.source.dir}" excludes="**/${java.test.dir}/**" destdir="${build.java.classes}"
debug="true" debuglevel="lines,vars,source">
<classpath refid="java.classpath"/>
<compilerarg value="-Xlint"/>
</javac>
</target>
<target name="check-package-java" depends="compile-java">
<uptodate targetfile="${jars.dir}/${ribose.version}.jar" property="jar.uptodate">
<srcfiles dir="${build.java.classes}" excludes="VERSION **/${java.test.dir}/**,**/TCompile.model"/>
<srcfiles dir="." includes="LICENSE*"/>
</uptodate>
</target>
<target name="package-java" unless="jar.uptodate" depends="check-package-java">
<copy file="LICENSE-gpl-3.0" todir="${build.java.classes}"/>
<echo message="Version: ${ribose.version}" file="${build.java.classes}/VERSION" append="false"/>
<echo message="Git branch:${git.branch}" file="${build.java.classes}/VERSION" append="true"/>
<echo message="Git commit:${git.commit}" file="${build.java.classes}/VERSION" append="true"/>
<jar basedir="${build.java.classes}" excludes="**/${java.test.dir}/**" destfile="${jars.dir}/${ribose.version}.jar"/>
</target>
<target name="check-javadoc">
<uptodate targetfile="${jars.dir}/${ribose.version}-api.jar" property="javadoc.uptodate">
<srcfiles dir="${java.source.dir}" includes="**/*.java" excludes="**/${java.test.dir}/**"/>
<srcfiles dir="etc/markdown" includes="**/*"/>
<srcfiles dir="." includes="overview.html"/>
</uptodate>
</target>
<target name="javadoc" unless="javadoc.uptodate" depends="check-javadoc">
<delete dir="javadoc" includes="**/*"/>
<javadoc executable="${jdk}/bin/javadoc" access="protected" overview="overview.html" additionalparam="-quiet"
sourcepath="src" destdir="javadoc" verbose="false" use="true" failonerror="true" failonwarning="false"
doctitle="Ribose" packagenames="com.characterforming.ribose.base,com.characterforming.ribose"
encoding="UTF-8" charset="UTF-8" docencoding="UTF-8">
<group title="Interfaces and Supporting Classes" packages="com.characterforming.ribose*"/>
</javadoc>
<copy todir="javadoc" file="etc/markdown/a-b-gears-white.gif"/>
<jar basedir="javadoc" destfile="jars/${ribose.version}-api.jar"/>
</target>
<target name="check-compiler-model" depends="package-java">
<uptodate targetfile="${build.compiler.model}/TCompile.model" property="tcompile.uptodate">
<srcfiles dir="jars" includes="${ribose.version}.jar"/>
<srcfiles dir="${ribose.patterns}" includes="*.inr"/>
<srcfiles dir="etc/ginr" includes="ginr*"/>
</uptodate>
</target>
<target name="build-compiler-model" depends="check-compiler-model" unless="tcompile.uptodate">
<delete verbose="true">
<fileset dir="${build.compiler.model}" includes="TCompile.*"/>
</delete>
<echo message="Compiling ${ribose.patterns}"/>
<exec failonerror="true" executable="bash">
<arg line="./rinr patterns/alpha.inr ${ribose.patterns} patterns/after.inr"/>
</exec>
<echo/>
<echo message="Building ${build.compiler.model}/TCompile.model"/>
<exec failonerror="true" executable="bash">
<arg line="./ribose ${jargs.ribose.compile} compile --target com.characterforming.jrte.engine.ModelCompiler ${build.compiler.model} ${build.compiler.model}/TCompile.model"/>
</exec>
<fixcrlf file="${build.compiler.model}/TCompile.map" eol="lf"/>
<copy todir="${build.java.classes}/com/characterforming/jrte/engine" verbose="true" overwrite="true" force="true">
<fileset dir="${build.compiler.model}" includes="TCompile.model,TCompile.map"/>
</copy>
<jar update="true" basedir="${build.java.classes}" destfile="jars/${ribose.version}.jar" includes="**/TCompile.model,**/TCompile.map"/>
<touch><fileset dir="${build.compiler.model}" includes="TCompile.model,TCompile.map"/></touch>
</target>
<target name="check-test-patterns" depends="ribose,init-test">
<uptodate targetfile="build/Test.model" property="test.patterns.uptodate">
<srcfiles dir="patterns" includes="alpha.inr,after.inr"/>
<srcfiles dir="${test.patterns}" includes="*.inr"/>
<srcfiles dir="etc/ginr" includes="ginr*"/>
</uptodate>
</target>
<target name="compile-test-patterns" depends="check-test-patterns" unless="test.patterns.uptodate">
<echo message="Compiling ${test.patterns}"/>
<exec failonerror="true" executable="bash">
<arg line="./rinr patterns/alpha.inr ${test.patterns} patterns/after.inr"/>
</exec>
</target>
<target name="check-compile-test-model" depends="compile-test-patterns">
<uptodate targetfile="build/Test.model" property="patterns.packaged">
<srcfiles dir="${build.compiler.automata}" includes="**/*.dfa"/>
<srcfiles file="${jars.dir}/${ribose.version}.jar"/>
</uptodate>
</target>
<target name="compile-test" depends="check-compile-test">
<javac fork="true" executable="${jdk}/bin/javac" compiler="modern" includeantruntime="false"
srcdir="${java.source.dir}" destdir="${build.java.classes}" includes="**/${java.test.dir}/**"
debug="true" debuglevel="lines,vars,source">
<classpath refid="test.classpath"/>
</javac>
</target>
<target name="check-package-test">
<uptodate targetfile="${jars.dir}/${ribose.version}-test.jar" property="test.packaged.test">
<srcfiles dir="${build.java.classes}" includes="**/test/*.class"/>
</uptodate>
</target>
<target name="package-test" depends="package-java,compile-test,check-package-test" unless="test.packaged">
<jar basedir="${build.java.classes}" includes="**/test/**" destfile="${jars.dir}/${ribose.version}-test.jar"/>
</target>
<target name="check-compile-test" depends="package-java">
<depend srcdir="${java.source.dir}" destdir="${build.java.classes}" closure="yes">
<include name="**/Test/*.java"/>
<classpath refid="java.classpath"/>
</depend>
</target>
<target name="compile-test-model" depends="package-test,check-compile-test-model" unless="patterns.packaged">
<delete file="build/Test.model"/>
<delete file="build/Test.map"/>
<echo message="Building build/Test.model using thresholds msum = ${ribose.sum.threshold}, mproduct = ${ribose.product.threshold}"/>
<exec failonerror="true" executable="bash">
<arg line="./ribose ${jargs} ${jargs.ribose.compile} compile --target-path ${jars.dir}/${ribose.version}-test.jar --target com.characterforming.jrte.test.TestTarget ${build.compiler.automata} build/Test.model"/>
</exec>
<fixcrlf file="build/Test.map" eol="lf"/>
</target>
<target name="check-package-source">
<uptodate targetfile="${jars.dir}/${ribose.version}-source.jar" property="source.packaged">
<srcfiles dir="${build.java.classes}" includes="**/*.class"/>
</uptodate>
</target>
<target name="package-source" depends="check-package-source,compile-java" unless="source.packaged">
<jar basedir="${java.source.dir}" destfile="${jars.dir}/${ribose.version}-source.jar"/>
</target>
<target name="test-env" depends="ribose,init-test,compile-test-model,package-test">
<mkdir dir="${build.compiler.automata}"/>
<mkdir dir="${test.input.dir}"/>
<unzip src="${test.patterns}/inputs.zip" dest="${test.input.dir}">
<patternset>
<include name="dates.txt"/>
<include name="fib.txt"/>
<include name="kern.log"/>
<include name="kern-10.log"/>
<include name="values.txt"/>
<include name="verbosegc.vgc"/>
</patternset>
</unzip>
</target>
<target name="test-basic" depends="test-env">
<echo>Decompile:</echo>
<exec failonerror="true" executable="bash">
<arg value="-c"/>
<arg value="./ribose ${jargs} decompile --target-path ${jars.dir}/${ribose.version}-test.jar build/Test.model Fibonacci"/>
</exec>
<echo/>
<echo>Fibonacci:</echo>
<exec failonerror="true" executable="bash">
<arg value="-c"/>
<arg value="./ribose ${jargs} run --target-path ${jars.dir}/${ribose.version}-test.jar --nil build/Test.model Fibonacci ${test.input.dir}/fib.txt"/>
</exec>
<echo/>
<echo>DateExtractor:</echo>
<exec failonerror="true" executable="bash">
<arg value="-c"/>
<arg value="./ribose ${jargs} run --target-path ${jars.dir}/${ribose.version}-test.jar --nil build/Test.model DateExtractor ${test.input.dir}/dates.txt"/>
</exec>
<echo/>
<echo>ValuesTest:</echo>
<exec failonerror="true" executable="bash">
<arg value="-c"/>
<arg value="./ribose ${jargs} -Djrte.out.enabled=true run --target-path ${jars.dir}/${ribose.version}-test.jar --nil build/Test.model ValuesTest ${test.input.dir}/values.txt"/>
</exec>
<echo/>
</target>
<target name="test-testrunner" depends="test-env">
<echo>TestRunner benchmarking (simple fsts driving base transduction effectors):</echo>
<java fork="true" jvm="${jdk}/bin/java" dir="." classname="com.characterforming.jrte.test.TestRunner" classpathref="testing.classpath" failonerror="true">
<jvmarg line="${jargs} -Djrte.out.enabled=false -Dregex.out.enabled=false"/>
<arg line="build/Test.model 1"/>
</java>
<echo/>
</target>
<target name="test-filerunner" depends="test-env">
<echo>FileRunner benchmarking (ribose fsts vs similar regex, input from single buffer in RAM, output muted):</echo>
<java fork="true" jvm="${jdk}/bin/java" dir="." classname="com.characterforming.jrte.test.FileRunner" classpathref="testing.classpath" failonerror="true">
<jvmarg line="${jargs} -Djrte.out.enabled=false -Dregex.out.enabled=false"/>
<arg line="--nil build/Test.model LinuxKernelNil ${test.input.dir}/kern-10.log "${regex.linuxkernel}""/>
</java>
<java fork="true" jvm="${jdk}/bin/java" dir="." classname="com.characterforming.jrte.test.FileRunner" classpathref="testing.classpath" failonerror="true">
<jvmarg line="${jargs} -Djrte.out.enabled=false -Dregex.out.enabled=false"/>
<arg line="--nil build/Test.model LinuxKernelNil ${test.input.dir}/kern-10.log "${regex.nil}""/>
</java>
<java fork="true" jvm="${jdk}/bin/java" dir="." classname="com.characterforming.jrte.test.FileRunner" classpathref="testing.classpath" failonerror="true">
<jvmarg line="${jargs} -Djrte.out.enabled=false -Dregex.out.enabled=false"/>
<arg line="--nil build/Test.model LinuxKernel ${test.input.dir}/kern-10.log "${regex.nil}""/>
</java>
<java fork="true" jvm="${jdk}/bin/java" dir="." classname="com.characterforming.jrte.test.FileRunner" classpathref="testing.classpath" failonerror="true">
<jvmarg line="${jargs} -Djrte.out.enabled=false -Dregex.out.enabled=false"/>
<arg line="--nil build/Test.model LinuxKernelLoose ${test.input.dir}/kern-10.log "${regex.nil}""/>
</java>
<java fork="true" jvm="${jdk}/bin/java" dir="." classname="com.characterforming.jrte.test.FileRunner" classpathref="testing.classpath" failonerror="true">
<jvmarg line="${jargs} -Djrte.out.enabled=false -Dregex.out.enabled=false"/>
<arg line="--nil build/Test.model LinuxKernelStrict ${test.input.dir}/kern-10.log "${regex.nil}""/>
</java>
<java fork="true" jvm="${jdk}/bin/java" dir="." classname="com.characterforming.jrte.test.FileRunner" classpathref="testing.classpath" failonerror="true">
<jvmarg line="${jargs} -Djrte.out.enabled=false -Dregex.out.enabled=false"/>
<arg line="--nil build/Test.model Tintervals ${test.input.dir}/verbosegc.vgc "${regex.verbosegc}""/>
</java>
<java fork="true" jvm="${jdk}/bin/java" dir="." classname="com.characterforming.jrte.test.FileRunner" classpathref="testing.classpath" failonerror="true">
<jvmarg line="${jargs} -Djrte.out.enabled=false -Dregex.out.enabled=false"/>
<arg line="--nil build/Test.model Tintervals ${test.input.dir}/verbosegc.vgc "${regex.nil}""/>
</java>
<java fork="true" jvm="${jdk}/bin/java" dir="." classname="com.characterforming.jrte.test.FileRunner" classpathref="testing.classpath" failonerror="true">
<jvmarg line="${jargs} -Djrte.out.enabled=false -Dregex.out.enabled=false"/>
<arg line="--nil build/Test.model Sintervals ${test.input.dir}/verbosegc.vgc "${regex.nil}""/>
</java>
<java fork="true" jvm="${jdk}/bin/java" dir="." classname="com.characterforming.jrte.test.FileRunner" classpathref="testing.classpath" failonerror="true">
<jvmarg line="${jargs} -Djrte.out.enabled=false -Dregex.out.enabled=false"/>
<arg line="--nil build/Test.model Rintervals ${test.input.dir}/verbosegc.vgc "${regex.nil}""/>
</java>
<echo/>
</target>
<target name="test-output-equivalence" depends="test-env">
<echo>Ribose output equivalence tests with ${ribose.inbuffer.size}b input buffer (showing line and byte counts for input/output files):</echo>
<echo/>
<echo message="Reducing ${test.input.dir}/verbosegc.vgc -> ${build.testenv}/vgc.*.out"/>
<exec failonerror="true" executable="wc">
<arg line="--lines --bytes ${test.input.dir}/verbosegc.vgc"/>
</exec>
<echo message="RegEx: ${test.input.dir}/verbosegc.vgc -> ${build.testenv}/vgc.regex.(out,gc)"/>
<exec failonerror="true" executable="bash" output="${build.testenv}/vgc.regex.out">
<arg value="-c"/>
<arg value="etc/sh/FileRunner ${jargs} ${jargs.gc.test}/vgc.regex.gc -Djrte.out.enabled=false -Dregex.out.enabled=true
--nil build/Test.model verbosegcregex ${test.input.dir}/verbosegc.vgc '${regex.verbosegc}'"/>
</exec>
<echo message="Ribose: Tintervals ${test.input.dir}/verbosegc.vgc -> ${build.testenv}/vgc.tintervals.(out,gc)"/>
<exec failonerror="true" executable="bash">
<arg value="-c"/>
<arg value="./ribose ${jargs} ${jargs.gc.test}/vgc.tintervals.gc run --target-path ${jars.dir}/ribose-0.0.2-test.jar
--nil build/Test.model Tintervals ${test.input.dir}/verbosegc.vgc ${build.testenv}/vgc.tintervals.out"/>
</exec>
<echo message="Ribose: Sintervals ${test.input.dir}/verbosegc.vgc -> ${build.testenv}/vgc.sintervals.(out,gc)"/>
<exec failonerror="true" executable="bash">
<arg value="-c"/>
<arg value="./ribose ${jargs} ${jargs.gc.test}/vgc.sintervals.gc run --target-path ${jars.dir}/ribose-0.0.2-test.jar
--nil build/Test.model Sintervals ${test.input.dir}/verbosegc.vgc ${build.testenv}/vgc.sintervals.out"/>
</exec>
<echo message="Ribose: Rintervals ${test.input.dir}/verbosegc.vgc -> ${build.testenv}/vgc.rintervals.(out,gc)"/>
<exec failonerror="true" executable="bash">
<arg value="-c"/>
<arg value="./ribose ${jargs} ${jargs.gc.test}/vgc.rintervals.gc run --target-path ${jars.dir}/ribose-0.0.2-test.jar
--nil build/Test.model Rintervals ${test.input.dir}/verbosegc.vgc ${build.testenv}/vgc.rintervals.out"/>
</exec>
<!-- verbose gc verify -->
<fixcrlf srcDir="${build.testenv}" includes="vgc.*.out"/>
<exec failonerror="true" executable="wc">
<arg line="--lines --bytes ${build.testenv}/vgc.regex.out"/>
</exec>
<exec failonerror="true" executable="wc">
<arg line="--lines --bytes ${build.testenv}/vgc.tintervals.out"/>
</exec>
<exec failonerror="true" executable="wc">
<arg line="--lines --bytes ${build.testenv}/vgc.sintervals.out"/>
</exec>
<exec failonerror="true" executable="wc">
<arg line="--lines --bytes ${build.testenv}/vgc.rintervals.out"/>
</exec>
<condition property="intervals.match">
<and>
<filesmatch file1="${build.testenv}/vgc.regex.out" file2="${build.testenv}/vgc.tintervals.out"/>
<filesmatch file1="${build.testenv}/vgc.regex.out" file2="${build.testenv}/vgc.sintervals.out"/>
<filesmatch file1="${build.testenv}/vgc.regex.out" file2="${build.testenv}/vgc.rintervals.out"/>
</and>
</condition>
<fail unless="intervals.match" message="Not identical: ${build.testenv}/vgc.*.out"/>
<echo message="Identical: ${build.testenv}/vgc.*.out"/>
<echo/>
<!-- linux kernel run -->
<echo message="Reducing ${test.input.dir}/kern.log -> ${build.testenv}/linuxkernel*.out"/>
<exec failonerror="true" executable="wc">
<arg line="--lines --bytes ${test.input.dir}/kern.log"/>
</exec>
<echo message="Regex: ${test.input.dir}/kern.log -> ${build.testenv}/linuxkernelregex.(out,gc)"/>
<exec failonerror="true" executable="bash" output="${build.testenv}/linuxkernelregex.out">
<arg value="-c"/>
<arg value="etc/sh/FileRunner ${jargs} ${jargs.gc.test}/linuxkernelregex.gc -Djrte.out.enabled=false -Dregex.out.enabled=true
--nil build/Test.model linuxkernelregex ${test.input.dir}/kern.log '${regex.linuxkernel}'"/>
</exec>
<echo message="Ribose: LinuxKernel ${test.input.dir}/kern.log -> ${build.testenv}/linuxkernel.(out,gc)"/>
<exec failonerror="true" executable="bash">
<arg value="-c"/>
<arg value="./ribose ${jargs} ${jargs.gc.test}/linuxkernel.gc run --target-path ${jars.dir}/ribose-0.0.2-test.jar
--nil build/Test.model LinuxKernel ${test.input.dir}/kern.log ${build.testenv}/linuxkernel.out"/>
</exec>
<echo message="Ribose: LinuxKernelLoose ${test.input.dir}/kern.log -> ${build.testenv}/linuxkernelloose.(out,gc)"/>
<exec failonerror="true" executable="bash">
<arg value="-c"/>
<arg value="./ribose ${jargs} ${jargs.gc.test}/linuxkernelloose.gc run --target-path ${jars.dir}/ribose-0.0.2-test.jar
--nil build/Test.model LinuxKernelLoose ${test.input.dir}/kern.log ${build.testenv}/linuxkernelloose.out"/>
</exec>
<echo message="Ribose: LinuxKernelStrict ${test.input.dir}/kern.log -> ${build.testenv}/linuxkernelstrict.(out,gc)"/>
<exec failonerror="true" executable="bash">
<arg value="-c"/>
<arg value="./ribose ${jargs} ${jargs.gc.test}/linuxkernelstrict.gc run --target-path ${jars.dir}/ribose-0.0.2-test.jar
--nil build/Test.model LinuxKernelStrict ${test.input.dir}/kern.log ${build.testenv}/linuxkernelstrict.out"/>
</exec>
<echo message="Ribose[67 byte input buffer]: LinuxKernelStrict ${test.input.dir}/kern.log -> ${build.testenv}/linuxkernelstrict-67.(out,gc)"/>
<exec failonerror="true" executable="bash" >
<arg value="-c"/>
<arg value="./ribose ${jargs} ${jargs.gc.test}/linuxkernelstrict-67.gc -Dribose.inbuffer.size=67 run --target-path ${jars.dir}/ribose-0.0.2-test.jar
--nil build/Test.model LinuxKernelStrict ${test.input.dir}/kern.log ${build.testenv}/linuxkernelstrict-67.out"/>
</exec>
<!-- linux kernel verify -->
<fixcrlf srcDir="${build.testenv}" includes="linuxkernel*.out"/>
<exec failonerror="true" executable="wc">
<arg line="--lines --bytes ${build.testenv}/linuxkernelregex.out"/>
</exec>
<exec failonerror="true" executable="wc">
<arg line="--lines --bytes ${build.testenv}/linuxkernel.out"/>
</exec>
<exec failonerror="true" executable="wc">
<arg line="--lines --bytes ${build.testenv}/linuxkernelloose.out"/>
</exec>
<exec failonerror="true" executable="wc">
<arg line="--lines --bytes ${build.testenv}/linuxkernelstrict.out"/>
</exec>
<exec failonerror="true" executable="wc">
<arg line="--lines --bytes ${build.testenv}/linuxkernelstrict-67.out"/>
</exec>
<condition property="kernel.match">
<and>
<filesmatch file1="${build.testenv}/linuxkernelregex.out" file2="${build.testenv}/linuxkernel.out"/>
<filesmatch file1="${build.testenv}/linuxkernelregex.out" file2="${build.testenv}/linuxkernelloose.out"/>
<filesmatch file1="${build.testenv}/linuxkernelregex.out" file2="${build.testenv}/linuxkernelstrict.out"/>
<filesmatch file1="${build.testenv}/linuxkernelregex.out" file2="${build.testenv}/linuxkernelstrict-67.out"/>
</and>
</condition>
<fail unless="kernel.match" message="Not identical: ${build.testenv}/linuxkernel*.out"/>
<echo message="Identical: ${build.testenv}/linuxkernel*.out"/>
</target>
<target name="test-heap-metrics" depends="test-output-equivalence">
<delete file="./regression.gc" quiet="true"/>
<!-- verbose gc log transduction G1 pause metrics (megabytes) -->
<echo message="G1 evacuation pause metrics (megabytes)"/>
<exec failonerror="true" executable="bash">
<arg value="-c"/>
<arg value="etc/sh/regress --clean ${build.testenv}/vgc.*.gc"/>
</exec>
<!-- verbose gc log transduction final heap stats -->
<echo message="Final heap stats:"/>
<exec failonerror="true" executable="bash">
<arg value="-c"/>
<arg value="grep -o -H 'total [0-9]*K, used [0-9]*K' ${build.testenv}/vgc*.gc"/>
</exec>
<echo/>
<!-- linux kernel log transduction G1 pause metrics (megabytes) -->
<echo message="G1 evacuation pause metrics (megabytes)"/>
<exec failonerror="true" executable="bash">
<arg value="-c"/>
<arg value="etc/sh/regress --clean ${build.testenv}/linuxkernel*.gc"/>
</exec>
<!-- linux kernel log transduction final heap stats -->
<echo message="Final heap size:"/>
<exec failonerror="true" executable="bash">
<arg value="-c"/>
<arg value="grep -o -H 'total [0-9]*K, used [0-9]*K' ${build.testenv}/linuxkernel*.gc"/>
</exec>
</target>
<target name="test" depends="ribose,test-basic,test-testrunner,test-filerunner,test-output-equivalence"/>
<target name="env" if="linux">
<echo message="os (/proc/version)"/>
<exec failonerror="false" executable="bash">
<arg value="-c"/>
<arg value="cat /proc/version"/>
</exec>
<echo message="lscpu"/>
<exec failonerror="false" executable="lscpu" output="${build.testenv}/lscpu.out"/>
<exec failonerror="false" executable="grep" input="${build.testenv}/lscpu.out">
<arg line="-v '^\(Vulnerability\|Flags\)'"/>
</exec>
</target>
<target name="tar-source" depends="clean">
<delete file="jrte-source.tar.gz"/>
<tar destfile="jrte-source.tar.gz" compression="gzip">
<fileset dir=".">
<include name="src/**"/>
<include name="test/**"/>
<include name="${test.patterns}/**"/>
</fileset>
</tar>
</target>
<target name="tar-project" depends="clean">
<delete file="jrte.project.tar.gz"/>
<tar basedir="." destfile="jrte.project.tar.gz" compression="gzip" defaultexcludes="false" excludes="local,build,*.log*,*.tar.gz"/>
</target>
<target name="defaultexcludes">
<defaultexcludes echo="true"/>
</target>
<target name="profile-jit" depends="test-env">
<echo message="TRun: LinuxKernel ${test.input.dir}/kern-10.log -> ${build.testenv}/linuxkernel.jit"/>
<exec failonerror="true" executable="bash" output="${build.testenv}/linuxkernel.jit">
<arg value="-c"/>
<arg value="./ribose ${jargs} ${jargs.jit.diagnostic} -Djrte.out.enabled=false -Dregex.out.enabled=false
run --target-path ${jars.dir}/${ribose.version}-test.jar --nil build/Test.model LinuxKernel ${test.input.dir}/kern-10.log"/>
</exec>
<echo message="TRun: Sintervals ${test.input.dir}/verbosegc.vgc -> ${build.testenv}/sintervals.jit"/>
<exec failonerror="true" executable="bash" output="${build.testenv}/sintervals.jit">
<arg value="-c"/>
<arg value="./ribose ${jargs} ${jargs.jit.diagnostic} -Djrte.out.enabled=false -Dregex.out.enabled=false
run --target-path ${jars.dir}/${ribose.version}-test.jar --nil build/Test.model Sintervals ${test.input.dir}/verbosegc.vgc"/>
</exec>
</target>
<target name="debug" depends="test-env">
<echo message="[./ribose]"/>
</target>
</project>