summaryrefslogtreecommitdiffstats
blob: 7e3e8de4f713bc27b1211fa9cb3f7e62829fbe4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<!--
 Copyright (c) 2010 Stephan Herrmann and others.
 All rights reserved. This program and the accompanying materials
 are made available under the terms of the Eclipse Public License v1.0
 which accompanies this distribution, and is available at
 http://www.eclipse.org/legal/epl-v10.html

 Contributors:
     Stephan Herrmann - initial API and implementation
-->
<project name="Automated Object Teams Testing" default="all"  basedir="." >

	<!--properties file containing the plugin directory name including version number-->
	<dirname property="_myDir" file="${ant.file}"/>
	<property file="${_myDir}/test.properties" />

	<!--properties file containing the build information-->
	<property file="src/label.properties" />
	<property file="src/finalPluginsVersions.properties" />

	<target name="readFlags">
		<condition property="really.build.all">
			<istrue value="${do.build.all}"/>
        </condition>
	</target>
	
	<target name="checkFlags" depends="readFlags" unless="really.build.all">
		<property name="otdt-eclipse.is.setup" value="true"/>
		<property name="tests.are.setup" value="true"/>
	</target>

	<target name="setupOTDTEclipse" depends="checkFlags" unless="otdt-eclipse.is.setup"
		description="Creates the SUT by extracting a fresh Eclipse SDK and installing the OTDT into it"
	>
		<echo message="### Build Test Eclipse ###"/>
		<echo message="Extracting Eclipse..."/>
		<untar compression="gzip" src="${eclipse-app.tgz}" dest="${test.root.dir}"/>

		<echo message="Installing OTDT..."/>
		<ant antfile="${OTScriptDir}/p2helper.xml" target="installOTDT" dir="${test.eclipseDir}"/>
		
		<property name="otdt-eclipse.is.setup" value="true"/>
	</target>

	<target name="setupTests" depends="setupOTDTEclipse" unless="tests.are.setup"
		description="Installes the OTDT-Tests into the OTDT"
	>
		<echo message="Setting up tests in ${test.eclipseDir}"/>
		<!-- do install using p2: -->
		<ant antfile="${OTScriptDir}/p2helper.xml" target="installTests" dir="${test.eclipseDir}"/>

		<echo message="get library.xml"/>
		<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"
				dest="${test.root.dir}/library.xml"/>

		<property name="tests.are.setup" value="true"/>
	</target>
	
	<target name="runtests"
			description="Runs ant on the test.xml for a specified plugin.  
			 			 Requires a property value setting for testPlugin only if test.properties is not available.
						 The property testPlugin represents a directory name made up of the plugin id and plugin version.
						 This directory must contain a valid test.xml."
	>
		<ant antfile="plugins/${testPlugin}/test.xml" dir="${test.eclipseDir}">
			<property name="eclipse-home" value="${test.eclipseDir}" />
			<property name="library-file" value="${test.root.dir}/library.xml"/>
            <property name="extraVMargs" value="-XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=${test.tmpDir}"/>
		</ant>
	</target>

	<target name="otdt_tests" description="Runs the org.eclipse.objectteams.otdt.tests test.xml">
		<antcall target="runtests">
			<param name="testPlugin" value="org.eclipse.objectteams.otdt.tests_${org.eclipse.objectteams.otdt.tests}" />
		</antcall>
	</target>
	
	<target name="jdtcore_compiler_tests" description="Runs the org.eclipse.jdt.core.tests.compiler test.xml">
		<antcall target="runtests">
			<param name="testPlugin" value="org.eclipse.jdt.core.tests.compiler_${org.eclipse.jdt.core.tests.compiler}" />
		</antcall>
	</target>

	<target name="jdtcore_model_tests" description="Runs the org.eclipse.jdt.core.tests.model test.xml">
		<antcall target="runtests">
			<param name="testPlugin" value="org.eclipse.jdt.core.tests.model_${org.eclipse.jdt.core.tests.model}" />
		</antcall>
	</target>	
	
	<target name="jdt_builder_tests" description="Runs the org.eclipse.jdt.core.tests.builder test.xml">
		<property name="library-file"
		            value="${test.root.dir}/library.xml"/>
		<antcall target="runtests">
			<param name="testPlugin" value="org.eclipse.jdt.core.tests.builder_${org.eclipse.jdt.core.tests.builder}" />
		</antcall>
	</target>
	

	<target name="otdt_ui_tests" description="Runs the org.eclipse.objectteams.otdt.ui.tests test.xml">
		<antcall target="runtests">
			<param name="testPlugin" value="org.eclipse.objectteams.otdt.ui.tests_${org.eclipse.objectteams.otdt.ui.tests}" />
		</antcall>
	</target>

	<target name="otdt_dom_tests" description="Runs the org.eclipse.objectteams.otdt.ui.tests.dom test.xml">
		<antcall target="runtests">
			<param name="testPlugin" value="org.eclipse.objectteams.otdt.ui.tests.dom_${org.eclipse.objectteams.otdt.ui.tests.dom}" />
		</antcall>
	</target>

	<target name="otdt_ref_tests" description="Runs the org.eclipse.objectteams.otdt.ui.tests.refactoring test.xml">
		<antcall target="runtests">
			<param name="testPlugin" value="org.eclipse.objectteams.otdt.ui.tests.refactoring_${org.eclipse.objectteams.otdt.ui.tests.refactoring}" />
		</antcall>
	</target>

	<target name="jdt_ui_tests" description="Runs the org.eclipse.jdt.ui.tests test.xml">
		<property name="library-file"
		            value="${test.root.dir}/library.xml"/>
		<antcall target="runtests">
			<param name="testPlugin" value="org.eclipse.jdt.ui.tests_${org.eclipse.jdt.ui.tests}" />
		</antcall>
	</target>
	
	<target name="jdt_ref_tests" description="Runs the org.eclipse.jdt.ui.tests.refactoring test.xml">
		<property name="library-file"
		            value="${test.root.dir}/library.xml"/>
		<antcall target="runtests">
			<param name="testPlugin" value="org.eclipse.jdt.ui.tests.refactoring_${org.eclipse.jdt.ui.tests.refactoring}" />
		</antcall>
	</target>

	<target name="jdt_debug_tests" description="Runs the org.eclipse.jdt.debug.tests test.xml">
		<property name="library-file"
		            value="${test.root.dir}/library.xml"/>
		<antcall target="runtests">
			<param name="testPlugin" value="org.eclipse.jdt.debug.tests_${org.eclipse.jdt.debug.tests}" />
		</antcall>
	</target>

	<target name="otdt_debug_tests" description="Runs the org.eclipse.objectteams.otdt.debug.tests test.xml">
		<antcall target="runtests">
			<param name="testPlugin" value="org.eclipse.objectteams.otdt.debug.tests_${org.eclipse.objectteams.otdt.debug.tests}" />
		</antcall>
	</target>

	<target name="otdt_builder_tests" description="Runs the org.eclipse.objectteams.otdt.test.builder test.xml">
		<antcall target="runtests">
			<param name="testPlugin" value="org.eclipse.objectteams.otdt.test.builder_${org.eclipse.objectteams.otdt.test.builder}" />
		</antcall>
	</target>

	<target name="all">
<!-- enable if we want to debug otre/otequinox:
<property name="extraVMargs" value="-Dot.dump=1 -Dotequinox.debug=OK" />
-->
      <!-- debug tests don't like parallelization -->
      <antcall target="jdt_debug_tests" />
      <antcall target="otdt_debug_tests" />
	  <!--parallel threadCount="2"-->
                <!-- "slow", ui tests come first -->
                <antcall target="jdt_ref_tests" />
                <antcall target="jdt_ui_tests" />
                <antcall target="otdt_ui_tests" />
                <antcall target="otdt_ref_tests" />
                <antcall target="otdt_dom_tests" />
                <antcall target="otdt_tests" />
       			<antcall target="jdt_builder_tests" />
                <antcall target="jdtcore_compiler_tests" />
                <antcall target="jdtcore_model_tests" />
                <antcall target="otdt_builder_tests" />
                <!-- antcall target="otdt_metrics_tests" / -->
	  <!--/parallel-->
	</target>

	<target name="otdt-tests">
<!-- enable if we want to debug otre/otequinox:
<property name="extraVMargs" value="-Dot.dump=1 -Dotequinox.debug=OK" />
-->
      <!-- debug tests don't like parallelization -->
      <antcall target="otdt_debug_tests" />
	  <!--parallel threadCount="2"-->
                <!-- "slow", ui tests come first -->
                <antcall target="otdt_ui_tests" />
                <antcall target="otdt_ref_tests" />
                <antcall target="otdt_dom_tests" />
                <antcall target="otdt_tests" />
       		<antcall target="jdt_builder_tests" />
                <antcall target="jdtcore_compiler_tests" />
                <antcall target="jdtcore_model_tests" />
                <antcall target="otdt_builder_tests" />
                <!-- antcall target="otdt_metrics_tests" / -->
	  <!--/parallel-->
	</target>
	
	<target name="onlyone">
		<antcall target="otdt_ui_tests" />
	</target>

</project>