blob: e67e9c935fb879949c35ec0ef97dc8f43fc69d05 [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 Herrmanndcd87c12010-04-25 10:59:27 +000020
21 <target name="readFlags">
22 <condition property="really.build.all">
23 <istrue value="${do.build.all}"/>
24 </condition>
25 </target>
26
27 <target name="checkFlags" depends="readFlags" unless="really.build.all">
28 <property name="otdt-eclipse.is.setup" value="true"/>
29 <property name="tests.are.setup" value="true"/>
30 </target>
31
32 <target name="setupOTDTEclipse" depends="checkFlags" unless="otdt-eclipse.is.setup"
33 description="Creates the SUT by extracting a fresh Eclipse SDK and installing the OTDT into it"
34 >
35 <echo message="### Build Test Eclipse ###"/>
36 <echo message="Extracting Eclipse..."/>
37 <untar compression="gzip" src="${eclipse-app.tgz}" dest="${test.root.dir}"/>
38
39 <echo message="Installing OTDT..."/>
40 <ant antfile="${OTScriptDir}/p2helper.xml" target="installOTDT" dir="${test.eclipseDir}"/>
41
42 <property name="otdt-eclipse.is.setup" value="true"/>
43 </target>
44
45 <target name="setupTests" depends="setupOTDTEclipse" unless="tests.are.setup"
46 description="Installes the OTDT-Tests into the OTDT"
47 >
48 <echo message="Setting up tests in ${test.eclipseDir}"/>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000049 <!-- do install using p2: -->
50 <ant antfile="${OTScriptDir}/p2helper.xml" target="installTests" dir="${test.eclipseDir}"/>
51
Stephan Herrmanna1eeb302013-04-29 23:51:25 +020052 <echo message="get library.xml"/>
53 <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 +020054 dest="${test.root.dir}/library.xml"/>
Stephan Herrmanna1eeb302013-04-29 23:51:25 +020055
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000056 <property name="tests.are.setup" value="true"/>
57 </target>
58
59 <target name="runtests"
60 description="Runs ant on the test.xml for a specified plugin.
61 Requires a property value setting for testPlugin only if test.properties is not available.
62 The property testPlugin represents a directory name made up of the plugin id and plugin version.
63 This directory must contain a valid test.xml."
64 >
65 <ant antfile="plugins/${testPlugin}/test.xml" dir="${test.eclipseDir}">
66 <property name="eclipse-home" value="${test.eclipseDir}" />
Stephan Herrmannf71123a2013-04-30 01:18:01 +020067 <property name="library-file" value="${test.root.dir}/library.xml"/>
Stephan Herrmann56428e92013-02-23 12:29:56 +010068 <property name="extraVMargs" value="-XX:MaxPermSize=320m -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=${test.tmpDir}"/>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000069 </ant>
70 </target>
71
72 <target name="otdt_tests" description="Runs the org.eclipse.objectteams.otdt.tests test.xml">
73 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +010074 <param name="testPlugin" value="org.eclipse.objectteams.otdt.tests_${org.eclipse.objectteams.otdt.tests}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000075 </antcall>
76 </target>
77
78 <target name="jdtcore_compiler_tests" description="Runs the org.eclipse.jdt.core.tests.compiler test.xml">
79 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +010080 <param name="testPlugin" value="org.eclipse.jdt.core.tests.compiler_${org.eclipse.jdt.core.tests.compiler}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000081 </antcall>
82 </target>
83
84 <target name="jdtcore_model_tests" description="Runs the org.eclipse.jdt.core.tests.model test.xml">
85 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +010086 <param name="testPlugin" value="org.eclipse.jdt.core.tests.model_${org.eclipse.jdt.core.tests.model}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000087 </antcall>
88 </target>
89
90 <target name="jdt_builder_tests" description="Runs the org.eclipse.jdt.core.tests.builder test.xml">
91 <property name="library-file"
Stephan Herrmanna1eeb302013-04-29 23:51:25 +020092 value="${test.root.dir}/library.xml"/>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000093 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +010094 <param name="testPlugin" value="org.eclipse.jdt.core.tests.builder_${org.eclipse.jdt.core.tests.builder}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000095 </antcall>
96 </target>
97
98
99 <target name="otdt_ui_tests" description="Runs the org.eclipse.objectteams.otdt.ui.tests test.xml">
100 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +0100101 <param name="testPlugin" value="org.eclipse.objectteams.otdt.ui.tests_${org.eclipse.objectteams.otdt.ui.tests}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000102 </antcall>
103 </target>
104
105 <target name="otdt_dom_tests" description="Runs the org.eclipse.objectteams.otdt.ui.tests.dom test.xml">
106 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +0100107 <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 +0000108 </antcall>
109 </target>
110
111 <target name="otdt_ref_tests" description="Runs the org.eclipse.objectteams.otdt.ui.tests.refactoring test.xml">
112 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +0100113 <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 +0000114 </antcall>
115 </target>
116
117 <target name="jdt_ui_tests" description="Runs the org.eclipse.jdt.ui.tests test.xml">
Stephan Herrmann855fbd72010-09-28 16:00:49 +0000118 <property name="library-file"
Stephan Herrmanna1eeb302013-04-29 23:51:25 +0200119 value="${test.root.dir}/library.xml"/>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000120 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +0100121 <param name="testPlugin" value="org.eclipse.jdt.ui.tests_${org.eclipse.jdt.ui.tests}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000122 </antcall>
123 </target>
124
125 <target name="jdt_ref_tests" description="Runs the org.eclipse.jdt.ui.tests.refactoring test.xml">
Stephan Herrmann855fbd72010-09-28 16:00:49 +0000126 <property name="library-file"
Stephan Herrmanna1eeb302013-04-29 23:51:25 +0200127 value="${test.root.dir}/library.xml"/>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000128 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +0100129 <param name="testPlugin" value="org.eclipse.jdt.ui.tests.refactoring_${org.eclipse.jdt.ui.tests.refactoring}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000130 </antcall>
131 </target>
132
133 <target name="jdt_debug_tests" description="Runs the org.eclipse.jdt.debug.tests test.xml">
134 <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.debug.tests_${org.eclipse.jdt.debug.tests}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000138 </antcall>
139 </target>
140
141 <target name="otdt_debug_tests" description="Runs the org.eclipse.objectteams.otdt.debug.tests test.xml">
142 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +0100143 <param name="testPlugin" value="org.eclipse.objectteams.otdt.debug.tests_${org.eclipse.objectteams.otdt.debug.tests}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000144 </antcall>
145 </target>
146
147 <target name="otdt_builder_tests" description="Runs the org.eclipse.objectteams.otdt.test.builder test.xml">
148 <antcall target="runtests">
Stephan Herrmann32ed6af2014-01-05 02:44:25 +0100149 <param name="testPlugin" value="org.eclipse.objectteams.otdt.test.builder_${org.eclipse.objectteams.otdt.test.builder}" />
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000150 </antcall>
151 </target>
152
153 <target name="all">
154<!-- enable if we want to debug otre/otequinox:
155<property name="extraVMargs" value="-Dot.dump=1 -Dotequinox.debug=OK" />
156-->
157 <!-- debug tests don't like parallelization -->
158 <antcall target="jdt_debug_tests" />
159 <antcall target="otdt_debug_tests" />
Stephan Herrmann5aecfe12010-05-03 23:53:54 +0000160 <!--parallel threadCount="2"-->
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000161 <!-- "slow", ui tests come first -->
162 <antcall target="jdt_ref_tests" />
163 <antcall target="jdt_ui_tests" />
164 <antcall target="otdt_ui_tests" />
165 <antcall target="otdt_ref_tests" />
166 <antcall target="otdt_dom_tests" />
167 <antcall target="otdt_tests" />
168 <antcall target="jdt_builder_tests" />
169 <antcall target="jdtcore_compiler_tests" />
170 <antcall target="jdtcore_model_tests" />
171 <antcall target="otdt_builder_tests" />
172 <!-- antcall target="otdt_metrics_tests" / -->
Stephan Herrmann5aecfe12010-05-03 23:53:54 +0000173 <!--/parallel-->
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000174 </target>
Stephan Herrmannd8c81652010-11-06 15:01:14 +0000175
176 <target name="otdt-tests">
177<!-- enable if we want to debug otre/otequinox:
178<property name="extraVMargs" value="-Dot.dump=1 -Dotequinox.debug=OK" />
179-->
180 <!-- debug tests don't like parallelization -->
181 <antcall target="otdt_debug_tests" />
182 <!--parallel threadCount="2"-->
183 <!-- "slow", ui tests come first -->
184 <antcall target="otdt_ui_tests" />
185 <antcall target="otdt_ref_tests" />
186 <antcall target="otdt_dom_tests" />
187 <antcall target="otdt_tests" />
188 <antcall target="jdt_builder_tests" />
189 <antcall target="jdtcore_compiler_tests" />
190 <antcall target="jdtcore_model_tests" />
191 <antcall target="otdt_builder_tests" />
192 <!-- antcall target="otdt_metrics_tests" / -->
193 <!--/parallel-->
194 </target>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000195
196 <target name="onlyone">
197 <antcall target="otdt_ui_tests" />
198 </target>
199
200</project>