forked from oltpbenchmark/oltpbench
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
265 lines (229 loc) · 10.1 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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project name="oltpbench" default="build" xmlns:ivy="antlib:org.apache.ivy.ant">
<property environment="env"/>
<property name="debuglevel" value="source,lines,vars"/>
<!-- <property name="javac.target" value="1.10"/> -->
<!-- <property name="javac.source" value="1.10"/> -->
<!-- *************************************** CONFIGURATION *************************************** -->
<property name="src.dir" location="src" />
<property name="tests.dir" location="tests" />
<property name="lib.dir" location="lib" />
<property name="build.dir" location="build" />
<property name="build.tests.dir" location="${build.dir}/tests" />
<property name='build.testoutput.dir' location='${build.dir}/testoutput' />
<path id='project.classpath'>
<pathelement location='${build.dir}' />
<pathelement location='${build.tests.dir}' />
<fileset dir='${lib.dir}'>
<include name='*.jar' />
<exclude name='ant.jar' />
<!-- We need to make sure that we use hsqldb-2 -->
<exclude name='hsqldb-1.*.jar'/>
</fileset>
<pathelement path="${java.class.path}"/>
</path>
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${lib.dir}/ant-contrib.jar"/>
</classpath>
</taskdef>
<!-- EXEC ASSERTS -->
<condition property="assertions" value="false">
<not><isset property="assertions"/></not>
</condition>
<if>
<equals arg1="${assertions}" arg2="true" />
<then>
<assertions id="assertions"><enable /></assertions>
</then>
<else>
<assertions id="assertions"><disable /></assertions>
</else>
</if>
<!-- ************************************** BOOTSTRAP IVY ************************************** -->
<!-- You have to invoke this *before* you can download the dependencies -->
<target name="bootstrap" description="Used to install the ivy task jar">
<mkdir dir="${user.home}/.ant/lib"/>
<get dest="${user.home}/.ant/lib/ivy.jar"
src="http://search.maven.org/remotecontent?filepath=org/apache/ivy/ivy/2.2.0/ivy-2.2.0.jar"/>
</target>
<!-- ************************************* DEPENDENCIES ************************************* -->
<target name="resolve" description="Retrieve dependencies with ivy">
<ivy:retrieve />
</target>
<!-- *************************************** BUILDING *************************************** -->
<target name="build"
description="Build the entire framework">
<fileset dir="${src.dir}" excludes="**/*.launch, **/*.java"/>
<!-- <echo message="${ant.project.name}: ${ant.file}"/> -->
<mkdir dir="${build.dir}/META-INF"/>
<copy file="${src.dir}/META-INF/persistence.xml" todir="${build.dir}/META-INF"/>
<javac debug="true" debuglevel="${debuglevel}" includeantruntime="false"
destdir="${build.dir}">
<src path="${src.dir}"/>
<classpath refid="project.classpath" />
</javac>
<!-- Copy Files -->
<copy todir="${build.dir}">
<fileset dir="${src.dir}">
<include name="**/*-ddl.sql"/>
<include name="**/*-dialects.xml"/>
<include name="**/*.xsd"/>
<include name="**/histogram.*.gz"/>
<include name="**/table.*.gz"/>
</fileset>
</copy>
<mkdir dir="${build.tests.dir}"/>
<javac debug="true" debuglevel="${debuglevel}" includeantruntime="false"
destdir="${build.tests.dir}">
<src path="${tests.dir}"/>
<classpath refid="project.classpath" />
</javac>
</target>
<target name="clean" description="Destroys all generated files and dirs.">
<delete dir="${build.dir}"/>
</target>
<!-- *************************************** EXECUTING *************************************** -->
<target name="execute" description="Execute a benchmark">
<condition property="benchmark" value="">
<not><isset property="benchmark"/></not>
</condition>
<condition property="config" value="">
<not><isset property="config"/></not>
</condition>
<condition property="create" value="false">
<not><isset property="create"/></not>
</condition>
<condition property="clear" value="false">
<not><isset property="clear"/></not>
</condition>
<condition property="load" value="false">
<not><isset property="load"/></not>
</condition>
<condition property="extra" value="">
<not><isset property="extra"/></not>
</condition>
<java fork="yes" failonerror="true" classname="com.oltpbenchmark.DBWorkload">
<jvmarg value="-Xmx2048m" />
<jvmarg value="-Dlog4j.configuration=${basedir}/log4j.properties"/>
<jvmarg value="-client" />
<arg line="-b ${benchmark}" />
<arg line="-c ${config}" />
<arg line="--create ${create}" />
<arg line="--clear ${clear}" />
<arg line="--load ${load}" />
<arg line="--execute ${execute}" />
<arg line="${extra}" />
<classpath refid='project.classpath' />
<assertions refid="assertions"/>
</java>
</target>
<!-- *************************************** TESTING *************************************** -->
<!-- common junit parameters go here -->
<macrodef name='run_junit'>
<attribute name='timeout' default='240000' />
<attribute name='printsummary' default='off' />
<attribute name='showoutput' default='false' />
<element name='tests'/>
<element name='formatters'/>
<sequential>
<mkdir dir='${build.testoutput.dir}' />
<junit
fork="yes"
haltonfailure="${junit.haltonfailure}"
failureproperty="junit.failures"
printsummary="@{printsummary}"
timeout="@{timeout}"
maxmemory='1024M'
showoutput="@{showoutput}"
>
<classpath refid='project.classpath' />
<jvmarg value="-server" />
<jvmarg value="-Xmx2048m"/>
<jvmarg value="-XX:+HeapDumpOnOutOfMemoryError"/>
<formatters/>
<batchtest todir="${build.testoutput.dir}">
<tests/>
</batchtest>
<assertions><enable/></assertions>
</junit>
</sequential>
</macrodef>
<target name="junit"
description="Run all test cases for framework."
depends="build" >
<!-- Run the unit tests -->
<condition property="timeoutLength" value="${timeoutLength}" else='600000'>
<isset property="timeoutLength"/>
</condition>
<!-- Copy Test Files -->
<copy todir="${build.dir}">
<fileset dir="${tests.dir}">
<include name="**/*-ddl.sql"/>
<include name="**/*-dialects.xml"/>
<include name="**/*.xsd"/>
</fileset>
</copy>
<run_junit timeout="${timeoutLength}" printsummary="yes">
<formatters>
<formatter type="plain" unless="hudson"/>
<formatter type="xml" />
</formatters>
<tests>
<fileset dir='${build.tests.dir}'>
<include name="**/Test*.class"/>
<exclude name="**/Test*$*.class"/>
<!--
These are the test cases that are currently broken, so
we're just going to disable them for now
-->
<exclude name="**/TestJPAB*.class"/>
<exclude name="**/TestAuctionMarkLoader.class"/>
<!-- <exclude name="**/TestTPCCLoader.class"/> -->
</fileset>
</tests>
</run_junit>
<fail
if="junit.failures"
unless="emma.enabled"
message="JUnit had failures"
/>
</target>
<target name='junitclass'
description="Run one test case">
<condition property="timeoutLength" value="${timeoutLength}" else='600000'>
<isset property="timeoutLength"/>
</condition>
<run_junit timeout="${timeoutLength}" printsummary="yes" showoutput="yes">
<formatters>
<formatter usefile="false" type="plain"/>
</formatters>
<tests>
<fileset dir='${build.tests.dir}'>
<include name="**/${junitclass}.class"/>
</fileset>
</tests>
</run_junit>
<fail if="junit.failures" message="JUnit had failures" />
</target>
<!-- *************************************** UTILITY *************************************** -->
<target name="dialects-export"
description="Export all of the SQL for a given benchmark to a dialects file">
<condition property="benchmark" value="">
<not><isset property="benchmark"/></not>
</condition>
<condition property="config" value="">
<not><isset property="config"/></not>
</condition>
<java fork="yes" failonerror="true" classname="com.oltpbenchmark.DBWorkload">
<jvmarg value="-Xmx1024m" />
<jvmarg value="-Dlog4j.configuration=${basedir}/log4j.properties"/>
<jvmarg value="-client" />
<arg line="-b ${benchmark}" />
<arg line="-c ${config}" />
<arg line="--dialects-export true" />
<classpath refid='project.classpath' />
<assertions><enable/></assertions>
</java>
</target>
</project>