blob: 326563d343526b82a732bff272eb43291bab2741 [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="" />
amitmanjhi@google.comed4569f2009-02-06 19:47:58 +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
amitmanjhi@google.coma4cfc302009-01-14 15:59:47 +000014 <fileset id="default.emma.tests" dir="${javac.junit.out}"
15 includes="**/EmmaClassLoadingTest.class" />
amitmanjhi@google.comf4c935f2009-02-04 22:50:42 +000016
17 <fileset id="default.hosted.emma.tests" dir="${javac.junit.out}"
amitmanjhi@google.comed4569f2009-02-06 19:47:58 +000018 excludes="**/CoverageTest.class,**/CompilerSuite.class" includes="${gwt.junit.emmatestcase.includes}" />
amitmanjhi@google.comf4c935f2009-02-04 22:50:42 +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.com5d56e262009-01-16 02:52:12 +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.com5d56e262009-01-16 02:52:12 +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.com59579a12008-10-31 01:40:36 +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.com5d56e262009-01-16 02:52:12 +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}" />
scottb@google.com4c30e762008-12-06 00:32:59 +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}" />
scottb@google.com4c30e762008-12-06 00:32:59 +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
amitmanjhi@google.comf4c935f2009-02-04 22:50:42 +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.">
scottb@google.com4c30e762008-12-06 00:32:59 +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>
amitmanjhi@google.coma4cfc302009-01-14 15:59:47 +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>
amitmanjhi@google.comf4c935f2009-02-04 22:50:42 +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.">
scottb@google.com4c30e762008-12-06 00:32:59 +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
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000136 <target name="test" depends="compile, compile.tests" description="Run hosted-mode, web-mode, remoteweb, and selenium tests for this project.">
137 <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 +0000138
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000139 <!--
140 Run hosted and web mode tests for the platform on which this build
141 is executing
142 -->
143 <limit failonerror="true" hours="2">
144 <parallel threadsPerProcessor="1">
145 <!-- selenium-test is a no-op unless gwt.selenium.hosts is defined -->
146 <antcall target="selenium-test"/>
147 <!-- remoteweb-test is a no-op unless gwt.remote.browsers is defined -->
148 <antcall target="remoteweb-test"/>
149 <antcall target="test.hosted"/>
150 <antcall target="test.web"/>
151 </parallel>
152 </limit>
153 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +0000154
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000155 <target name="clean" description="Cleans this project's intermediate and output files">
156 <delete dir="${project.build}" />
157 <delete file="${project.lib}" />
158 </target>
ecc@google.comed46bf82009-01-29 17:07:24 +0000159 <target name="presubmit" depends="test, checkstyle" description="runs the gwt api checker, user checkstyle, and user tests">
160 <gwt.ant dir=".." target="apicheck-nobuild"/>
161 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +0000162</project>