blob: 4b50a086a5e90ab341022128bf57db378d82ec96 [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}"/>
48
49 <echo message="Unpacking OTDT Tests..."/>
50 <unzip src="${buildDirectory}/${buildLabel}/org.eclipse.objectteams.otdt-tests-${buildId}-${config}.zip"
51 dest="${testsUpdatesDir}"/>
52
53 <!-- do install using p2: -->
54 <ant antfile="${OTScriptDir}/p2helper.xml" target="installTests" dir="${test.eclipseDir}"/>
55
56 <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}" />
67 <property name="extraVMargs" value="-XX:MaxPermSize=320m"/>
68 </ant>
69 </target>
70
71 <target name="otdt_tests" description="Runs the org.eclipse.objectteams.otdt.tests test.xml">
72 <antcall target="runtests">
73 <param name="testPlugin" value="${org.eclipse.objectteams.otdt.tests}" />
74 </antcall>
75 </target>
76
77 <target name="jdtcore_compiler_tests" description="Runs the org.eclipse.jdt.core.tests.compiler test.xml">
78 <antcall target="runtests">
79 <param name="testPlugin" value="${org.eclipse.jdt.core.tests.compiler}" />
80 </antcall>
81 </target>
82
83 <target name="jdtcore_model_tests" description="Runs the org.eclipse.jdt.core.tests.model test.xml">
84 <antcall target="runtests">
85 <param name="testPlugin" value="${org.eclipse.jdt.core.tests.model}" />
86 </antcall>
87 </target>
88
89 <target name="jdt_builder_tests" description="Runs the org.eclipse.jdt.core.tests.builder test.xml">
90 <property name="library-file"
91 value="${test.eclipseDir}/plugins/${org.eclipse.test}/library.xml"/>
92 <antcall target="runtests">
93 <param name="testPlugin" value="${org.eclipse.jdt.core.tests.builder}" />
94 </antcall>
95 </target>
96
97
98 <target name="otdt_ui_tests" description="Runs the org.eclipse.objectteams.otdt.ui.tests test.xml">
99 <antcall target="runtests">
100 <param name="testPlugin" value="${org.eclipse.objectteams.otdt.ui.tests}" />
101 </antcall>
102 </target>
103
104 <target name="otdt_dom_tests" description="Runs the org.eclipse.objectteams.otdt.ui.tests.dom test.xml">
105 <antcall target="runtests">
106 <param name="testPlugin" value="${org.eclipse.objectteams.otdt.ui.tests.dom}" />
107 </antcall>
108 </target>
109
110 <target name="otdt_ref_tests" description="Runs the org.eclipse.objectteams.otdt.ui.tests.refactoring test.xml">
111 <antcall target="runtests">
112 <param name="testPlugin" value="${org.eclipse.objectteams.otdt.ui.tests.refactoring}" />
113 </antcall>
114 </target>
115
116 <target name="jdt_ui_tests" description="Runs the org.eclipse.jdt.ui.tests test.xml">
117 <antcall target="runtests">
118 <param name="testPlugin" value="${org.eclipse.jdt.ui.tests}" />
119 </antcall>
120 </target>
121
122 <target name="jdt_ref_tests" description="Runs the org.eclipse.jdt.ui.tests.refactoring test.xml">
123 <antcall target="runtests">
124 <param name="testPlugin" value="${org.eclipse.jdt.ui.tests.refactoring}" />
125 </antcall>
126 </target>
127
128 <target name="jdt_debug_tests" description="Runs the org.eclipse.jdt.debug.tests test.xml">
129 <property name="library-file"
130 value="${test.eclipseDir}/plugins/${org.eclipse.test}/library.xml"/>
131 <antcall target="runtests">
132 <param name="testPlugin" value="${org.eclipse.jdt.debug.tests}" />
133 </antcall>
134 </target>
135
136 <target name="otdt_debug_tests" description="Runs the org.eclipse.objectteams.otdt.debug.tests test.xml">
137 <antcall target="runtests">
138 <param name="testPlugin" value="${org.eclipse.objectteams.otdt.debug.tests}" />
139 </antcall>
140 </target>
141
142 <target name="otdt_builder_tests" description="Runs the org.eclipse.objectteams.otdt.test.builder test.xml">
143 <antcall target="runtests">
144 <param name="testPlugin" value="${org.eclipse.objectteams.otdt.test.builder}" />
145 </antcall>
146 </target>
147
148 <target name="all">
149<!-- enable if we want to debug otre/otequinox:
150<property name="extraVMargs" value="-Dot.dump=1 -Dotequinox.debug=OK" />
151-->
152 <!-- debug tests don't like parallelization -->
153 <antcall target="jdt_debug_tests" />
154 <antcall target="otdt_debug_tests" />
155 <parallel threadCount="2">
156 <!-- "slow", ui tests come first -->
157 <antcall target="jdt_ref_tests" />
158 <antcall target="jdt_ui_tests" />
159 <antcall target="otdt_ui_tests" />
160 <antcall target="otdt_ref_tests" />
161 <antcall target="otdt_dom_tests" />
162 <antcall target="otdt_tests" />
163 <antcall target="jdt_builder_tests" />
164 <antcall target="jdtcore_compiler_tests" />
165 <antcall target="jdtcore_model_tests" />
166 <antcall target="otdt_builder_tests" />
167 <!-- antcall target="otdt_metrics_tests" / -->
168 </parallel>
169 </target>
170
171 <target name="onlyone">
172 <antcall target="otdt_ui_tests" />
173 </target>
174
175</project>