aboutsummaryrefslogtreecommitdiffhomepage
path: root/build.xml
diff options
context:
space:
mode:
Diffstat (limited to 'build.xml')
-rw-r--r--build.xml110
1 files changed, 96 insertions, 14 deletions
diff --git a/build.xml b/build.xml
index 37b40743..b5727e62 100644
--- a/build.xml
+++ b/build.xml
@@ -1,9 +1,9 @@
1<?xml version="1.0" encoding="UTF-8"?> 1<?xml version="1.0" encoding="UTF-8"?>
2<project name="wallabag" default="build"> 2<project name="wallabag" default="build">
3 <target name="build" depends="clean,prepare,phpunit"/> 3 <target name="build" depends="clean,prepare,phpunit"/>
4 <target name="prepare-mysql" depends="clean,db_mysql,prepare"/> 4 <target name="prepare-mysql" depends="clean,prepare_mysql"/>
5 <target name="prepare-sqlite" depends="clean,db_sqlite,prepare"/> 5 <target name="prepare-sqlite" depends="clean,prepare_sqlite"/>
6 <target name="prepare-pgsql" depends="clean,db_pgsql,prepare"/> 6 <target name="prepare-pgsql" depends="clean,prepare_pgsql"/>
7 7
8 <target name="clean" description="Cleanup build artifacts"> 8 <target name="clean" description="Cleanup build artifacts">
9 <delete dir="${basedir}/var/cache"/> 9 <delete dir="${basedir}/var/cache"/>
@@ -28,57 +28,139 @@
28 </exec> 28 </exec>
29 <exec executable="php"> 29 <exec executable="php">
30 <arg value="${basedir}/bin/console"/> 30 <arg value="${basedir}/bin/console"/>
31 <arg value="cache:clear"/>
32 <arg value="--env=test"/>
33 </exec>
34 <exec executable="php">
35 <arg value="${basedir}/bin/console"/>
36 <arg value="doctrine:fixtures:load"/> 31 <arg value="doctrine:fixtures:load"/>
37 <arg value="--no-interaction"/> 32 <arg value="--no-interaction"/>
38 <arg value="--env=test"/> 33 <arg value="--env=test"/>
39 </exec> 34 </exec>
40 </target> 35 </target>
41 36
42 <target name="db_mysql" description="Run test for MySQL"> 37 <target name="prepare_mysql" description="Run test for MySQL">
43 <delete dir="${basedir}/app/config/parameters.yml"/> 38 <delete dir="${basedir}/app/config/parameters.yml"/>
44 <exec executable="cp"> 39 <exec executable="cp">
45 <arg value="${basedir}/app/config/tests/parameters_test.mysql.yml"/> 40 <arg value="${basedir}/app/config/tests/parameters_test.mysql.yml"/>
46 <arg value="${basedir}/app/config/parameters_test.yml"/> 41 <arg value="${basedir}/app/config/parameters_test.yml"/>
47 </exec> 42 </exec>
48
49 <exec executable="php"> 43 <exec executable="php">
50 <arg value="${basedir}/bin/console"/> 44 <arg value="${basedir}/bin/console"/>
51 <arg value="cache:clear"/> 45 <arg value="cache:clear"/>
52 <arg value="--env=test"/> 46 <arg value="--env=test"/>
53 </exec> 47 </exec>
48 <exec executable="php">
49 <arg value="${basedir}/bin/console"/>
50 <arg value="doctrine:database:drop"/>
51 <arg value="--force"/>
52 <arg value="--env=test"/>
53 </exec>
54 <exec executable="php">
55 <arg value="${basedir}/bin/console"/>
56 <arg value="doctrine:database:create"/>
57 <arg value="--env=test"/>
58 </exec>
59 <exec executable="php">
60 <arg value="${basedir}/bin/console"/>
61 <arg value="doctrine:database:import"/>
62 <arg value="data/sql/mysql_base.sql"/>
63 <arg value="--env=test"/>
64 </exec>
65 <exec executable="php">
66 <arg value="${basedir}/bin/console"/>
67 <arg value="doctrine:migrations:migrate"/>
68 <arg value="--no-interaction"/>
69 <arg value="--env=test"/>
70 </exec>
71 <exec executable="php">
72 <arg value="${basedir}/bin/console"/>
73 <arg value="doctrine:fixtures:load"/>
74 <arg value="--no-interaction"/>
75 <arg value="--env=test"/>
76 </exec>
54 </target> 77 </target>
55 78
56 <target name="db_sqlite" description="Run test for SQLite"> 79 <target name="prepare_sqlite" description="Run test for SQLite">
57 <delete dir="${basedir}/app/config/parameters.yml"/> 80 <delete dir="${basedir}/app/config/parameters.yml"/>
58 <exec executable="cp"> 81 <exec executable="cp">
59 <arg value="${basedir}/app/config/tests/parameters_test.sqlite.yml"/> 82 <arg value="${basedir}/app/config/tests/parameters_test.sqlite.yml"/>
60 <arg value="${basedir}/app/config/parameters_test.yml"/> 83 <arg value="${basedir}/app/config/parameters_test.yml"/>
61 </exec> 84 </exec>
62
63 <exec executable="php"> 85 <exec executable="php">
64 <arg value="${basedir}/bin/console"/> 86 <arg value="${basedir}/bin/console"/>
65 <arg value="cache:clear"/> 87 <arg value="cache:clear"/>
66 <arg value="--env=test"/> 88 <arg value="--env=test"/>
67 </exec> 89 </exec>
90 <exec executable="php">
91 <arg value="${basedir}/bin/console"/>
92 <arg value="doctrine:database:drop"/>
93 <arg value="--force"/>
94 <arg value="--env=test"/>
95 </exec>
96 <exec executable="php">
97 <arg value="${basedir}/bin/console"/>
98 <arg value="doctrine:database:create"/>
99 <arg value="--env=test"/>
100 </exec>
101 <exec executable="php">
102 <arg value="${basedir}/bin/console"/>
103 <arg value="doctrine:schema:create"/>
104 <arg value="--env=test"/>
105 </exec>
106 <exec executable="php">
107 <arg value="${basedir}/bin/console"/>
108 <arg value="doctrine:migrations:migrate"/>
109 <arg value="--no-interaction"/>
110 <arg value="--env=test"/>
111 </exec>
112 <exec executable="php">
113 <arg value="${basedir}/bin/console"/>
114 <arg value="doctrine:fixtures:load"/>
115 <arg value="--no-interaction"/>
116 <arg value="--env=test"/>
117 </exec>
68 </target> 118 </target>
69 119
70 <target name="db_pgsql" description="Run test for PostgreSQL"> 120 <target name="prepare_pgsql" description="Run test for PostgreSQL">
71 <delete dir="${basedir}/app/config/parameters.yml"/> 121 <delete dir="${basedir}/app/config/parameters.yml"/>
72 <exec executable="cp"> 122 <exec executable="cp">
73 <arg value="${basedir}/app/config/tests/parameters_test.pgsql.yml"/> 123 <arg value="${basedir}/app/config/tests/parameters_test.pgsql.yml"/>
74 <arg value="${basedir}/app/config/parameters_test.yml"/> 124 <arg value="${basedir}/app/config/parameters_test.yml"/>
75 </exec> 125 </exec>
76
77 <exec executable="php"> 126 <exec executable="php">
78 <arg value="${basedir}/bin/console"/> 127 <arg value="${basedir}/bin/console"/>
79 <arg value="cache:clear"/> 128 <arg value="cache:clear"/>
80 <arg value="--env=test"/> 129 <arg value="--env=test"/>
81 </exec> 130 </exec>
131 <exec executable="php">
132 <arg value="${basedir}/bin/console"/>
133 <arg value="doctrine:database:drop"/>
134 <arg value="--force"/>
135 <arg value="--env=test"/>
136 </exec>
137 <exec executable="php">
138 <arg value="${basedir}/bin/console"/>
139 <arg value="doctrine:database:create"/>
140 <arg value="--env=test"/>
141 </exec>
142 <exec executable="psql">
143 <arg value="-h"/>
144 <arg value="localhost"/>
145 <arg value="-d"/>
146 <arg value="wallabag_test"/>
147 <arg value="-U"/>
148 <arg value="travis"/>
149 <arg value="-f"/>
150 <arg value="data/sql/pgsql_base.sql"/>
151 </exec>
152 <exec executable="php">
153 <arg value="${basedir}/bin/console"/>
154 <arg value="doctrine:migrations:migrate"/>
155 <arg value="--no-interaction"/>
156 <arg value="--env=test"/>
157 </exec>
158 <exec executable="php">
159 <arg value="${basedir}/bin/console"/>
160 <arg value="doctrine:fixtures:load"/>
161 <arg value="--no-interaction"/>
162 <arg value="--env=test"/>
163 </exec>
82 </target> 164 </target>
83 165
84 <target name="phpunit" description="Run unit tests with PHPUnit + HTML Coverage"> 166 <target name="phpunit" description="Run unit tests with PHPUnit + HTML Coverage">