2
! ASM: a very small and fast Java bytecode manipulation framework
3
! Copyright (c) 2000-2011 INRIA, France Telecom
6
! Redistribution and use in source and binary forms, with or without
7
! modification, are permitted provided that the following conditions
9
! 1. Redistributions of source code must retain the above copyright
10
! notice, this list of conditions and the following disclaimer.
11
! 2. Redistributions in binary form must reproduce the above copyright
12
! notice, this list of conditions and the following disclaimer in the
13
! documentation and/or other materials provided with the distribution.
14
! 3. Neither the name of the copyright holders nor the names of its
15
! contributors may be used to endorse or promote products derived from
16
! this software without specific prior written permission.
18
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19
! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20
! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21
! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22
! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28
! THE POSSIBILITY OF SUCH DAMAGE.
31
<project name="test" default="test">
33
<!-- ==================================== -->
34
<!-- ======== PROPERTY DEFINITION ======= -->
35
<!-- ==================================== -->
37
<property name="test.conform" value="${test}/conform"/>
38
<property name="test.perf" value="${test}/perf"/>
40
<target name="properties">
41
<condition property="asm.test.class" value="">
42
<not><isset property="asm.test.class"/></not>
45
<condition property="java5">
46
<available classname="java.lang.annotation.Annotation"/>
49
<condition property="test-all">
51
<not><isset property="test.type"/></not>
52
<not><isset property="test.group"/></not>
56
<condition property="test-conform">
58
<equals arg1="${test.type}" arg2="conform"/>
59
<isset property="test-all"/>
63
<condition property="test-perf">
65
<equals arg1="${test.type}" arg2="perf"/>
66
<isset property="test-all"/>
70
<condition property="test.paths.configured">
72
<isset property="bcel.path"/>
73
<isset property="aspectj.path"/>
74
<isset property="serp.path"/>
75
<isset property="javassist.path"/>
76
<isset property="janino.path"/>
77
<isset property="cobertura.path"/>
78
<isset property="cobertura.runtime.path"/>
79
<isset property="kawa.runtime.path"/>
80
<isset property="csg-bytecode.runtime.path"/>
81
<isset property="cojen.runtime.path"/>
82
<isset property="jbet.runtime.path"/>
83
<isset property="jclasslib.runtime.path"/>
84
<isset property="jiapi.runtime.path"/>
85
<isset property="rhino.runtime.path"/>
90
<!-- ================================== -->
91
<!-- ======== INITIALIZATION ======= -->
92
<!-- ================================== -->
94
<target name="check" unless="test.paths.configured">
95
<echo message="The 'build.properties' file must be configured"/>
99
<target name="init" depends="properties,check">
100
<mkdir dir="${out.test}"/>
101
<mkdir dir="${out.test}/cases"/>
102
<mkdir dir="${out.test}/reports"/>
103
<path id="test.classpath">
104
<pathelement location="${out.build}/tmp"/>
105
<pathelement location="${out.test}"/>
106
<pathelement path="${bcel.path}"/>
107
<pathelement path="${aspectj.path}"/>
108
<pathelement path="${serp.path}"/>
109
<pathelement path="${javassist.path}"/>
110
<pathelement path="${janino.path}"/>
111
<pathelement path="${cobertura.runtime.path}"/>
112
<pathelement path="${kawa.runtime.path}"/>
113
<pathelement path="${csg-bytecode.runtime.path}"/>
114
<pathelement path="${cojen.runtime.path}"/>
115
<pathelement path="${jbet.runtime.path}"/>
116
<pathelement path="${jclasslib.runtime.path}"/>
117
<pathelement path="${jiapi.runtime.path}"/>
118
<pathelement path="${rhino.runtime.path}"/>
122
<!-- ==================================== -->
123
<!-- =========== COMPILATION ============ -->
124
<!-- ==================================== -->
126
<target name="compile.test.conform" depends="init">
127
<javac srcdir="${test.conform}" destdir="${out.test}"
128
source="1.5" target="1.5"
129
debug="on" debuglevel="lines,vars,source">
130
<classpath refid="test.classpath"/>
131
<include name="**/*.java"/>
133
<delete dir="${out.test}/cases"/>
134
<java classname="org.objectweb.asm.test.cases.Generator">
136
<pathelement location="${out.build}"/>
137
<pathelement location="${out.test}"/>
139
<arg value="${out.test}/cases"/>
143
<target name="compile.test.perf" depends="init">
144
<javac srcdir="${test.perf}" destdir="${out.test}" debug="on" source="1.5" target="1.5">
145
<classpath refid="test.classpath"/>
146
<include name="**/*.java"/>
147
<exclude name="**/xml/*.java"/>
151
<target name="compile" depends="compile.test.conform,compile.test.perf"/>
153
<!-- ============================= -->
154
<!-- =========== TEST ============ -->
155
<!-- ============================= -->
157
<target name="testConform" depends="compile" if="test-conform">
158
<ant antfile="${test.conform}/adviceadapter.xml" inheritRefs="true"/>
159
<ant antfile="${test.conform}/analyzeradapter.xml" inheritRefs="true"/>
160
<ant antfile="${test.conform}/annotations.xml" inheritRefs="true"/>
161
<ant antfile="${test.conform}/asmifier.xml" inheritRefs="true"/>
162
<ant antfile="${test.conform}/basicinterpreter.xml" inheritRefs="true"/>
163
<ant antfile="${test.conform}/basicverifier.xml" inheritRefs="true"/>
164
<ant antfile="${test.conform}/checkclassadapter.xml" inheritRefs="true"/>
165
<ant antfile="${test.conform}/checksignatureadapter.xml" inheritRefs="true"/>
166
<ant antfile="${test.conform}/classadapter.xml" inheritRefs="true"/>
167
<ant antfile="${test.conform}/classnode.xml" inheritRefs="true"/>
168
<ant antfile="${test.conform}/classreader.xml" inheritRefs="true"/>
169
<ant antfile="${test.conform}/classwriter.xml" inheritRefs="true"/>
170
<ant antfile="${test.conform}/classwritercomputeframes.xml" inheritRefs="true"/>
171
<ant antfile="${test.conform}/classwritercomputeframesdeadcode.xml" inheritRefs="true"/>
172
<ant antfile="${test.conform}/classwritercomputemaxs.xml" inheritRefs="true"/>
173
<ant antfile="${test.conform}/classwritercopypool.xml" inheritRefs="true"/>
174
<ant antfile="${test.conform}/classwriterresizeinsns.xml" inheritRefs="true"/>
175
<ant antfile="${test.conform}/codesizeevaluator.xml" inheritRefs="true"/>
176
<ant antfile="${test.conform}/gasmifier.xml" inheritRefs="true"/>
177
<ant antfile="${test.conform}/jsrinlineradapter.xml" inheritRefs="true"/>
178
<ant antfile="${test.conform}/localvariablessorter.xml" inheritRefs="true"/>
179
<ant antfile="${test.conform}/localvariablessorter2.xml" inheritRefs="true"/>
180
<ant antfile="${test.conform}/remappingadapter.xml" inheritRefs="true"/>
181
<ant antfile="${test.conform}/remappingadapter2.xml" inheritRefs="true"/>
182
<ant antfile="${test.conform}/saxadapter.xml" inheritRefs="true"/>
183
<ant antfile="${test.conform}/signaturewriter.xml" inheritRefs="true"/>
184
<ant antfile="${test.conform}/simpleverifier.xml" inheritRefs="true"/>
185
<ant antfile="${test.conform}/sourceinterpreter.xml" inheritRefs="true"/>
186
<ant antfile="${test.conform}/staticinitmerger.xml" inheritRefs="true"/>
187
<ant antfile="${test.conform}/svuidadder.xml" inheritRefs="true"/>
188
<ant antfile="${test.conform}/traceclassadapter.xml" inheritRefs="true"/>
189
<ant antfile="${test.conform}/unit.xml" inheritRefs="true"/>
190
<ant antfile="${test.conform}/verifyclass.xml" inheritRefs="true"/>
193
<target name="testPerf" depends="compile" if="test-perf">
194
<ant antfile="${test.perf}/all.xml" inheritRefs="true"/>
195
<ant antfile="${test.perf}/gen.xml" inheritRefs="true"/>
196
<ant antfile="${test.perf}/mem.xml" inheritRefs="true"/>
199
<target name="testGroup" depends="compile" if="test.group">
200
<ant antfile="test/${test.group}.xml" inheritRefs="true"/>
203
<target name="test" depends="testConform,testPerf,testGroup">
204
<!--junitreport todir="${out.test}/reports">
205
<fileset dir="${out.test}/reports">
206
<include name="TEST-*.xml"/>
208
<report todir="${out.test}/reports"/>
212
<!-- ================================== -->
213
<!-- ===== BINARY COMPATIBILITY ==== -->
214
<!-- ================================== -->
216
<target name="sigtest-setup">
217
<java classname="com.sun.tdk.signaturetest.Setup">
219
<pathelement location="${test}/lib/sigtestdev.jar"/>
221
<arg value="-apiversion"/>
222
<arg value="${product.artifact}"/>
223
<arg value="-static"/>
224
<arg value="-classpath"/>
225
<arg value="${java.home}/lib/rt.jar;${out.dist}/lib/all/asm-all-${product.artifact}.jar"/>
226
<arg value="-package"/>
227
<arg value="org.objectweb.asm"/>
228
<arg value="-filename"/>
229
<arg value="${test}/ASM.sig"/>
233
<target name="sigtest">
234
<taskdef name="atest" classname="com.sun.tdk.signaturetest.ant.ATest"
235
classpath="${test}/lib/sigtestdev.jar"/>
236
<atest filename="${test}/ASM.sig"
237
apiversion="${product.artifact}"
241
<package name="org.objectweb.asm"/>
243
<pathelement location="${java.home}/lib/rt.jar"/>
244
<pathelement location="${out.dist}/lib/all/asm-all-${product.artifact}.jar"/>