blob: f18d8f72a12864e25b92584cbab6149231b54e75 [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="" />
5 <import file="${gwt.root}/common.ant.xml" />
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +00006
fabbott@google.com0e2dc6282008-08-22 16:09:01 +00007 <!--
8 Default hosted mode test cases
9 -->
10 <fileset id="default.hosted.tests" dir="${javac.junit.out}"
11 includes="${gwt.junit.testcase.includes}" />
gwt.team.mmendez99f280b2006-12-08 23:11:29 +000012
scottb@google.com6cd61e92009-01-16 19:50:20 +000013 <fileset id="default.emma.tests" dir="${javac.junit.out}"
14 includes="**/EmmaClassLoadingTest.class" />
jgw@google.coma3509e22009-02-06 21:06:24 +000015
16 <fileset id="default.hosted.emma.tests" dir="${javac.junit.out}"
17 excludes="**/CoverageTest.class" includes="**/*Test.class" />
18 <!-- everything succeeds except CoverageTest.java. It fails due to a javac bug in sun/OpenJDK's Java. See the file contents for details -->
19
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000020 <!--
21 Default web mode test cases
22 -->
23 <fileset id="default.web.tests" dir="${javac.junit.out}"
24 includes="${gwt.junit.testcase.includes}" />
gwt.team.mmendez99f280b2006-12-08 23:11:29 +000025
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000026 <!-- Platform shouldn't matter here, just picking one -->
27 <property.ensure name="gwt.dev.jar" location="${gwt.build.lib}/gwt-dev-linux.jar" />
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +000028
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000029 <target name="compile" description="Compile all class files">
30 <mkdir dir="${javac.out}" />
31 <gwt.javac>
32 <classpath>
scottb@google.com4f57bc22009-01-16 22:46:42 +000033 <pathelement location="${gwt.tools.lib}/tomcat/servlet-api-2.5.jar" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000034 <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" />
35 <pathelement location="${gwt.tools.lib}/jfreechart/jfreechart-1.0.3.jar" />
36 <pathelement location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />
37 <pathelement location="${gwt.dev.jar}" />
38 </classpath>
39 </gwt.javac>
gwt.team.mmendez99f280b2006-12-08 23:11:29 +000040
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000041 <!-- Build the BrowserManagerServer_Stub to allow remote browser testing -->
42 <rmic base="${javac.out}"
gwt.team.jatf0a06d02007-01-03 18:51:15 +000043 classname="com.google.gwt.junit.remote.BrowserManagerServer"
44 stubversion="1.2"/>
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000045 </target>
gwt.team.mmendez99f280b2006-12-08 23:11:29 +000046
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000047 <!--
48 Compile test code for dev/core to pick up TypeOracleTestUtils and others.
49 -->
50 <target name="compile.dev.core.tests" description="Compiles test dependencies in dev/core">
51 <gwt.ant dir="../dev/core" target="compile.tests" />
52 </target>
53
54 <target name="compile.tests" depends="compile.dev.core.tests" description="Compiles the test code for this project">
55 <mkdir dir="${javac.junit.out}" />
56 <gwt.javac srcdir="test" excludes="com/google/gwt/langtest/**" destdir="${javac.junit.out}">
57 <classpath>
58 <pathelement location="${javac.out}" />
59 <pathelement location="${gwt.build}/out/dev/core/bin-test" />
scottb@google.com4f57bc22009-01-16 22:46:42 +000060 <pathelement location="${gwt.tools.lib}/tomcat/servlet-api-2.5.jar" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000061 <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" />
62 <pathelement location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />
scottb@google.com2e8ef322008-11-04 20:59:58 +000063 <pathelement location="${gwt.dev.jar}" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000064 </classpath>
65 </gwt.javac>
66 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +000067
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000068 <target name="build" depends="compile" description="Build and package this project">
69 <mkdir dir="${gwt.build.lib}" />
70 <gwt.jar>
71 <fileset dir="src" excludes="**/package.html" />
72 <fileset dir="super" excludes="**/package.html" />
73 <fileset dir="${javac.out}" />
scottb@google.com4f57bc22009-01-16 22:46:42 +000074 <zipfileset src="${gwt.tools.lib}/tomcat/servlet-api-2.5.jar" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000075 </gwt.jar>
76 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +000077
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000078 <target name="checkstyle" description="Static analysis of source">
79 <gwt.checkstyle>
80 <fileset dir="src" />
81 <fileset dir="super/com/google/gwt/emul" />
82 <fileset dir="super/com/google/gwt/junit/translatable" />
83 </gwt.checkstyle>
84 </target>
gwt.team.mmendez99f280b2006-12-08 23:11:29 +000085
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000086 <target name="remoteweb-test" description="Run a remoteweb test at the given host and path" if="gwt.remote.browsers">
87 <echo message="Performing remote browser testing at ${gwt.remote.browsers}" />
jat@google.come7f61a72008-12-24 00:45:21 +000088 <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 +000089 <extraclasspaths>
90 <pathelement location="${gwt.build}/out/dev/core/bin-test" />
91 </extraclasspaths>
92 </gwt.junit>
93 </target>
zundel@google.com29666c82008-06-04 16:07:53 +000094
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000095 <target name="selenium-test" description="Run a remote test using Selenium RC test at the given host and path" if="gwt.selenium.hosts">
96 <echo message="Performing remote browser testing using Selenium RC at ${gwt.selenium.hosts}" />
jat@google.come7f61a72008-12-24 00:45:21 +000097 <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 +000098 <extraclasspaths>
99 <pathelement location="${gwt.build}/out/dev/core/bin-test" />
100 </extraclasspaths>
101 </gwt.junit>
102 </target>
gwt.team.mmendez99f280b2006-12-08 23:11:29 +0000103
jgw@google.coma3509e22009-02-06 21:06:24 +0000104 <target name="test.hosted.emma" depends="compile, compile.tests" description="Run all hosted-mode tests in emma mode.">
105 <gwt.junit test.args="${test.args}" test.out="${junit.out}/${build.host.platform}-hosted-mode" test.cases="default.hosted.emma.tests" >
106 <extraclasspaths>
107 <pathelement location="${gwt.build}/out/dev/core/bin-test" />
108 <pathelement location="${gwt.tools.redist}/emma/emma.jar" />
109 </extraclasspaths>
110 </gwt.junit>
111 </target>
112
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000113 <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 +0000114 <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 +0000115 <extraclasspaths>
116 <pathelement location="${gwt.build}/out/dev/core/bin-test" />
117 </extraclasspaths>
118 </gwt.junit>
scottb@google.com6cd61e92009-01-16 19:50:20 +0000119 <gwt.junit test.args="${test.args}" test.out="${junit.out}/${build.host.platform}-hosted-mode-emma" test.cases="default.emma.tests" >
120 <extraclasspaths>
121 <pathelement location="${gwt.build}/out/dev/core/bin-test" />
122 <pathelement location="${gwt.tools.redist}/emma/emma.jar" />
123 </extraclasspaths>
jgw@google.coma3509e22009-02-06 21:06:24 +0000124 </gwt.junit>
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000125 </target>
gwt.team.scottb5b5e6342007-02-22 21:34:23 +0000126
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000127 <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 +0000128 <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 +0000129 <extraclasspaths>
130 <pathelement location="${gwt.build}/out/dev/core/bin-test" />
131 </extraclasspaths>
132 </gwt.junit>
133 </target>
gwt.team.scottb5b5e6342007-02-22 21:34:23 +0000134
bobv@google.com62773b12009-01-29 22:31:44 +0000135 <target name="test.web.draft" depends="compile, compile.tests" description="Run only web-mode tests for this project.">
136 <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" >
137 <extraclasspaths>
138 <pathelement location="${gwt.build}/out/dev/core/bin-test" />
139 </extraclasspaths>
140 </gwt.junit>
141 </target>
142
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000143 <target name="test" depends="compile, compile.tests" description="Run hosted-mode, web-mode, remoteweb, and selenium tests for this project.">
144 <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 +0000145
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000146 <!--
147 Run hosted and web mode tests for the platform on which this build
148 is executing
149 -->
150 <limit failonerror="true" hours="2">
151 <parallel threadsPerProcessor="1">
152 <!-- selenium-test is a no-op unless gwt.selenium.hosts is defined -->
153 <antcall target="selenium-test"/>
154 <!-- remoteweb-test is a no-op unless gwt.remote.browsers is defined -->
155 <antcall target="remoteweb-test"/>
156 <antcall target="test.hosted"/>
157 <antcall target="test.web"/>
bobv@google.com62773b12009-01-29 22:31:44 +0000158 <antcall target="test.web.draft"/>
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000159 </parallel>
160 </limit>
161 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +0000162
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000163 <target name="clean" description="Cleans this project's intermediate and output files">
164 <delete dir="${project.build}" />
165 <delete file="${project.lib}" />
166 </target>
jgw@google.coma3509e22009-02-06 21:06:24 +0000167 <target name="presubmit" depends="test, checkstyle" description="runs the gwt api checker, user checkstyle, and user tests">
168 <gwt.ant dir=".." target="apicheck-nobuild"/>
169 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +0000170</project>