blob: 12eaa656fb6421628178a525d4aaff094ca21ec2 [file] [log] [blame]
Stephan Herrmanndcd87c12010-04-25 10:59:27 +00001<!--
2 Copyright (c) 2010 Stephan Herrmann and others.
3 All rights reserved. This program and the accompanying materials
4 are made available under the terms of the Eclipse Public License v1.0
5 which accompanies this distribution, and is available at
6 http://www.eclipse.org/legal/epl-v10.html
7
8 Contributors:
9 Stephan Herrmann - initial API and implementation
10-->
11<project name="Automated Object Teams Testing" default="all" basedir="." >
12
13 <!--properties file containing the plugin directory name including version number-->
14 <dirname property="_myDir" file="${ant.file}"/>
15 <property file="${_myDir}/test.properties" />
16
17 <!--properties file containing the build information-->
18 <property file="src/label.properties" />
Stephan Herrmann32ed6af2014-01-05 02:44:25 +010019 <property file="src/finalPluginsVersions.properties" />
Stephan Herrmannb2e5abd2015-10-29 17:26:56 +010020 <property name="otequinox.agent.jar" value="${test.root.dir}/eclipse/plugins/org.eclipse.objectteams.otequinox_${org.eclipse.objectteams.otequinox}/otequinoxAgent.jar"/>
Stephan Herrmann5c45fe42015-10-22 20:56:39 +020021
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000022
23 <target name="readFlags">
24 <condition property="really.build.all">
25 <istrue value="${do.build.all}"/>
26 </condition>
27 </target>
28
29 <target name="checkFlags" depends="readFlags" unless="really.build.all">
30 <property name="otdt-eclipse.is.setup" value="true"/>
31 <property name="tests.are.setup" value="true"/>
32 </target>
33
34 <target name="setupOTDTEclipse" depends="checkFlags" unless="otdt-eclipse.is.setup"
35 description="Creates the SUT by extracting a fresh Eclipse SDK and installing the OTDT into it"
36 >
37 <echo message="### Build Test Eclipse ###"/>
38 <echo message="Extracting Eclipse..."/>
39 <untar compression="gzip" src="${eclipse-app.tgz}" dest="${test.root.dir}"/>
40
41 <echo message="Installing OTDT..."/>
42 <ant antfile="${OTScriptDir}/p2helper.xml" target="installOTDT" dir="${test.eclipseDir}"/>
43
44 <property name="otdt-eclipse.is.setup" value="true"/>
45 </target>
46
47 <target name="setupTests" depends="setupOTDTEclipse" unless="tests.are.setup"
48 description="Installes the OTDT-Tests into the OTDT"
49 >
50 <echo message="Setting up tests in ${test.eclipseDir}"/>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000051 <!-- do install using p2: -->
52 <ant antfile="${OTScriptDir}/p2helper.xml" target="installTests" dir="${test.eclipseDir}"/>
53
Stephan Herrmanna1eeb302013-04-29 23:51:25 +020054 <echo message="get library.xml"/>
55 <get src="http://git.eclipse.org/c/platform/eclipse.platform.releng.aggregator.git/plain/eclipse.platform.releng.tychoeclipsebuilder/eclipse-junit-tests/src/main/scripts/library.xml"
Stephan Herrmannbc2361b2013-04-30 00:34:57 +020056 dest="${test.root.dir}/library.xml"/>
Stephan Herrmanna1eeb302013-04-29 23:51:25 +020057
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000058 <property name="tests.are.setup" value="true"/>
59 </target>
60
61 <target name="runtests"
62 description="Runs ant on the test.xml for a specified plugin.
63 Requires a property value setting for testPlugin only if test.properties is not available.
64 The property testPlugin represents a directory name made up of the plugin id and plugin version.
65 This directory must contain a valid test.xml."
66 >
67 <ant antfile="plugins/${testPlugin}/test.xml" dir="${test.eclipseDir}">
68 <property name="eclipse-home" value="${test.eclipseDir}" />
Stephan Herrmannf71123a2013-04-30 01:18:01 +020069 <property name="library-file" value="${test.root.dir}/library.xml"/>
Stephan Herrmannedb0b202017-11-23 18:59:31 +010070 <property name="extraVMargs" value="-XX:+HeapDumpOnOutOfMemoryError -ea --add-modules ALL-SYSTEM
71 --add-opens java.base/jdk.internal.loader=ALL-UNNAMED
72 --add-opens jdk.localedata/sun.util.resources.cldr.provider=ALL-UNNAMED
73 --add-opens jdk.localedata/sun.util.resources.provider=ALL-UNNAMED
74 --add-opens java.security.jgss/sun.security.krb5.internal.ssl=ALL-UNNAMED
75 --add-opens java.base/jdk.internal.module=ALL-UNNAMED
76 --add-opens java.base/java.lang.module=ALL-UNNAMED
77 --add-opens java.base/jdk.internal.reflect=ALL-UNNAMED
78 --add-opens java.base/jdk.internal.ref=ALL-UNNAMED
79 --add-opens java.base/jdk.internal.math=ALL-UNNAMED
80 --add-opens java.base/jdk.internal.misc=ALL-UNNAMED
Stephan Herrmannd72b1e22017-11-23 15:09:24 +010081 -Djava.io.tmpdir=${test.tmpDir} -Dot.weaving=otdre -javaagent:${otequinox.agent.jar}"/>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000082 </ant>
83 </target>
84
85 <target name="otdt_tests" description="Runs the org.eclipse.objectteams.otdt.tests test.xml">
86 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +010087 <param name="testPlugin" value="org.eclipse.objectteams.otdt.tests_${org.eclipse.objectteams.otdt.tests}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000088 </antcall>
89 </target>
90
91 <target name="jdtcore_compiler_tests" description="Runs the org.eclipse.jdt.core.tests.compiler test.xml">
92 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +010093 <param name="testPlugin" value="org.eclipse.jdt.core.tests.compiler_${org.eclipse.jdt.core.tests.compiler}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000094 </antcall>
95 </target>
96
97 <target name="jdtcore_model_tests" description="Runs the org.eclipse.jdt.core.tests.model test.xml">
98 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +010099 <param name="testPlugin" value="org.eclipse.jdt.core.tests.model_${org.eclipse.jdt.core.tests.model}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000100 </antcall>
101 </target>
102
103 <target name="jdt_builder_tests" description="Runs the org.eclipse.jdt.core.tests.builder test.xml">
104 <property name="library-file"
Stephan Herrmanna1eeb302013-04-29 23:51:25 +0200105 value="${test.root.dir}/library.xml"/>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000106 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +0100107 <param name="testPlugin" value="org.eclipse.jdt.core.tests.builder_${org.eclipse.jdt.core.tests.builder}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000108 </antcall>
109 </target>
110
111
112 <target name="otdt_ui_tests" description="Runs the org.eclipse.objectteams.otdt.ui.tests test.xml">
113 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +0100114 <param name="testPlugin" value="org.eclipse.objectteams.otdt.ui.tests_${org.eclipse.objectteams.otdt.ui.tests}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000115 </antcall>
116 </target>
117
118 <target name="otdt_dom_tests" description="Runs the org.eclipse.objectteams.otdt.ui.tests.dom test.xml">
119 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +0100120 <param name="testPlugin" value="org.eclipse.objectteams.otdt.ui.tests.dom_${org.eclipse.objectteams.otdt.ui.tests.dom}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000121 </antcall>
122 </target>
123
124 <target name="otdt_ref_tests" description="Runs the org.eclipse.objectteams.otdt.ui.tests.refactoring test.xml">
125 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +0100126 <param name="testPlugin" value="org.eclipse.objectteams.otdt.ui.tests.refactoring_${org.eclipse.objectteams.otdt.ui.tests.refactoring}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000127 </antcall>
128 </target>
129
130 <target name="jdt_ui_tests" description="Runs the org.eclipse.jdt.ui.tests test.xml">
Stephan Herrmann855fbd72010-09-28 16:00:49 +0000131 <property name="library-file"
Stephan Herrmanna1eeb302013-04-29 23:51:25 +0200132 value="${test.root.dir}/library.xml"/>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000133 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +0100134 <param name="testPlugin" value="org.eclipse.jdt.ui.tests_${org.eclipse.jdt.ui.tests}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000135 </antcall>
136 </target>
137
138 <target name="jdt_ref_tests" description="Runs the org.eclipse.jdt.ui.tests.refactoring test.xml">
Stephan Herrmann855fbd72010-09-28 16:00:49 +0000139 <property name="library-file"
Stephan Herrmanna1eeb302013-04-29 23:51:25 +0200140 value="${test.root.dir}/library.xml"/>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000141 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +0100142 <param name="testPlugin" value="org.eclipse.jdt.ui.tests.refactoring_${org.eclipse.jdt.ui.tests.refactoring}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000143 </antcall>
144 </target>
145
146 <target name="jdt_debug_tests" description="Runs the org.eclipse.jdt.debug.tests test.xml">
147 <property name="library-file"
Stephan Herrmanna1eeb302013-04-29 23:51:25 +0200148 value="${test.root.dir}/library.xml"/>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000149 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +0100150 <param name="testPlugin" value="org.eclipse.jdt.debug.tests_${org.eclipse.jdt.debug.tests}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000151 </antcall>
152 </target>
153
154 <target name="otdt_debug_tests" description="Runs the org.eclipse.objectteams.otdt.debug.tests test.xml">
155 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +0100156 <param name="testPlugin" value="org.eclipse.objectteams.otdt.debug.tests_${org.eclipse.objectteams.otdt.debug.tests}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000157 </antcall>
158 </target>
159
160 <target name="otdt_builder_tests" description="Runs the org.eclipse.objectteams.otdt.test.builder test.xml">
161 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +0100162 <param name="testPlugin" value="org.eclipse.objectteams.otdt.test.builder_${org.eclipse.objectteams.otdt.test.builder}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000163 </antcall>
164 </target>
165
166 <target name="all">
167<!-- enable if we want to debug otre/otequinox:
168<property name="extraVMargs" value="-Dot.dump=1 -Dotequinox.debug=OK" />
169-->
170 <!-- debug tests don't like parallelization -->
171 <antcall target="jdt_debug_tests" />
172 <antcall target="otdt_debug_tests" />
Stephan Herrmann5aecfe12010-05-03 23:53:54 +0000173 <!--parallel threadCount="2"-->
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000174 <!-- "slow", ui tests come first -->
175 <antcall target="jdt_ref_tests" />
176 <antcall target="jdt_ui_tests" />
177 <antcall target="otdt_ui_tests" />
178 <antcall target="otdt_ref_tests" />
179 <antcall target="otdt_dom_tests" />
180 <antcall target="otdt_tests" />
181 <antcall target="jdt_builder_tests" />
182 <antcall target="jdtcore_compiler_tests" />
183 <antcall target="jdtcore_model_tests" />
184 <antcall target="otdt_builder_tests" />
185 <!-- antcall target="otdt_metrics_tests" / -->
Stephan Herrmann5aecfe12010-05-03 23:53:54 +0000186 <!--/parallel-->
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000187 </target>
Stephan Herrmannd8c81652010-11-06 15:01:14 +0000188
189 <target name="otdt-tests">
190<!-- enable if we want to debug otre/otequinox:
191<property name="extraVMargs" value="-Dot.dump=1 -Dotequinox.debug=OK" />
192-->
193 <!-- debug tests don't like parallelization -->
194 <antcall target="otdt_debug_tests" />
195 <!--parallel threadCount="2"-->
196 <!-- "slow", ui tests come first -->
197 <antcall target="otdt_ui_tests" />
198 <antcall target="otdt_ref_tests" />
199 <antcall target="otdt_dom_tests" />
200 <antcall target="otdt_tests" />
201 <antcall target="jdt_builder_tests" />
202 <antcall target="jdtcore_compiler_tests" />
203 <antcall target="jdtcore_model_tests" />
204 <antcall target="otdt_builder_tests" />
205 <!-- antcall target="otdt_metrics_tests" / -->
206 <!--/parallel-->
207 </target>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000208
209 <target name="onlyone">
210 <antcall target="otdt_ui_tests" />
211 </target>
212
213</project>