blob: e7ea7f7cfc968454db94a87f4ce46d593f0b0342 [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" />
19
20 <target name="readFlags">
21 <condition property="really.build.all">
22 <istrue value="${do.build.all}"/>
23 </condition>
24 </target>
25
26 <target name="checkFlags" depends="readFlags" unless="really.build.all">
27 <property name="otdt-eclipse.is.setup" value="true"/>
28 <property name="tests.are.setup" value="true"/>
29 </target>
30
31 <target name="setupOTDTEclipse" depends="checkFlags" unless="otdt-eclipse.is.setup"
32 description="Creates the SUT by extracting a fresh Eclipse SDK and installing the OTDT into it"
33 >
34 <echo message="### Build Test Eclipse ###"/>
35 <echo message="Extracting Eclipse..."/>
36 <untar compression="gzip" src="${eclipse-app.tgz}" dest="${test.root.dir}"/>
37
38 <echo message="Installing OTDT..."/>
39 <ant antfile="${OTScriptDir}/p2helper.xml" target="installOTDT" dir="${test.eclipseDir}"/>
40
41 <property name="otdt-eclipse.is.setup" value="true"/>
42 </target>
43
44 <target name="setupTests" depends="setupOTDTEclipse" unless="tests.are.setup"
45 description="Installes the OTDT-Tests into the OTDT"
46 >
47 <echo message="Setting up tests in ${test.eclipseDir}"/>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000048 <!-- do install using p2: -->
49 <ant antfile="${OTScriptDir}/p2helper.xml" target="installTests" dir="${test.eclipseDir}"/>
50
Stephan Herrmanna1eeb302013-04-29 23:51:25 +020051 <echo message="get library.xml"/>
52 <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"
53 destination="${test.root.dir}"/>
54
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000055 <property name="tests.are.setup" value="true"/>
56 </target>
57
58 <target name="runtests"
59 description="Runs ant on the test.xml for a specified plugin.
60 Requires a property value setting for testPlugin only if test.properties is not available.
61 The property testPlugin represents a directory name made up of the plugin id and plugin version.
62 This directory must contain a valid test.xml."
63 >
64 <ant antfile="plugins/${testPlugin}/test.xml" dir="${test.eclipseDir}">
65 <property name="eclipse-home" value="${test.eclipseDir}" />
Stephan Herrmann56428e92013-02-23 12:29:56 +010066 <property name="extraVMargs" value="-XX:MaxPermSize=320m -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=${test.tmpDir}"/>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000067 </ant>
68 </target>
69
70 <target name="otdt_tests" description="Runs the org.eclipse.objectteams.otdt.tests test.xml">
71 <antcall target="runtests">
72 <param name="testPlugin" value="${org.eclipse.objectteams.otdt.tests}" />
73 </antcall>
74 </target>
75
76 <target name="jdtcore_compiler_tests" description="Runs the org.eclipse.jdt.core.tests.compiler test.xml">
77 <antcall target="runtests">
78 <param name="testPlugin" value="${org.eclipse.jdt.core.tests.compiler}" />
79 </antcall>
80 </target>
81
82 <target name="jdtcore_model_tests" description="Runs the org.eclipse.jdt.core.tests.model test.xml">
83 <antcall target="runtests">
84 <param name="testPlugin" value="${org.eclipse.jdt.core.tests.model}" />
85 </antcall>
86 </target>
87
88 <target name="jdt_builder_tests" description="Runs the org.eclipse.jdt.core.tests.builder test.xml">
89 <property name="library-file"
Stephan Herrmanna1eeb302013-04-29 23:51:25 +020090 value="${test.root.dir}/library.xml"/>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000091 <antcall target="runtests">
92 <param name="testPlugin" value="${org.eclipse.jdt.core.tests.builder}" />
93 </antcall>
94 </target>
95
96
97 <target name="otdt_ui_tests" description="Runs the org.eclipse.objectteams.otdt.ui.tests test.xml">
98 <antcall target="runtests">
99 <param name="testPlugin" value="${org.eclipse.objectteams.otdt.ui.tests}" />
100 </antcall>
101 </target>
102
103 <target name="otdt_dom_tests" description="Runs the org.eclipse.objectteams.otdt.ui.tests.dom test.xml">
104 <antcall target="runtests">
105 <param name="testPlugin" value="${org.eclipse.objectteams.otdt.ui.tests.dom}" />
106 </antcall>
107 </target>
108
109 <target name="otdt_ref_tests" description="Runs the org.eclipse.objectteams.otdt.ui.tests.refactoring test.xml">
110 <antcall target="runtests">
111 <param name="testPlugin" value="${org.eclipse.objectteams.otdt.ui.tests.refactoring}" />
112 </antcall>
113 </target>
114
115 <target name="jdt_ui_tests" description="Runs the org.eclipse.jdt.ui.tests test.xml">
Stephan Herrmann855fbd72010-09-28 16:00:49 +0000116 <property name="library-file"
Stephan Herrmanna1eeb302013-04-29 23:51:25 +0200117 value="${test.root.dir}/library.xml"/>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000118 <antcall target="runtests">
119 <param name="testPlugin" value="${org.eclipse.jdt.ui.tests}" />
120 </antcall>
121 </target>
122
123 <target name="jdt_ref_tests" description="Runs the org.eclipse.jdt.ui.tests.refactoring test.xml">
Stephan Herrmann855fbd72010-09-28 16:00:49 +0000124 <property name="library-file"
Stephan Herrmanna1eeb302013-04-29 23:51:25 +0200125 value="${test.root.dir}/library.xml"/>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000126 <antcall target="runtests">
127 <param name="testPlugin" value="${org.eclipse.jdt.ui.tests.refactoring}" />
128 </antcall>
129 </target>
130
131 <target name="jdt_debug_tests" description="Runs the org.eclipse.jdt.debug.tests test.xml">
132 <property name="library-file"
Stephan Herrmanna1eeb302013-04-29 23:51:25 +0200133 value="${test.root.dir}/library.xml"/>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000134 <antcall target="runtests">
135 <param name="testPlugin" value="${org.eclipse.jdt.debug.tests}" />
136 </antcall>
137 </target>
138
139 <target name="otdt_debug_tests" description="Runs the org.eclipse.objectteams.otdt.debug.tests test.xml">
140 <antcall target="runtests">
141 <param name="testPlugin" value="${org.eclipse.objectteams.otdt.debug.tests}" />
142 </antcall>
143 </target>
144
145 <target name="otdt_builder_tests" description="Runs the org.eclipse.objectteams.otdt.test.builder test.xml">
146 <antcall target="runtests">
147 <param name="testPlugin" value="${org.eclipse.objectteams.otdt.test.builder}" />
148 </antcall>
149 </target>
150
151 <target name="all">
152<!-- enable if we want to debug otre/otequinox:
153<property name="extraVMargs" value="-Dot.dump=1 -Dotequinox.debug=OK" />
154-->
155 <!-- debug tests don't like parallelization -->
156 <antcall target="jdt_debug_tests" />
157 <antcall target="otdt_debug_tests" />
Stephan Herrmann5aecfe12010-05-03 23:53:54 +0000158 <!--parallel threadCount="2"-->
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000159 <!-- "slow", ui tests come first -->
160 <antcall target="jdt_ref_tests" />
161 <antcall target="jdt_ui_tests" />
162 <antcall target="otdt_ui_tests" />
163 <antcall target="otdt_ref_tests" />
164 <antcall target="otdt_dom_tests" />
165 <antcall target="otdt_tests" />
166 <antcall target="jdt_builder_tests" />
167 <antcall target="jdtcore_compiler_tests" />
168 <antcall target="jdtcore_model_tests" />
169 <antcall target="otdt_builder_tests" />
170 <!-- antcall target="otdt_metrics_tests" / -->
Stephan Herrmann5aecfe12010-05-03 23:53:54 +0000171 <!--/parallel-->
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000172 </target>
Stephan Herrmannd8c81652010-11-06 15:01:14 +0000173
174 <target name="otdt-tests">
175<!-- enable if we want to debug otre/otequinox:
176<property name="extraVMargs" value="-Dot.dump=1 -Dotequinox.debug=OK" />
177-->
178 <!-- debug tests don't like parallelization -->
179 <antcall target="otdt_debug_tests" />
180 <!--parallel threadCount="2"-->
181 <!-- "slow", ui tests come first -->
182 <antcall target="otdt_ui_tests" />
183 <antcall target="otdt_ref_tests" />
184 <antcall target="otdt_dom_tests" />
185 <antcall target="otdt_tests" />
186 <antcall target="jdt_builder_tests" />
187 <antcall target="jdtcore_compiler_tests" />
188 <antcall target="jdtcore_model_tests" />
189 <antcall target="otdt_builder_tests" />
190 <!-- antcall target="otdt_metrics_tests" / -->
191 <!--/parallel-->
192 </target>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +0000193
194 <target name="onlyone">
195 <antcall target="otdt_ui_tests" />
196 </target>
197
198</project>