blob: 196959ad07650a0b843225e1e6fdfac0b57ce14a [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="" />
jgw@google.com399b5642009-02-06 21:29:31 +00005 <property name="gwt.junit.emmatestcase.includes" value="**/*Suite.class,com/google/gwt/dev/jjs/test/*Test.class"/>
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.com0e2dc6282008-08-22 16:09:01 +00008 <!--
9 Default hosted mode test cases
10 -->
11 <fileset id="default.hosted.tests" dir="${javac.junit.out}"
12 includes="${gwt.junit.testcase.includes}" />
gwt.team.mmendez99f280b2006-12-08 23:11:29 +000013
scottb@google.com6cd61e92009-01-16 19:50:20 +000014 <fileset id="default.emma.tests" dir="${javac.junit.out}"
15 includes="**/EmmaClassLoadingTest.class" />
jgw@google.coma3509e22009-02-06 21:06:24 +000016
17 <fileset id="default.hosted.emma.tests" dir="${javac.junit.out}"
jgw@google.com399b5642009-02-06 21:29:31 +000018 excludes="**/CoverageTest.class,**/CompilerSuite.class" includes="${gwt.junit.emmatestcase.includes}" />
jgw@google.coma3509e22009-02-06 21:06:24 +000019 <!-- everything succeeds except CoverageTest.java. It fails due to a javac bug in sun/OpenJDK's Java. See the file contents for details -->
20
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000021 <!--
22 Default web mode test cases
23 -->
24 <fileset id="default.web.tests" dir="${javac.junit.out}"
25 includes="${gwt.junit.testcase.includes}" />
gwt.team.mmendez99f280b2006-12-08 23:11:29 +000026
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000027 <!-- Platform shouldn't matter here, just picking one -->
28 <property.ensure name="gwt.dev.jar" location="${gwt.build.lib}/gwt-dev-linux.jar" />
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +000029
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000030 <target name="compile" description="Compile all class files">
31 <mkdir dir="${javac.out}" />
32 <gwt.javac>
33 <classpath>
scottb@google.com4f57bc22009-01-16 22:46:42 +000034 <pathelement location="${gwt.tools.lib}/tomcat/servlet-api-2.5.jar" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000035 <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" />
36 <pathelement location="${gwt.tools.lib}/jfreechart/jfreechart-1.0.3.jar" />
37 <pathelement location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />
38 <pathelement location="${gwt.dev.jar}" />
39 </classpath>
40 </gwt.javac>
gwt.team.mmendez99f280b2006-12-08 23:11:29 +000041
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000042 <!-- Build the BrowserManagerServer_Stub to allow remote browser testing -->
43 <rmic base="${javac.out}"
gwt.team.jatf0a06d02007-01-03 18:51:15 +000044 classname="com.google.gwt.junit.remote.BrowserManagerServer"
45 stubversion="1.2"/>
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000046 </target>
gwt.team.mmendez99f280b2006-12-08 23:11:29 +000047
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000048 <!--
49 Compile test code for dev/core to pick up TypeOracleTestUtils and others.
50 -->
51 <target name="compile.dev.core.tests" description="Compiles test dependencies in dev/core">
52 <gwt.ant dir="../dev/core" target="compile.tests" />
53 </target>
54
55 <target name="compile.tests" depends="compile.dev.core.tests" description="Compiles the test code for this project">
56 <mkdir dir="${javac.junit.out}" />
57 <gwt.javac srcdir="test" excludes="com/google/gwt/langtest/**" destdir="${javac.junit.out}">
58 <classpath>
59 <pathelement location="${javac.out}" />
60 <pathelement location="${gwt.build}/out/dev/core/bin-test" />
scottb@google.com4f57bc22009-01-16 22:46:42 +000061 <pathelement location="${gwt.tools.lib}/tomcat/servlet-api-2.5.jar" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000062 <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" />
63 <pathelement location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />
scottb@google.com2e8ef322008-11-04 20:59:58 +000064 <pathelement location="${gwt.dev.jar}" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000065 </classpath>
66 </gwt.javac>
67 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +000068
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000069 <target name="build" depends="compile" description="Build and package this project">
70 <mkdir dir="${gwt.build.lib}" />
71 <gwt.jar>
72 <fileset dir="src" excludes="**/package.html" />
73 <fileset dir="super" excludes="**/package.html" />
74 <fileset dir="${javac.out}" />
scottb@google.com4f57bc22009-01-16 22:46:42 +000075 <zipfileset src="${gwt.tools.lib}/tomcat/servlet-api-2.5.jar" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000076 </gwt.jar>
77 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +000078
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000079 <target name="checkstyle" description="Static analysis of source">
80 <gwt.checkstyle>
81 <fileset dir="src" />
82 <fileset dir="super/com/google/gwt/emul" />
83 <fileset dir="super/com/google/gwt/junit/translatable" />
84 </gwt.checkstyle>
85 </target>
gwt.team.mmendez99f280b2006-12-08 23:11:29 +000086
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000087 <target name="remoteweb-test" description="Run a remoteweb test at the given host and path" if="gwt.remote.browsers">
88 <echo message="Performing remote browser testing at ${gwt.remote.browsers}" />
jat@google.come7f61a72008-12-24 00:45:21 +000089 <gwt.junit test.args="${test.args} -out www -remoteweb ${gwt.remote.browsers}" test.out="${junit.out}/remoteweb" test.cases="default.web.tests" >
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000090 <extraclasspaths>
91 <pathelement location="${gwt.build}/out/dev/core/bin-test" />
92 </extraclasspaths>
93 </gwt.junit>
94 </target>
zundel@google.com29666c82008-06-04 16:07:53 +000095
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000096 <target name="selenium-test" description="Run a remote test using Selenium RC test at the given host and path" if="gwt.selenium.hosts">
97 <echo message="Performing remote browser testing using Selenium RC at ${gwt.selenium.hosts}" />
jat@google.come7f61a72008-12-24 00:45:21 +000098 <gwt.junit test.args="${test.args} -out www -selenium ${gwt.selenium.hosts}" test.out="${junit.out}/selenium" test.cases="default.web.tests" >
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000099 <extraclasspaths>
100 <pathelement location="${gwt.build}/out/dev/core/bin-test" />
101 </extraclasspaths>
102 </gwt.junit>
103 </target>
gwt.team.mmendez99f280b2006-12-08 23:11:29 +0000104
jgw@google.coma3509e22009-02-06 21:06:24 +0000105 <target name="test.hosted.emma" depends="compile, compile.tests" description="Run all hosted-mode tests in emma mode.">
106 <gwt.junit test.args="${test.args}" test.out="${junit.out}/${build.host.platform}-hosted-mode" test.cases="default.hosted.emma.tests" >
107 <extraclasspaths>
108 <pathelement location="${gwt.build}/out/dev/core/bin-test" />
109 <pathelement location="${gwt.tools.redist}/emma/emma.jar" />
110 </extraclasspaths>
111 </gwt.junit>
112 </target>
113
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000114 <target name="test.hosted" depends="compile, compile.tests" description="Run only hosted-mode tests for this project.">
jat@google.come7f61a72008-12-24 00:45:21 +0000115 <gwt.junit test.args="${test.args}" test.out="${junit.out}/${build.host.platform}-hosted-mode" test.cases="default.hosted.tests" >
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000116 <extraclasspaths>
117 <pathelement location="${gwt.build}/out/dev/core/bin-test" />
118 </extraclasspaths>
119 </gwt.junit>
scottb@google.com6cd61e92009-01-16 19:50:20 +0000120 <gwt.junit test.args="${test.args}" test.out="${junit.out}/${build.host.platform}-hosted-mode-emma" test.cases="default.emma.tests" >
121 <extraclasspaths>
122 <pathelement location="${gwt.build}/out/dev/core/bin-test" />
123 <pathelement location="${gwt.tools.redist}/emma/emma.jar" />
124 </extraclasspaths>
jgw@google.coma3509e22009-02-06 21:06:24 +0000125 </gwt.junit>
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000126 </target>
gwt.team.scottb5b5e6342007-02-22 21:34:23 +0000127
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000128 <target name="test.web" depends="compile, compile.tests" description="Run only web-mode tests for this project.">
jat@google.come7f61a72008-12-24 00:45:21 +0000129 <gwt.junit test.args="${test.args} -out www -web" test.out="${junit.out}/${build.host.platform}-web-mode" test.cases="default.web.tests" >
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000130 <extraclasspaths>
131 <pathelement location="${gwt.build}/out/dev/core/bin-test" />
132 </extraclasspaths>
133 </gwt.junit>
134 </target>
gwt.team.scottb5b5e6342007-02-22 21:34:23 +0000135
bobv@google.comc0e308f2009-02-19 01:08:17 +0000136 <target name="test.web.disableClassMetadata" depends="compile, compile.tests" description="Run only web-mode tests for this project.">
137 <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" >
138 <extraclasspaths>
139 <pathelement location="${gwt.build}/out/dev/core/bin-test" />
140 </extraclasspaths>
141 </gwt.junit>
142 </target>
143
bobv@google.com62773b12009-01-29 22:31:44 +0000144 <target name="test.web.draft" depends="compile, compile.tests" description="Run only web-mode tests for this project.">
145 <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" >
146 <extraclasspaths>
147 <pathelement location="${gwt.build}/out/dev/core/bin-test" />
148 </extraclasspaths>
149 </gwt.junit>
150 </target>
151
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000152 <target name="test" depends="compile, compile.tests" description="Run hosted-mode, web-mode, remoteweb, and selenium tests for this project.">
153 <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 +0000154
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000155 <!--
156 Run hosted and web mode tests for the platform on which this build
157 is executing
158 -->
159 <limit failonerror="true" hours="2">
bobv@google.comb2bd3f52009-02-19 23:38:40 +0000160 <parallel threadsPerProcessor="${gwt.threadsPerProcessor}">
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000161 <!-- selenium-test is a no-op unless gwt.selenium.hosts is defined -->
162 <antcall target="selenium-test"/>
163 <!-- remoteweb-test is a no-op unless gwt.remote.browsers is defined -->
164 <antcall target="remoteweb-test"/>
165 <antcall target="test.hosted"/>
166 <antcall target="test.web"/>
bobv@google.comc0e308f2009-02-19 01:08:17 +0000167 <antcall target="test.web.disableClassMetadata"/>
bobv@google.com62773b12009-01-29 22:31:44 +0000168 <antcall target="test.web.draft"/>
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000169 </parallel>
170 </limit>
171 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +0000172
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000173 <target name="clean" description="Cleans this project's intermediate and output files">
174 <delete dir="${project.build}" />
175 <delete file="${project.lib}" />
176 </target>
jgw@google.coma3509e22009-02-06 21:06:24 +0000177 <target name="presubmit" depends="test, checkstyle" description="runs the gwt api checker, user checkstyle, and user tests">
178 <gwt.ant dir=".." target="apicheck-nobuild"/>
179 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +0000180</project>