forked from elastic/hunspell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
113 lines (97 loc) · 3.65 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
<!--
Licensed to Elasticsearch under one or more contributor
license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright
ownership. Elasticsearch licenses this file to you under
the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!--
runs tests for dictionaries.
please feel free to turn into pom.xml if you like that kind of thing.
-->
<project name="hunspell-tests" default="test" basedir="."
xmlns:ivy="antlib:org.apache.ivy.ant"
xmlns:junit4="antlib:com.carrotsearch.junit4">
<path id="compile.path">
<path refid="dependencies.path"/>
<pathelement location="src/java"/>
<pathelement location="src/resources"/>
</path>
<path id="test.path">
<pathelement location="build/classes/java"/>
<pathelement location="src/test-resources"/>
<pathelement location="dicts"/>
<path refid="compile.path"/>
</path>
<target name="resolve">
<!-- override: just for safety, should be unnecessary -->
<ivy:configure file="ivy-settings.xml" override="true"/>
<ivy:cachepath pathid="dependencies.path" log="download-only" type="bundle,jar"/>
<taskdef resource="com/carrotsearch/junit4/antlib.xml" uri="antlib:com.carrotsearch.junit4" classpathref="dependencies.path"/>
</target>
<target name="clean">
<delete dir="build"/>
</target>
<target name="compile" depends="resolve">
<compile src="src/java" dest="build/classes/java" classpathref="compile.path"/>
</target>
<target name="compile-test" depends="compile">
<compile src="src/test" dest="build/classes/test" classpathref="test.path"/>
</target>
<macrodef name="compile">
<attribute name="src"/>
<attribute name="dest"/>
<attribute name="classpathref"/>
<sequential>
<mkdir dir="@{dest}"/>
<javac srcdir="@{src}"
destdir="@{dest}"
classpathref="@{classpathref}"
includeantruntime="false"
source="1.7"
target="1.7"
debug="on"
encoding="UTF-8">
<compilerarg line="-Xlint -Xlint:-serial -Werror"/>
</javac>
</sequential>
</macrodef>
<condition property="tests.class" value="*.${testcase}">
<isset property="testcase"/>
</condition>
<condition property="tests.method" value="*.${testmethod}">
<isset property="testmethod"/>
</condition>
<property name="tests.jvms" value="auto" />
<target name="test" depends="compile-test">
<sequential>
<mkdir dir="build/test"/>
<junit4:pickseed property="tests.seed"/>
<junit4:junit4 dir="build/test"
tempdir="build/test"
parallelism="${tests.jvms}">
<assertions>
<enable/>
</assertions>
<classpath location="build/classes/test"/>
<classpath refid="test.path"/>
<fileset dir="build/classes/test">
<include name="**/Test*.class"/>
<exclude name="**/*$*" />
</fileset>
<listeners>
<junit4:report-text showThrowable="true" showStackTraces="true" showOutput="onerror" showStatusOk="false"/>
</listeners>
</junit4:junit4>
</sequential>
</target>
</project>