blob: 8bc20fcd5ec0ef18bf64596bdc9baa9147cc4c55 [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"
Stephan Herrmann3b9c6ee2019-07-20 17:17:41 +020035 description="Creates the SUT by and installing the OTDT into a pre-installed base Eclipse"
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000036 >
Stephan Herrmann3b9c6ee2019-07-20 17:17:41 +020037 <echo message="Installing OTDT into Test Eclipse..."/>
Stephan Herrmann31101742019-05-23 19:11:12 +020038 <ant antfile="${OTScriptDir}/p2helper.xml" target="installOTDT" dir="${test.eclipseDir}"/>
39
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000040 <property name="otdt-eclipse.is.setup" value="true"/>
41 </target>
42
43 <target name="setupTests" depends="setupOTDTEclipse" unless="tests.are.setup"
44 description="Installes the OTDT-Tests into the OTDT"
45 >
46 <echo message="Setting up tests in ${test.eclipseDir}"/>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000047 <!-- do install using p2: -->
Stephan Herrmann31101742019-05-23 19:11:12 +020048 <ant antfile="${OTScriptDir}/p2helper.xml" target="installTests" dir="${test.eclipseDir}"/>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000049
Stephan Herrmanna1eeb302013-04-29 23:51:25 +020050 <echo message="get library.xml"/>
Stephan Herrmann805fe202020-01-14 14:13:37 +010051 <get src="https://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 +020052 dest="${test.root.dir}/library.xml"/>
Stephan Herrmanna1eeb302013-04-29 23:51:25 +020053
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000054 <property name="tests.are.setup" value="true"/>
55 </target>
56
57 <target name="runtests"
58 description="Runs ant on the test.xml for a specified plugin.
59 Requires a property value setting for testPlugin only if test.properties is not available.
60 The property testPlugin represents a directory name made up of the plugin id and plugin version.
61 This directory must contain a valid test.xml."
62 >
63 <ant antfile="plugins/${testPlugin}/test.xml" dir="${test.eclipseDir}">
64 <property name="eclipse-home" value="${test.eclipseDir}" />
Stephan Herrmannf71123a2013-04-30 01:18:01 +020065 <property name="library-file" value="${test.root.dir}/library.xml"/>
Stephan Herrmannedb0b202017-11-23 18:59:31 +010066 <property name="extraVMargs" value="-XX:+HeapDumpOnOutOfMemoryError -ea --add-modules ALL-SYSTEM
67 --add-opens java.base/jdk.internal.loader=ALL-UNNAMED
68 --add-opens jdk.localedata/sun.util.resources.cldr.provider=ALL-UNNAMED
69 --add-opens jdk.localedata/sun.util.resources.provider=ALL-UNNAMED
70 --add-opens java.security.jgss/sun.security.krb5.internal.ssl=ALL-UNNAMED
71 --add-opens java.base/jdk.internal.module=ALL-UNNAMED
72 --add-opens java.base/java.lang.module=ALL-UNNAMED
73 --add-opens java.base/jdk.internal.reflect=ALL-UNNAMED
74 --add-opens java.base/jdk.internal.ref=ALL-UNNAMED
75 --add-opens java.base/jdk.internal.math=ALL-UNNAMED
76 --add-opens java.base/jdk.internal.misc=ALL-UNNAMED
Stephan Herrmann46b5f592019-09-01 00:54:24 +020077 -Djava.io.tmpdir=${test.tmpDir} -Dot.weaving=otdre -javaagent:${otequinox.agent.jar}
Stephan Herrmannca66d6c2019-09-07 23:17:49 +020078 -Dcompliance=1.7,1.8,12"/>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000079 </ant>
80 </target>
81
82 <target name="otdt_tests" description="Runs the org.eclipse.objectteams.otdt.tests test.xml">
83 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +010084 <param name="testPlugin" value="org.eclipse.objectteams.otdt.tests_${org.eclipse.objectteams.otdt.tests}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000085 </antcall>
86 </target>
87
88 <target name="jdtcore_compiler_tests" description="Runs the org.eclipse.jdt.core.tests.compiler test.xml">
89 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +010090 <param name="testPlugin" value="org.eclipse.jdt.core.tests.compiler_${org.eclipse.jdt.core.tests.compiler}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000091 </antcall>
92 </target>
93
94 <target name="jdtcore_model_tests" description="Runs the org.eclipse.jdt.core.tests.model test.xml">
95 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +010096 <param name="testPlugin" value="org.eclipse.jdt.core.tests.model_${org.eclipse.jdt.core.tests.model}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000097 </antcall>
98 </target>
99
100 <target name="jdt_builder_tests" description="Runs the org.eclipse.jdt.core.tests.builder test.xml">
101 <property name="library-file"
Stephan Herrmanna1eeb302013-04-29 23:51:25 +0200102 value="${test.root.dir}/library.xml"/>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000103 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +0100104 <param name="testPlugin" value="org.eclipse.jdt.core.tests.builder_${org.eclipse.jdt.core.tests.builder}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000105 </antcall>
106 </target>
107
108
109 <target name="otdt_ui_tests" description="Runs the org.eclipse.objectteams.otdt.ui.tests test.xml">
110 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +0100111 <param name="testPlugin" value="org.eclipse.objectteams.otdt.ui.tests_${org.eclipse.objectteams.otdt.ui.tests}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000112 </antcall>
113 </target>
114
115 <target name="otdt_dom_tests" description="Runs the org.eclipse.objectteams.otdt.ui.tests.dom test.xml">
116 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +0100117 <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 +0000118 </antcall>
119 </target>
120
121 <target name="otdt_ref_tests" description="Runs the org.eclipse.objectteams.otdt.ui.tests.refactoring test.xml">
122 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +0100123 <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 +0000124 </antcall>
125 </target>
126
Stephan Herrmanneb0f2922018-08-09 13:27:26 +0200127 <target name="otequinox_tests" description="Runs the OTEquinoxTests test.xml">
128 <antcall target="runtests">
129 <param name="testPlugin" value="OTEquinoxTests_${OTEquinoxTests}" />
130 </antcall>
131 </target>
132
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000133 <target name="jdt_ui_tests" description="Runs the org.eclipse.jdt.ui.tests test.xml">
Stephan Herrmann855fbd72010-09-28 16:00:49 +0000134 <property name="library-file"
Stephan Herrmanna1eeb302013-04-29 23:51:25 +0200135 value="${test.root.dir}/library.xml"/>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000136 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +0100137 <param name="testPlugin" value="org.eclipse.jdt.ui.tests_${org.eclipse.jdt.ui.tests}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000138 </antcall>
139 </target>
140
141 <target name="jdt_ref_tests" description="Runs the org.eclipse.jdt.ui.tests.refactoring test.xml">
Stephan Herrmann855fbd72010-09-28 16:00:49 +0000142 <property name="library-file"
Stephan Herrmanna1eeb302013-04-29 23:51:25 +0200143 value="${test.root.dir}/library.xml"/>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000144 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +0100145 <param name="testPlugin" value="org.eclipse.jdt.ui.tests.refactoring_${org.eclipse.jdt.ui.tests.refactoring}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000146 </antcall>
147 </target>
148
149 <target name="jdt_debug_tests" description="Runs the org.eclipse.jdt.debug.tests test.xml">
150 <property name="library-file"
Stephan Herrmanna1eeb302013-04-29 23:51:25 +0200151 value="${test.root.dir}/library.xml"/>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000152 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +0100153 <param name="testPlugin" value="org.eclipse.jdt.debug.tests_${org.eclipse.jdt.debug.tests}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000154 </antcall>
155 </target>
156
157 <target name="otdt_debug_tests" description="Runs the org.eclipse.objectteams.otdt.debug.tests test.xml">
158 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +0100159 <param name="testPlugin" value="org.eclipse.objectteams.otdt.debug.tests_${org.eclipse.objectteams.otdt.debug.tests}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000160 </antcall>
161 </target>
162
163 <target name="otdt_builder_tests" description="Runs the org.eclipse.objectteams.otdt.test.builder test.xml">
164 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +0100165 <param name="testPlugin" value="org.eclipse.objectteams.otdt.test.builder_${org.eclipse.objectteams.otdt.test.builder}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000166 </antcall>
167 </target>
168
169 <target name="all">
170<!-- enable if we want to debug otre/otequinox:
171<property name="extraVMargs" value="-Dot.dump=1 -Dotequinox.debug=OK" />
172-->
173 <!-- debug tests don't like parallelization -->
174 <antcall target="jdt_debug_tests" />
175 <antcall target="otdt_debug_tests" />
Stephan Herrmann5aecfe12010-05-03 23:53:54 +0000176 <!--parallel threadCount="2"-->
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000177 <!-- "slow", ui tests come first -->
178 <antcall target="jdt_ref_tests" />
179 <antcall target="jdt_ui_tests" />
180 <antcall target="otdt_ui_tests" />
181 <antcall target="otdt_ref_tests" />
182 <antcall target="otdt_dom_tests" />
183 <antcall target="otdt_tests" />
Stephan Herrmanneb0f2922018-08-09 13:27:26 +0200184 <antcall target="otequinox_tests" />
Stephan Herrmann16fd6492019-03-05 19:28:47 +0100185 <antcall target="otdt_builder_tests" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000186 <antcall target="jdt_builder_tests" />
187 <antcall target="jdtcore_compiler_tests" />
188 <antcall target="jdtcore_model_tests" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000189 <!-- antcall target="otdt_metrics_tests" / -->
Stephan Herrmann5aecfe12010-05-03 23:53:54 +0000190 <!--/parallel-->
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000191 </target>
Stephan Herrmannd8c81652010-11-06 15:01:14 +0000192
193 <target name="otdt-tests">
194<!-- enable if we want to debug otre/otequinox:
195<property name="extraVMargs" value="-Dot.dump=1 -Dotequinox.debug=OK" />
196-->
197 <!-- debug tests don't like parallelization -->
198 <antcall target="otdt_debug_tests" />
199 <!--parallel threadCount="2"-->
200 <!-- "slow", ui tests come first -->
201 <antcall target="otdt_ui_tests" />
202 <antcall target="otdt_ref_tests" />
203 <antcall target="otdt_dom_tests" />
204 <antcall target="otdt_tests" />
Stephan Herrmann16fd6492019-03-05 19:28:47 +0100205 <antcall target="otequinox_tests" />
206 <antcall target="otdt_builder_tests" />
207 <antcall target="jdt_builder_tests" />
Stephan Herrmannd8c81652010-11-06 15:01:14 +0000208 <antcall target="jdtcore_compiler_tests" />
209 <antcall target="jdtcore_model_tests" />
Stephan Herrmannd8c81652010-11-06 15:01:14 +0000210 <!-- antcall target="otdt_metrics_tests" / -->
211 <!--/parallel-->
212 </target>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000213
214 <target name="onlyone">
Stephan Herrmann15a6fcd2019-09-03 13:15:39 +0200215 <antcall target="otdt_tests" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000216 </target>
217
218</project>