blob: 8b38e4ea716087fc0e314d36440f0e2a6e767c45 [file] [log] [blame]
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +00001<project name="user" default="build" basedir=".">
fabbott@google.com0e2dc6282008-08-22 16:09:01 +00002 <property name="gwt.root" location=".." />
3 <property name="project.tail" value="user" />
4 <property name="test.args" value="" />
fabbott@google.com25305472009-06-10 21:39:00 +00005
fabbott@google.com0e2dc6282008-08-22 16:09:01 +00006 <import file="${gwt.root}/common.ant.xml" />
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +00007
fabbott@google.com25305472009-06-10 21:39:00 +00008 <property name="gwt.junit.emmatestcase.includes" value="**/*Suite.class,com/google/gwt/dev/jjs/test/*Test.class"/>
jlabanca@google.comf78c54b2009-07-16 17:19:20 +00009 <property name="test.timeout" value="3" />
fabbott@google.com25305472009-06-10 21:39:00 +000010
11 <!--
12 Whether I18NSuite should test e.g. Foo$InnerMsgs_fr.properties (if the
13 value is "dollar") or Foo_Inner_fr.properties (for "bar")
14 -->
15 <property name="gwt.i18n.test.InnerClassChar" value="dollar"/>
16
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000017 <!--
18 Default hosted mode test cases
19 -->
20 <fileset id="default.hosted.tests" dir="${javac.junit.out}"
21 includes="${gwt.junit.testcase.includes}" />
gwt.team.mmendez99f280b2006-12-08 23:11:29 +000022
scottb@google.com6cd61e92009-01-16 19:50:20 +000023 <fileset id="default.emma.tests" dir="${javac.junit.out}"
24 includes="**/EmmaClassLoadingTest.class" />
spoon@google.comd0b00f82009-03-27 14:58:53 +000025
jgw@google.coma3509e22009-02-06 21:06:24 +000026 <fileset id="default.hosted.emma.tests" dir="${javac.junit.out}"
jgw@google.com399b5642009-02-06 21:29:31 +000027 excludes="**/CoverageTest.class,**/CompilerSuite.class" includes="${gwt.junit.emmatestcase.includes}" />
jgw@google.coma3509e22009-02-06 21:06:24 +000028 <!-- everything succeeds except CoverageTest.java. It fails due to a javac bug in sun/OpenJDK's Java. See the file contents for details -->
spoon@google.comd0b00f82009-03-27 14:58:53 +000029
30 <fileset id="default.noserver.tests" dir="${javac.junit.out}" includes="**/IFrameLinkerTest.class" />
31 <!-- Only IFrameLinker actually supports -noserver mode; run the other linker tests if and when they are supported -->
32
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000033 <!--
34 Default web mode test cases
35 -->
36 <fileset id="default.web.tests" dir="${javac.junit.out}"
37 includes="${gwt.junit.testcase.includes}" />
gwt.team.mmendez99f280b2006-12-08 23:11:29 +000038
fabbott@google.com25305472009-06-10 21:39:00 +000039 <!--
40 Classpaths added for test cases
41 -->
42 <path id="test.extraclasspath">
43 <pathelement location="${gwt.build}/out/dev/core/bin-test" />
bobv@google.comb39b79c2009-06-18 15:58:28 +000044 <pathelement location="test-super" />
fabbott@google.com25305472009-06-10 21:39:00 +000045 <pathelement location="test_i18n_${gwt.i18n.test.InnerClassChar}" />
46 </path>
47
amitmanjhi@google.comfef85fa2009-07-30 20:47:31 +000048 <!--
49 Classpaths added for htmlunit libs
50 -->
51 <path id="htmlunit.libs">
52 <pathelement location="${gwt.tools.lib}/apache/commons/commons-codec-1.3.jar" />
53 <pathelement location="${gwt.tools.lib}/tomcat/commons-collections-3.1.jar" />
54 <pathelement location="${gwt.tools.lib}/apache/commons/commons-httpclient-3.1.jar" />
55 <pathelement location="${gwt.tools.lib}/apache/commons/commons-io-1.4.jar" />
56 <pathelement location="${gwt.tools.lib}/apache/commons/commons-lang-2.4.jar" />
amitmanjhi@google.comea90ee92009-07-31 05:46:46 +000057 <pathelement location="${gwt.tools.lib}/tomcat/commons-logging-1.0.jar" />
amitmanjhi@google.comfef85fa2009-07-30 20:47:31 +000058 <pathelement location="${gwt.tools.lib}/cssparser/cssparser-0.9.5.jar" />
59 <pathelement location="${gwt.tools.lib}/htmlunit/htmlunit-2.5.jar" />
60 <pathelement location="${gwt.tools.lib}/htmlunit/htmlunit-core-js-2.5.jar" />
61 <pathelement location="${gwt.tools.lib}/nekohtml/nekohtml-1.9.12.jar" />
62 <pathelement location="${gwt.tools.lib}/xalan/xalan-2.7.1.jar" />
63 <pathelement location="${gwt.tools.lib}/xerces/serializer-2.7.1.jar" />
64 <pathelement location="${gwt.tools.lib}/xerces/xercesImpl-2.8.1.jar" />
65 <pathelement location="${gwt.tools.lib}/xerces/xml-apis-1.3.04.jar" />
66 <pathelement location="${gwt.tools.lib}/w3c/sac/sac-1.3.jar" />
67 </path>
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000068 <!-- Platform shouldn't matter here, just picking one -->
fabbott@google.com71e72af2009-06-13 02:28:21 +000069 <property.ensure name="gwt.dev.jar" location="${gwt.build.lib}/gwt-dev-${build.host.platform}.jar" />
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +000070
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000071 <target name="compile" description="Compile all class files">
72 <mkdir dir="${javac.out}" />
73 <gwt.javac>
74 <classpath>
scottb@google.com4f57bc22009-01-16 22:46:42 +000075 <pathelement location="${gwt.tools.lib}/tomcat/servlet-api-2.5.jar" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000076 <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" />
77 <pathelement location="${gwt.tools.lib}/jfreechart/jfreechart-1.0.3.jar" />
78 <pathelement location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />
bobv@google.coma933c8b2009-03-26 02:12:25 +000079 <pathelement location="${gwt.tools.lib}/w3c/sac/sac-1.3.jar" />
80 <pathelement location="${gwt.tools.lib}/w3c/flute/flute-1.3.jar" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000081 <pathelement location="${gwt.dev.jar}" />
amitmanjhi@google.comfef85fa2009-07-30 20:47:31 +000082 <path refid="htmlunit.libs" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000083 </classpath>
84 </gwt.javac>
gwt.team.mmendez99f280b2006-12-08 23:11:29 +000085
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000086 <!-- Build the BrowserManagerServer_Stub to allow remote browser testing -->
87 <rmic base="${javac.out}"
gwt.team.jatf0a06d02007-01-03 18:51:15 +000088 classname="com.google.gwt.junit.remote.BrowserManagerServer"
89 stubversion="1.2"/>
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000090 </target>
gwt.team.mmendez99f280b2006-12-08 23:11:29 +000091
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000092 <!--
93 Compile test code for dev/core to pick up TypeOracleTestUtils and others.
spoon@google.comd0b00f82009-03-27 14:58:53 +000094 -->
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000095 <target name="compile.dev.core.tests" description="Compiles test dependencies in dev/core">
96 <gwt.ant dir="../dev/core" target="compile.tests" />
97 </target>
spoon@google.comd0b00f82009-03-27 14:58:53 +000098
jlabanca@google.comae134432009-07-27 00:35:05 +000099 <target name="compile.tests" depends="compile.dev.core.tests" description="Compiles the test code for this project">
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000100 <mkdir dir="${javac.junit.out}" />
101 <gwt.javac srcdir="test" excludes="com/google/gwt/langtest/**" destdir="${javac.junit.out}">
102 <classpath>
103 <pathelement location="${javac.out}" />
104 <pathelement location="${gwt.build}/out/dev/core/bin-test" />
scottb@google.com4f57bc22009-01-16 22:46:42 +0000105 <pathelement location="${gwt.tools.lib}/tomcat/servlet-api-2.5.jar" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000106 <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" />
107 <pathelement location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />
scottb@google.com2e8ef322008-11-04 20:59:58 +0000108 <pathelement location="${gwt.dev.jar}" />
amitmanjhi@google.comfef85fa2009-07-30 20:47:31 +0000109 <path refid="htmlunit.libs" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000110 </classpath>
111 </gwt.javac>
112 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +0000113
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000114 <target name="build" depends="compile" description="Build and package this project">
115 <mkdir dir="${gwt.build.lib}" />
116 <gwt.jar>
117 <fileset dir="src" excludes="**/package.html" />
118 <fileset dir="super" excludes="**/package.html" />
119 <fileset dir="${javac.out}" />
scottb@google.com4f57bc22009-01-16 22:46:42 +0000120 <zipfileset src="${gwt.tools.lib}/tomcat/servlet-api-2.5.jar" />
bobv@google.coma933c8b2009-03-26 02:12:25 +0000121 <zipfileset src="${gwt.tools.lib}/w3c/sac/sac-1.3.jar" />
122 <zipfileset src="${gwt.tools.lib}/w3c/flute/flute-1.3.jar" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000123 </gwt.jar>
124 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +0000125
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000126 <target name="checkstyle" description="Static analysis of source">
127 <gwt.checkstyle>
128 <fileset dir="src" />
129 <fileset dir="super/com/google/gwt/emul" />
130 <fileset dir="super/com/google/gwt/junit/translatable" />
131 </gwt.checkstyle>
132 </target>
gwt.team.mmendez99f280b2006-12-08 23:11:29 +0000133
fabbott@google.com25305472009-06-10 21:39:00 +0000134 <target name="remoteweb-test" depends="test.remoteweb">
135 <echo message="DEPRECATED: remoteweb-test has been renamed test.remoteweb"/>
136 </target>
137
138 <target name="test.remoteweb" description="Run a remoteweb test at the given host and path" if="gwt.remote.browsers">
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000139 <echo message="Performing remote browser testing at ${gwt.remote.browsers}" />
amitmanjhi@google.com6146b0c2009-07-25 14:55:48 +0000140 <gwt.junit test.args="${test.args} -out www -remoteweb ${gwt.remote.browsers} -batch module" test.out="${junit.out}/remoteweb" test.cases="default.web.tests" >
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000141 <extraclasspaths>
fabbott@google.com25305472009-06-10 21:39:00 +0000142 <path refid="test.extraclasspath" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000143 </extraclasspaths>
144 </gwt.junit>
145 </target>
zundel@google.com29666c82008-06-04 16:07:53 +0000146
fabbott@google.com25305472009-06-10 21:39:00 +0000147 <target name="selenium-test" depends="test.selenium">
148 <echo message="DEPRECATED: selenium-test has been renamed test.selenium"/>
149 </target>
150
151 <target name="test.selenium" description="Run a remote test using Selenium RC test at the given host and path" if="gwt.selenium.hosts">
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000152 <echo message="Performing remote browser testing using Selenium RC at ${gwt.selenium.hosts}" />
amitmanjhi@google.com6146b0c2009-07-25 14:55:48 +0000153 <gwt.junit test.args="${test.args} -out www -selenium ${gwt.selenium.hosts} -batch module" test.out="${junit.out}/selenium" test.cases="default.web.tests" >
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000154 <extraclasspaths>
fabbott@google.com25305472009-06-10 21:39:00 +0000155 <path refid="test.extraclasspath" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000156 </extraclasspaths>
157 </gwt.junit>
158 </target>
gwt.team.mmendez99f280b2006-12-08 23:11:29 +0000159
jgw@google.coma3509e22009-02-06 21:06:24 +0000160 <target name="test.hosted.emma" depends="compile, compile.tests" description="Run all hosted-mode tests in emma mode.">
amitmanjhi@google.com6146b0c2009-07-25 14:55:48 +0000161 <gwt.junit test.args="${test.args} -batch module" test.out="${junit.out}/${build.host.platform}-hosted-mode-emma" test.cases="default.hosted.emma.tests" >
jgw@google.coma3509e22009-02-06 21:06:24 +0000162 <extraclasspaths>
fabbott@google.com25305472009-06-10 21:39:00 +0000163 <path refid="test.extraclasspath" />
jgw@google.coma3509e22009-02-06 21:06:24 +0000164 <pathelement location="${gwt.tools.redist}/emma/emma.jar" />
165 </extraclasspaths>
166 </gwt.junit>
167 </target>
168
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000169 <target name="test.hosted" depends="compile, compile.tests" description="Run only hosted-mode tests for this project.">
amitmanjhi@google.com6146b0c2009-07-25 14:55:48 +0000170 <gwt.junit test.args="${test.args} -batch module" test.out="${junit.out}/${build.host.platform}-hosted-mode" test.cases="default.hosted.tests" >
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000171 <extraclasspaths>
fabbott@google.com25305472009-06-10 21:39:00 +0000172 <path refid="test.extraclasspath" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000173 </extraclasspaths>
174 </gwt.junit>
spoon@google.comd0b00f82009-03-27 14:58:53 +0000175 </target>
176
177 <target name="test.noserver" depends="compile, compile.tests" description="Run noserver hosted-mode tests for this project.">
amitmanjhi@google.com6146b0c2009-07-25 14:55:48 +0000178 <gwt.junit test.args="${test.args} -noserver -batch module" test.out="${junit.out}/${build.host.platform}-noserver-mode" test.cases="default.noserver.tests">
spoon@google.comd0b00f82009-03-27 14:58:53 +0000179 <extraclasspaths>
fabbott@google.com25305472009-06-10 21:39:00 +0000180 <path refid="test.extraclasspath" />
spoon@google.comd0b00f82009-03-27 14:58:53 +0000181 </extraclasspaths>
182 </gwt.junit>
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000183 </target>
gwt.team.scottb5b5e6342007-02-22 21:34:23 +0000184
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000185 <target name="test.web" depends="compile, compile.tests" description="Run only web-mode tests for this project.">
amitmanjhi@google.com6146b0c2009-07-25 14:55:48 +0000186 <gwt.junit test.args="${test.args} -out www -web -batch module" test.out="${junit.out}/${build.host.platform}-web-mode" test.cases="default.web.tests">
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000187 <extraclasspaths>
fabbott@google.com25305472009-06-10 21:39:00 +0000188 <path refid="test.extraclasspath" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000189 </extraclasspaths>
190 </gwt.junit>
191 </target>
gwt.team.scottb5b5e6342007-02-22 21:34:23 +0000192
amitmanjhi@google.comfef85fa2009-07-30 20:47:31 +0000193 <target name="test.web.htmlunit" depends="compile, compile.tests" description="Run htmlunit web-mode tests for this project.">
194 <!-- TODO: add more browsers later -->
195 <gwt.junit test.args="${test.args} -htmlunit FF3" test.out="${junit.out}/${build.host.platform}-htmlunit-web-mode" test.cases="default.web.tests" >
196 <extraclasspaths>
197 <path refid="test.extraclasspath" />
198 <path refid="htmlunit.libs" />
199 </extraclasspaths>
200 </gwt.junit>
201 </target>
202
bobv@google.comc0e308f2009-02-19 01:08:17 +0000203 <target name="test.web.disableClassMetadata" depends="compile, compile.tests" description="Run only web-mode tests for this project.">
zundel@google.comac837712009-08-02 01:34:33 +0000204 <gwt.junit test.args="${test.args} -XdisableClassMetadata -out www -web" test.out="${junit.out}/${build.host.platform}-web-mode-disableClassMetadata" test.cases="default.web.tests" >
bobv@google.comc0e308f2009-02-19 01:08:17 +0000205 <extraclasspaths>
fabbott@google.com25305472009-06-10 21:39:00 +0000206 <path refid="test.extraclasspath" />
bobv@google.comc0e308f2009-02-19 01:08:17 +0000207 </extraclasspaths>
208 </gwt.junit>
209 </target>
210
amitmanjhi@google.com6146b0c2009-07-25 14:55:48 +0000211 <target name="test.web.draft" depends="compile, compile.tests" description="Run only web-mode tests for this project, not batching tests on purpose.">
bobv@google.com62773b12009-01-29 22:31:44 +0000212 <gwt.junit test.args="${test.args} -draftCompile -out www -web" test.out="${junit.out}/${build.host.platform}-web-mode-draft" test.cases="default.web.tests" >
213 <extraclasspaths>
fabbott@google.com25305472009-06-10 21:39:00 +0000214 <path refid="test.extraclasspath" />
bobv@google.com62773b12009-01-29 22:31:44 +0000215 </extraclasspaths>
216 </gwt.junit>
217 </target>
218
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000219 <target name="test" depends="compile, compile.tests" description="Run hosted-mode, web-mode, remoteweb, and selenium tests for this project.">
220 <property.ensure name="distro.built" location="${gwt.dev.staging.jar}" message="GWT must be built before performing any tests. This can be fixed by running ant in the ${gwt.root} directory." />
gwt.team.mmendez99f280b2006-12-08 23:11:29 +0000221
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000222 <!--
223 Run hosted and web mode tests for the platform on which this build
224 is executing
225 -->
jlabanca@google.comf78c54b2009-07-16 17:19:20 +0000226 <limit failonerror="true" hours="${test.timeout}">
bobv@google.comb2bd3f52009-02-19 23:38:40 +0000227 <parallel threadsPerProcessor="${gwt.threadsPerProcessor}">
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000228 <!-- selenium-test is a no-op unless gwt.selenium.hosts is defined -->
fabbott@google.com25305472009-06-10 21:39:00 +0000229 <antcall target="test.selenium"/>
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000230 <!-- remoteweb-test is a no-op unless gwt.remote.browsers is defined -->
fabbott@google.com25305472009-06-10 21:39:00 +0000231 <antcall target="test.remoteweb"/>
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000232 <antcall target="test.hosted"/>
amitmanjhi@google.com614f2632009-04-23 18:00:41 +0000233 <antcall target="test.hosted.emma"/>
spoon@google.comd0b00f82009-03-27 14:58:53 +0000234 <antcall target="test.noserver"/>
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000235 <antcall target="test.web"/>
bobv@google.comc0e308f2009-02-19 01:08:17 +0000236 <antcall target="test.web.disableClassMetadata"/>
amitmanjhi@google.com595dcdc2009-07-31 17:47:37 +0000237 <!-- TODO(amitmanjhi): uncomment it after fixing the xerces issue -->
238 <!-- <antcall target="test.web.htmlunit"/> -->
amitmanjhi@google.com6146b0c2009-07-25 14:55:48 +0000239 <antcall target="test.web.draft"/>
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000240 </parallel>
241 </limit>
242 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +0000243
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000244 <target name="clean" description="Cleans this project's intermediate and output files">
245 <delete dir="${project.build}" />
246 <delete file="${project.lib}" />
247 </target>
jgw@google.coma3509e22009-02-06 21:06:24 +0000248 <target name="presubmit" depends="test, checkstyle" description="runs the gwt api checker, user checkstyle, and user tests">
spoon@google.comd0b00f82009-03-27 14:58:53 +0000249 <gwt.ant dir=".." target="apicheck-nobuild"/>
jgw@google.coma3509e22009-02-06 21:06:24 +0000250 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +0000251</project>