forked from sukyoung/safe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
709 lines (663 loc) · 25.4 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
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
<?xml version="1.0" ?>
<!--
Copyright 2012-2014, KAIST.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
-->
<!--
This is the main Ant build file.
-->
<project name="JSAF" default="help" basedir=".">
<description>
An analysis framework for the JavaScript programming language.
</description>
<!--
Properties
-->
<property name="JS" value="."/>
<property name="src" location="${JS}/src/main"/>
<property name="lib" location="${JS}/lib"/>
<property name="bin" location="${JS}/bin"/>
<property name="javaPackagePrefix" value="${src}/java/kr/ac/kaist/jsaf"/>
<property name="scalaPackagePrefix" value="${src}/scala/kr/ac/kaist/jsaf"/>
<property name="usefulPackage" value="${javaPackagePrefix}/useful"/>
<property name="scalaNodes" location="${scalaPackagePrefix}/scala_src/nodes"/>
<property name="nodes" value="${javaPackagePrefix}/nodes"/>
<property name="parser" location="${javaPackagePrefix}/parser"/>
<property name="scala-version" value="scala-2.9.2"/>
<property name="javaSourceVersion" value="1.6"/>
<property name="junitMem" value="768m"/>
<property name="junit.dir" value="junit-results"/>
<property name="bigStack" value="-Xss32m"/>
<property name="astgen.src" location="${JS}/astgen"/>
<property name="astgen.generators.src"
location="${javaPackagePrefix}/astgen"/>
<property name="build" location="target/${scala-version}/classes"/>
<property name="generate-JS" value="${astgen.src}/JS.ast" />
<property name="generate-IR" value="${astgen.src}/IR.ast" />
<property name="generate-RegExp" value="${astgen.src}/RegExp.ast" />
<property name="scala.nodes" location="${scalaNodes}"/>
<property name="astgen.third" location="${JS}/lib/astgen"/>
<property name="test.results" location="${JS}/TEST-RESULTS"/>
<property name="junit" location="${lib}"/>
<property name="junit.dir" value="junit-results"/>
<property name="eclipse" location="${JS}/lib"/>
<path id="astgen.classpath">
<!--
<path refid="scala.classpath"/>
-->
<pathelement location="${build}"/>
<pathelement location="${lib}/astgen.jar"/>
</path>
<path id="compile.classpath">
<pathelement location="${build}"/>
<pathelement location="${lib}/ant-junit.jar"/>
<pathelement location="${lib}/ant.jar"/>
<pathelement location="${lib}/astgen-src.jar"/>
<pathelement location="${lib}/astgen.jar"/>
<pathelement location="${lib}/com.microsoft.z3.jar"/>
<pathelement location="${lib}/commons-io-2.3.jar"/>
<pathelement location="${lib}/commons-lang3-3.1.jar"/>
<pathelement location="${lib}/jericho-html-3.3.jar"/>
<pathelement location="${lib}/jline-2.12.jar"/>
<pathelement location="${lib}/js.jar"/>
<pathelement location="${lib}/junit.jar"/>
<pathelement location="${lib}/junit_src.jar"/>
<pathelement location="${lib}/lift-json_2.9.1-2.4.jar"/>
<pathelement location="${lib}/nekohtml.jar"/>
<pathelement location="${lib}/plt.jar"/>
<pathelement location="${lib}/rats-runtime.jar"/>
<pathelement location="${lib}/scala-compiler-2.9.2.jar"/>
<pathelement location="${lib}/scala-library-2.9.2.jar"/>
<pathelement location="${lib}/urihandler.jar"/>
<pathelement location="${lib}/wala.cast.jar"/>
<pathelement location="${lib}/wala.cast.js.jar"/>
<pathelement location="${lib}/wala.classloader.jar"/>
<pathelement location="${lib}/wala.util.jar"/>
<pathelement location="${lib}/xercesImpl.jar"/>
<pathelement location="${lib}/xml-apis.jar"/>
<pathelement location="${bin}/xtc.jar"/>
</path>
<!--
Taskdefs
-->
<taskdef name="astgen" classpath="${lib}/astgen.jar;${build}"
classname="edu.rice.cs.astgen.AntTask"/>
<taskdef name="junit" classpath="${lib}/junit.jar;${lib}/ant-junit.jar;${build}"
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>
<!--
Targets
-->
<target name="help">
<echo message="ant astGenerators, checkAstgen, checkJSParserUptodate, checkJsonParserUptodate, checkNodesUptodate, checkParserUptodate, checkRegExpParserUptodate, clean, cleanNodes, compile, compileCommon, cron, debug, help, init, jsonparser, jsparser, makeIR, makeJS, makeNodes, makeRegExp, parser, reparser, test, testAssert, testBugDetector, testCFG, testCompiler, testConcolic, testDisambiguator, testInterpreter, testNightly, testParser, testTyping, testUnparser"/>
<echo message="If you are building JSAF, you want ant compile."/>
</target>
<target name="debug">
<echo message="${junit.dir}"/>
<echo message="${astgen.classpath}"/>
</target>
<target name="init">
<echo message="basedir: ${JS}"/>
<!-- Create the time stamp. -->
<tstamp/>
<!-- Create the build directory structure used by compile. -->
<mkdir dir="${build}"/>
<mkdir dir="${junit.dir}"/>
</target>
<target name="compileCommon" depends="init"
description="Compile common code.">
<depend srcdir="${src}"
destdir="${build}"
closure="yes"
cache="${JS}/.dependencies"/>
<javac
srcdir="${src}"
destdir="${build}"
source="${javaSourceVersion}"
encoding="UTF-8"
debug="true"
includeantruntime="false"
fork="true">
<!-- Uncomment the following line to print unchecked
warnings. -->
<!-- <compilerarg value="-Xlint:unchecked"/> -->
<classpath refid="compile.classpath"/>
<include name="${javaPackagePrefix}/useful/*.java"/>
</javac>
</target>
<target name="cleanNodes"
description="Delete the ${nodes} directory tree.">
<delete dir="${nodes}"/>
</target>
<target name="clean" depends="cleanNodes"
description="Delete the ${build} directory tree and generated files.">
<delete dir="${build}"/>
<delete dir="${nodes}"/>
<delete dir="${junit.dir}"/>
<delete file="${scalaNodes}/JSAst.scala" />
<delete file="${scalaNodes}/JSIR.scala" />
<delete file="${scalaNodes}/JSRegExp.scala" />
<delete file="${parser}/JS.java"/>
<delete file="${parser}/IR.java"/>
<delete file="${parser}/RegExp.java"/>
<delete file="${parser}/Json.java"/>
<delete>
<fileset dir="${JS}/src" includes="**/*.class" />
</delete>
</target>
<target name="checkAstgen">
<condition property="astgenerators.uptodate">
<and>
<uptodate targetfile="${build}/kr/ac/kaist/jsaf/astgen/ScalaAstGenerator.class">
<srcfiles dir="${javaPackagePrefix}/astgen/" includes="*.java"/>
</uptodate>
<uptodate targetfile="${build}/kr/ac/kaist/jsaf/astgen/ScalaIRGenerator.class">
<srcfiles dir="${javaPackagePrefix}/astgen/" includes="*.java"/>
</uptodate>
<uptodate targetfile="${build}/kr/ac/kaist/jsaf/astgen/ScalaRegExpGenerator.class">
<srcfiles dir="${javaPackagePrefix}/astgen/" includes="*.java"/>
</uptodate>
</and>
</condition>
<echo message="astgenerators.uptodate: ${astgenerators.uptodate}"/>
</target>
<target name="astGenerators"
unless="astgenerators.uptodate"
depends="init,checkAstgen"
description="Compile all ASTGen custom generators.">
<depend srcdir="${astgen.generators.src}"
destdir="${build}"
closure="yes"
cache="${JS}/.dependencies"/>
<javac
srcdir="${astgen.generators.src}"
destdir="${build}"
source="${javaSourceVersion}"
encoding="UTF-8"
debug="true"
includeantruntime="false"
fork="true"
memorymaximumsize="${junitMem}">
<!-- <compilerarg value="-Xlint:unchecked"/> -->
<classpath refid="astgen.classpath"/>
<include name="**/*.java"/>
<exclude name="${usefulPackage}/*.java"/>
</javac>
</target>
<target name="checkNodesUptodate" depends="astGenerators">
<condition property="nodes.uptodate">
<and>
<available file="${nodes}/AbstractNode.java"/>
<uptodate srcfile="${astgen.src}/JS.ast"
targetfile="${nodes}/AbstractNode.java"/>
<uptodate srcfile="${astgen.src}/IR.ast"
targetfile="${nodes}/AbstractNode.java"/>
<uptodate srcfile="${astgen.src}/RegExp.ast"
targetfile="${nodes}/AbstractNode.java"/>
</and>
</condition>
<echo message="Nodes up to date? ${nodes.uptodate}"/>
</target>
<target name="makeNodes" depends="makeJS, makeIR, makeRegExp"
description="Create all automatically generated nodes">
</target>
<target name="makeJS" unless="nodes.uptodate" depends="checkNodesUptodate"
description="Automatically generate JS AST nodes.">
<echo message="Processing ${generate-JS}" />
<astgen file="${generate-JS}" />
<move todir="${nodes}">
<fileset dir="${astgen.src}">
<include name="**/*.java"/>
<exclude name="**/JS.ast"/>
</fileset>
</move>
<replace dir="${nodes}"
token="java.lang.Object"
value="Object" />
<move todir="${scala.nodes}">
<fileset dir="${astgen.src}">
<include name="JSAst.scala" />
</fileset>
</move>
</target>
<target name="makeIR" unless="nodes.uptodate" depends="checkNodesUptodate"
description="Automatically generate IR nodes.">
<echo message="Processing ${generate-IR}" />
<astgen file="${generate-IR}" />
<move todir="${nodes}">
<fileset dir="${astgen.src}">
<include name="**/*.java"/>
<exclude name="**/IR.ast"/>
</fileset>
</move>
<replace dir="${nodes}"
token="java.lang.Object"
value="Object" />
<move todir="${scala.nodes}">
<fileset dir="${astgen.src}">
<include name="JSIR.scala" />
</fileset>
</move>
</target>
<target name="makeRegExp" unless="nodes.uptodate" depends="checkNodesUptodate"
description="Automatically generate RegExp nodes.">
<echo message="Processing ${generate-RegExp}" />
<astgen file="${generate-RegExp}" />
<move todir="${nodes}">
<fileset dir="${astgen.src}">
<include name="**/*.java"/>
<exclude name="**/RegExp.ast"/>
</fileset>
</move>
<replace dir="${nodes}"
token="java.lang.Object"
value="Object" />
<move todir="${scala.nodes}">
<fileset dir="${astgen.src}">
<include name="JSRegExp.scala" />
</fileset>
</move>
</target>
<!-- If the generated file JS.java is no older than all the rats files
in the parser directory, then the parser must be up to date.
This is a conservative test; a more precise test would perform a
dependency analysis over Rats! code.-->
<target name="checkParserUptodate" depends="init">
<condition property="parser.uptodate">
<and>
<uptodate targetfile="${parser}/JS.java">
<srcfiles dir="${parser}" includes="**/*.rats"/>
</uptodate>
<uptodate targetfile="${parser}/RegExp.java">
<srcfiles dir="${parser}" includes="**/RegExp.rats"/>
</uptodate>
<uptodate targetfile="${parser}/Json.java">
<srcfiles dir="${parser}" includes="**/Json.rats"/>
</uptodate>
</and>
</condition>
<echo>Parser up to date? ${parser.uptodate}</echo>
</target>
<target name="checkJSParserUptodate" depends="init">
<condition property="jsparser.uptodate">
<uptodate targetfile="${parser}/JS.java" >
<srcfiles dir= "${parser}" includes="**/*.rats" excludes="**/RegExp.rats"/>
<srcfiles dir= "${parser}" includes="**/*.rats" excludes="**/Json.rats"/>
</uptodate>
</condition>
<echo>JavaScript parser up to date? ${jsparser.uptodate}</echo>
</target>
<target name="checkRegExpParserUptodate" depends="init">
<uptodate property="reparser.uptodate" targetfile="${parser}/RegExp.java" >
<srcfiles dir= "${parser}" includes="RegExp.rats"/>
</uptodate>
<echo>JavaScript RegExp parser up to date? ${reparser.uptodate}</echo>
</target>
<target name="checkJsonParserUptodate" depends="init">
<uptodate property="reparser.uptodate" targetfile="${parser}/Json.java" >
<srcfiles dir= "${parser}" includes="Json.rats"/>
</uptodate>
<echo>JavaScript Json parser up to date? ${reparser.uptodate}</echo>
</target>
<macrodef name="buildparser">
<attribute name="name" />
<attribute name="file" />
<attribute name="dir" />
<sequential>
<echo message="Rebuilding @{name}... dir=@{dir}"/>
<java fork="yes"
failonerror="yes"
dir="@{dir}"
classname="xtc.parser.Rats"
classpath="${bin}/xtc.jar">
<arg value="-in"/>
<arg value="${src}/java"/>
<arg value="-enc-out"/>
<arg value="UTF-8"/>
<arg value="@{file}"/>
</java>
</sequential>
</macrodef>
<target name="jsparser" unless="jsparser.uptodate"
depends="checkJSParserUptodate"
description="JS Parser">
<buildparser name="JS" dir="${parser}" file="JS.rats" />
</target>
<target name="reparser" unless="reparser.uptodate"
depends="checkRegExpParserUptodate"
description="RegExp Parser">
<buildparser name="RegExp" dir="${parser}" file="RegExp.rats" />
</target>
<target name="jsonparser" unless="jsonparser.uptodate"
depends="checkJsonParserUptodate"
description="Json Parser">
<buildparser name="Json" dir="${parser}" file="Json.rats" />
</target>
<target name="parser" unless="parser.uptodate"
depends="checkParserUptodate"
description="JavaScript Parser">
<ant target="jsparser" />
<ant target="reparser" />
<ant target="jsonparser" />
</target>
<target name="compile" depends="compileCommon, makeNodes, parser"
description="Compile all JSAF code.">
</target>
<target name="cron"
description="Configure user crontab to run all unit and system tests expected to pass.">
<echo file="${JS}/crontab">
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=js-test@plrg.kaist.ac.kr
JS_HOME=${env.JS_HOME}
30 3 * * * source $JS_HOME/bin/nightly
</echo>
<exec executable="crontab">
<arg value="${JS}/crontab" />
</exec>
<delete file="${JS}/crontab" />
</target>
<target name="test" depends="compile, testParser, testUnparser,
testDisambiguator, testCompiler, testInterpreter,
testCFG, testTyping, testAssert, testBugDetector"
description="Clean, compile everything, and run all unit and system tests.">
</target>
<target name="testParser"
description="Run the parser tests">
<mkdir dir="${test.results}"/>
<mkdir dir="${JS}/test-tmp" />
<junit printsummary="on"
haltonerror="off"
haltonfailure="off"
showoutput="yes"
fork="true"
maxmemory="${junitMem}"
errorProperty="tests.failed"
failureProperty="tests.failed">
<classpath refid="compile.classpath"/>
<jvmarg value="-Djava.io.tmpdir=${JS}/test-tmp" />
<jvmarg value="${bigStack}" />
<formatter type="plain" usefile="true"/>
<batchtest fork="false" todir="${junit.dir}">
<formatter type="brief" usefile="false" />
<formatter type="xml" />
<fileset dir="${build}">
<include name="**/ParserJUTest.class"/>
<exclude name="**/*$*.class"/>
</fileset>
</batchtest>
</junit>
<delete dir="${JS}/test-tmp" />
<fail message="Tests expected to pass are failing!" if="tests.failed"/>
</target>
<target name="testUnparser"
description="Run the unparser tests">
<mkdir dir="${test.results}"/>
<mkdir dir="${JS}/test-tmp" />
<junit printsummary="on"
haltonerror="off"
haltonfailure="off"
showoutput="yes"
fork="true"
maxmemory="${junitMem}"
errorProperty="tests.failed"
failureProperty="tests.failed">
<classpath refid="compile.classpath"/>
<jvmarg value="-Djava.io.tmpdir=${JS}/test-tmp" />
<jvmarg value="${bigStack}" />
<formatter type="plain" usefile="true"/>
<batchtest fork="true" todir="${junit.dir}">
<formatter type="brief" usefile="false" />
<formatter type="xml" />
<fileset dir="${build}">
<include name="**/UnparserJUTest.class"/>
<exclude name="**/*$*.class"/>
</fileset>
</batchtest>
</junit>
<delete dir="${JS}/test-tmp" />
<fail message="Tests expected to pass are failing!" if="tests.failed"/>
</target>
<target name="testDisambiguator"
description="Run the disambiguator tests">
<mkdir dir="${test.results}"/>
<mkdir dir="${JS}/test-tmp" />
<junit printsummary="on"
haltonerror="off"
haltonfailure="off"
showoutput="yes"
fork="true"
maxmemory="${junitMem}"
errorProperty="tests.failed"
failureProperty="tests.failed">
<classpath refid="compile.classpath"/>
<jvmarg value="-Djava.io.tmpdir=${JS}/test-tmp" />
<jvmarg value="${bigStack}" />
<formatter type="plain" usefile="true"/>
<batchtest fork="false" todir="${junit.dir}">
<formatter type="brief" usefile="false" />
<formatter type="xml" />
<fileset dir="${build}">
<include name="**/DisambiguatorJUTest.class"/>
<exclude name="**/*$*.class"/>
</fileset>
</batchtest>
</junit>
<delete dir="${JS}/test-tmp" />
<fail message="Tests expected to pass are failing!" if="tests.failed"/>
</target>
<target name="testCompiler"
description="Run the AST2IR-checker tests">
<mkdir dir="${test.results}"/>
<mkdir dir="${JS}/test-tmp" />
<junit printsummary="on"
haltonerror="off"
haltonfailure="off"
showoutput="yes"
fork="true"
maxmemory="${junitMem}"
errorProperty="tests.failed"
failureProperty="tests.failed">
<classpath refid="compile.classpath"/>
<jvmarg value="-Djava.io.tmpdir=${JS}/test-tmp" />
<jvmarg value="${bigStack}" />
<formatter type="plain" usefile="true"/>
<batchtest fork="true" todir="${junit.dir}">
<formatter type="brief" usefile="false" />
<formatter type="xml" />
<fileset dir="${build}">
<include name="**/CompilerJUTest.class"/>
<exclude name="**/*$*.class"/>
</fileset>
</batchtest>
</junit>
<delete dir="${JS}/test-tmp" />
<fail message="Tests expected to pass are failing!" if="tests.failed"/>
</target>
<target name="testInterpreter"
description="Run the Interpreter tests">
<mkdir dir="${test.results}"/>
<mkdir dir="${JS}/test-tmp" />
<junit printsummary="on"
haltonerror="off"
haltonfailure="off"
showoutput="yes"
fork="true"
maxmemory="${junitMem}"
errorProperty="tests.failed"
failureProperty="tests.failed">
<classpath refid="compile.classpath"/>
<jvmarg value="-Djava.io.tmpdir=${JS}/test-tmp" />
<jvmarg value="${bigStack}" />
<formatter type="plain" usefile="true"/>
<batchtest fork="true" todir="${junit.dir}">
<formatter type="brief" usefile="false" />
<formatter type="xml" />
<fileset dir="${build}">
<include name="**/InterpreterJUTest.class"/>
<exclude name="**/*$*.class"/>
</fileset>
</batchtest>
</junit>
<delete dir="${JS}/test-tmp" />
<fail message="Tests expected to pass are failing!" if="tests.failed"/>
</target>
<target name="testCFG"
description="Run the CFGBuilder tests">
<mkdir dir="${test.results}"/>
<mkdir dir="${JS}/test-tmp" />
<junit printsummary="on"
haltonerror="off"
haltonfailure="off"
showoutput="yes"
fork="true"
maxmemory="${junitMem}"
errorProperty="tests.failed"
failureProperty="tests.failed">
<classpath refid="compile.classpath"/>
<jvmarg value="-Djava.io.tmpdir=${JS}/test-tmp" />
<jvmarg value="${bigStack}" />
<formatter type="plain" usefile="true"/>
<batchtest fork="false" todir="${junit.dir}">
<formatter type="brief" usefile="false" />
<formatter type="xml" />
<fileset dir="${build}">
<include name="**/CFGJUTest.class"/>
<exclude name="**/*$*.class"/>
</fileset>
</batchtest>
</junit>
<delete dir="${JS}/test-tmp" />
<fail message="Tests expected to pass are failing!" if="tests.failed"/>
</target>
<target name="testTyping"
description="Run the Typing tests">
<mkdir dir="${test.results}"/>
<mkdir dir="${JS}/test-tmp" />
<junit printsummary="on"
haltonerror="off"
haltonfailure="off"
showoutput="yes"
fork="true"
maxmemory="${junitMem}"
errorProperty="tests.failed"
failureProperty="tests.failed">
<classpath refid="compile.classpath"/>
<jvmarg value="-Djava.io.tmpdir=${JS}/test-tmp" />
<jvmarg value="${bigStack}" />
<formatter type="plain" usefile="true"/>
<batchtest fork="false" todir="${junit.dir}">
<formatter type="brief" usefile="false" />
<formatter type="xml" />
<fileset dir="${build}">
<include name="**/TypingJUTest.class"/>
<exclude name="**/*$*.class"/>
</fileset>
</batchtest>
</junit>
<delete dir="${JS}/test-tmp" />
<fail message="Tests expected to pass are failing!" if="tests.failed"/>
</target>
<target name="testAssert"
description="Run the Assert tests">
<mkdir dir="${test.results}"/>
<mkdir dir="${JS}/test-tmp" />
<junit printsummary="on"
haltonerror="off"
haltonfailure="off"
showoutput="yes"
fork="true"
maxmemory="${junitMem}"
errorProperty="tests.failed"
failureProperty="tests.failed">
<classpath refid="compile.classpath"/>
<jvmarg value="-Djava.io.tmpdir=${JS}/test-tmp" />
<jvmarg value="${bigStack}" />
<formatter type="plain" usefile="true"/>
<batchtest fork="false" todir="${junit.dir}">
<formatter type="brief" usefile="false" />
<formatter type="xml" />
<fileset dir="${build}">
<include name="**/AssertJUTest.class"/>
<exclude name="**/*$*.class"/>
</fileset>
</batchtest>
</junit>
<delete dir="${JS}/test-tmp" />
<fail message="Tests expected to pass are failing!" if="tests.failed"/>
</target>
<target name="testBugDetector"
description="Run the bug detector tests">
<mkdir dir="${test.results}"/>
<mkdir dir="${JS}/test-tmp" />
<junit printsummary="on"
haltonerror="off"
haltonfailure="off"
showoutput="yes"
fork="true"
maxmemory="${junitMem}"
errorProperty="tests.failed"
failureProperty="tests.failed">
<classpath refid="compile.classpath"/>
<jvmarg value="-Djava.io.tmpdir=${JS}/test-tmp" />
<jvmarg value="${bigStack}" />
<formatter type="plain" usefile="true"/>
<batchtest fork="true" todir="${junit.dir}">
<formatter type="brief" usefile="false" />
<formatter type="xml" />
<fileset dir="${build}">
<include name="**/BugDetectorJUTest.class"/>
<exclude name="**/*$*.class"/>
</fileset>
</batchtest>
</junit>
<delete dir="${JS}/test-tmp" />
<fail message="Tests expected to pass are failing!" if="tests.failed"/>
</target>
<target name="testNightly" depends="compile"
description="Run all the unit and system tests expected to pass.">
<mkdir dir="${test.results}"/>
<mkdir dir="${JS}/test-tmp" />
<junit printsummary="on"
haltonerror="off"
haltonfailure="off"
showoutput="yes"
fork="true"
maxmemory="${junitMem}"
errorProperty="tests.failed"
failureProperty="tests.failed">
<classpath refid="compile.classpath"/>
<jvmarg value="-Djava.io.tmpdir=${JS}/test-tmp" />
<jvmarg value="${bigStack}" />
<formatter type="plain" usefile="true"/>
<batchtest fork="false" todir="${junit.dir}">
<formatter type="brief" usefile="false" />
<formatter type="xml" />
<fileset dir="${build}">
<include name="**/NightlyParserJUTest.class"/>
<include name="**/UnparserJUTest.class"/>
<include name="**/DisambiguatorJUTest.class"/>
<include name="**/TranslatorJUTest.class"/>
<include name="**/InterpreterJUTest.class"/>
<include name="**/NightlyInterpreterJUTest.class"/>
<include name="**/MozillaInterpreterJUTest.class"/>
<include name="**/CFGJUTest.class"/>
<include name="**/AssertJUTest.class"/>
<include name="**/TypingJUTest.class"/>
<include name="**/BugDetectorJUTest.class"/>
<include name="**/TypingTizenTest.class"/>
<exclude name="**/*$*.class"/>
</fileset>
</batchtest>
</junit>
<delete dir="${JS}/test-tmp" />
<fail message="Tests expected to pass are failing!" if="tests.failed"/>
</target>
<target name="buildJSCD"
depends="compile"
description="Build JavaScript clone detector.">
<exec executable="${JS}/bin/jscd_build.sh" failonerror="true">
</exec>
</target>
</project>