forked from neo4j-attic/python-embedded
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
110 lines (95 loc) · 3.56 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
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (c) 2002-2011 "Neo Technology,"
Network Engine for Objects in Lund AB [http://neotechnology.com]
This file is part of Neo4j.
Neo4j is free software: you can redistribute it and/or modify
it under the terms of the GNU 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 a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<project name="neo4j-python" default="test">
<property environment="env"/>
<condition property="testing-cpython">
<and>
<isset property="env.VIRTUAL_ENV"/>
<available file="${env.VIRTUAL_ENV}/bin/python"/>
</and>
</condition>
<condition property="testing-jython">
<and>
<isset property="env.VIRTUAL_ENV"/>
<available file="${env.VIRTUAL_ENV}/bin/jython"/>
</and>
</condition>
<condition property="testing-none">
<not><or>
<isset property="testing-jython"/>
<isset property="testing-cpython"/>
</or></not>
</condition>
<target name="cond cpython-test" if="testing-cpython">
<antcall target="test-cpython"/>
</target>
<target name="cond jython-test" if="testing-jython">
<antcall target="test-jython"/>
</target>
<target name="cond testing" if="testing-none">
<echo>
</echo>
<fail message="Could not find a virtual env with a python for tests"/>
</target>
<target name="test"
depends="cond testing,cond cpython-test,cond jython-test"/>
<target name="test-all" depends="test-cpython,test-jython"/>
<target name="test-cpython"><test python="cpython"/></target>
<target name="test-jython">
<!-- there is an issue with maven passing the classpath through jython:
<test python="jython"/>
instead we inline roughly the same behavior until fixed: -->
<delete dir="target/testdata"/>
<exec executable="src/test/python/unit_tests.py"
resultproperty="mvn-exit-jython">
<arg line="--junit target/surefire-reports"/>
<env key="PYTHON" value="jython"/>
</exec>
<condition property="success-jython">
<equals arg1="0" arg2="${mvn-exit-jython}"/>
</condition>
<antcall target="format-report"/>
<move file="target/junit-noframes.html"
tofile="target/test-jython.html"/>
<fail unless="success-jython" message="Tests failed"/>
<!-- /inline -->
</target>
<macrodef name="test">
<attribute name="python"/>
<sequential>
<delete dir="target/testdata"/>
<exec executable="mvn" resultproperty="mvn-exit-@{python}">
<arg line="test -P@{python}-test"/>
</exec>
<condition property="success-@{python}">
<equals arg1="0" arg2="${mvn-exit-@{python}}"/>
</condition>
<antcall target="format-report"/>
<move file="target/junit-noframes.html"
tofile="target/test-@{python}.html"/>
<fail unless="success-@{python}" message="Tests failed"/>
</sequential>
</macrodef>
<target name="format-report">
<junitreport todir="target/surefire-reports">
<fileset dir="target/surefire-reports">
<include name="TEST-*.xml"/>
</fileset>
<report format="noframes" todir="target" styledir="src/test/format"/>
</junitreport>
</target>
</project>