forked from zendframework/zendframework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
142 lines (130 loc) · 5.51 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="ZF2" default="build">
<target name="travis" depends="tests-parallel,show-test-results" />
<target name="clean" description="Cleanup build artifacts">
<delete dir="${basedir}/build"/>
</target>
<target name="prepare" depends="clean" description="Prepare for build">
<mkdir dir="${basedir}/build/test-results"/>
<mkdir dir="${basedir}/build/cs-results"/>
</target>
<target name="get-cs-fixer" depends="clean" description="Get coding standards fixer">
<get src="http://cs.sensiolabs.org/get/php-cs-fixer.phar" dest="${basedir}/php-cs-fixer.phar"/>
</target>
<target name="composer-install" description="Installs dependencies via composer install">
<sequential>
<exec executable="composer" failonerror="true">
<arg value="self-update" />
</exec>
<exec executable="composer" failonerror="true">
<arg value="--version" />
</exec>
<exec executable="composer" failonerror="true">
<arg value="install" />
<arg value="--dev" />
<arg value="--prefer-source" />
</exec>
</sequential>
</target>
<target
name="tests-parallel"
depends="prepare,composer-install,get-cs-fixer"
description="Run tests for the various components in parallel"
>
<parallel threadCount="8">
<!--
If there's a way of having this without the explicit component
list, please PR
-->
<component-test component="Authentication"/>
<component-test component="Barcode"/>
<component-test component="Cache"/>
<component-test component="Captcha"/>
<component-test component="Code"/>
<component-test component="Config"/>
<component-test component="Console"/>
<component-test component="Crypt"/>
<component-test component="Db"/>
<component-test component="Debug"/>
<component-test component="Di"/>
<component-test component="Dom"/>
<component-test component="Escaper"/>
<component-test component="EventManager"/>
<component-test component="Feed"/>
<component-test component="File"/>
<component-test component="Filter"/>
<component-test component="Form"/>
<component-test component="Http"/>
<component-test component="I18n"/>
<component-test component="InputFilter"/>
<component-test component="Json"/>
<component-test component="Ldap"/>
<component-test component="Loader"/>
<component-test component="Log"/>
<component-test component="Mail"/>
<component-test component="Math"/>
<component-test component="Memory"/>
<component-test component="Mime"/>
<component-test component="ModuleManager"/>
<component-test component="Mvc"/>
<component-test component="Navigation"/>
<component-test component="Paginator"/>
<component-test component="Permissions"/>
<component-test component="ProgressBar"/>
<component-test component="Serializer"/>
<component-test component="Server"/>
<component-test component="ServiceManager"/>
<component-test component="Session"/>
<component-test component="Soap"/>
<component-test component="Stdlib"/>
<component-test component="Tag"/>
<component-test component="Test"/>
<component-test component="Text"/>
<component-test component="Uri"/>
<component-test component="Validator"/>
<component-test component="Version"/>
<component-test component="View"/>
<component-test component="XmlRpc"/>
<check-cs/>
</parallel>
</target>
<target name="show-test-results" description="Display logged test results">
<concat>
<fileset dir="${basedir}/build/cs-results/"/>
<fileset dir="${basedir}/build/test-results/"/>
</concat>
</target>
<macrodef name="component-test">
<attribute name="component"/>
<sequential>
<echo output="${basedir}/build/test-results/@{component}.log" level="debug">
ZendTest/@{component}
</echo>
<exec
executable="${basedir}/vendor/bin/phpunit"
output="${basedir}/build/test-results/@{component}.log"
error="${basedir}/build/test-results/@{component}.log"
failonerror="true"
append="true"
>
<arg value="-c" />
<arg value="${basedir}/tests/phpunit.xml.dist" />
<arg value="${basedir}/tests/ZendTest/@{component}" />
</exec>
</sequential>
</macrodef>
<macrodef name="check-cs">
<sequential>
<echo output="${basedir}/build/cs-results/check-cs.log" level="debug">
Coding standards
</echo>
<exec
executable="${basedir}/bin/check-cs.sh"
output="${basedir}/build/cs-results/check-cs.log"
error="${basedir}/build/cs-results/check-cs.log"
failonerror="true"
append="true"
/>
</sequential>
</macrodef>
</project>