Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 1 | <!--
|
| 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 Herrmann | 32ed6af | 2014-01-05 02:44:25 +0100 | [diff] [blame] | 19 | <property file="src/finalPluginsVersions.properties" />
|
Stephan Herrmann | b2e5abd | 2015-10-29 17:26:56 +0100 | [diff] [blame] | 20 | <property name="otequinox.agent.jar" value="${test.root.dir}/eclipse/plugins/org.eclipse.objectteams.otequinox_${org.eclipse.objectteams.otequinox}/otequinoxAgent.jar"/>
|
Stephan Herrmann | 5c45fe4 | 2015-10-22 20:56:39 +0200 | [diff] [blame] | 21 |
|
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 22 |
|
| 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"
|
| 35 | description="Creates the SUT by extracting a fresh Eclipse SDK and installing the OTDT into it"
|
| 36 | >
|
| 37 | <echo message="### Build Test Eclipse ###"/>
|
| 38 | <echo message="Extracting Eclipse..."/>
|
| 39 | <untar compression="gzip" src="${eclipse-app.tgz}" dest="${test.root.dir}"/>
|
| 40 |
|
| 41 | <echo message="Installing OTDT..."/>
|
| 42 | <ant antfile="${OTScriptDir}/p2helper.xml" target="installOTDT" dir="${test.eclipseDir}"/>
|
| 43 |
|
| 44 | <property name="otdt-eclipse.is.setup" value="true"/>
|
| 45 | </target>
|
| 46 |
|
| 47 | <target name="setupTests" depends="setupOTDTEclipse" unless="tests.are.setup"
|
| 48 | description="Installes the OTDT-Tests into the OTDT"
|
| 49 | >
|
| 50 | <echo message="Setting up tests in ${test.eclipseDir}"/>
|
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 51 | <!-- do install using p2: -->
|
| 52 | <ant antfile="${OTScriptDir}/p2helper.xml" target="installTests" dir="${test.eclipseDir}"/>
|
| 53 |
|
Stephan Herrmann | a1eeb30 | 2013-04-29 23:51:25 +0200 | [diff] [blame] | 54 | <echo message="get library.xml"/>
|
| 55 | <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 Herrmann | bc2361b | 2013-04-30 00:34:57 +0200 | [diff] [blame] | 56 | dest="${test.root.dir}/library.xml"/>
|
Stephan Herrmann | a1eeb30 | 2013-04-29 23:51:25 +0200 | [diff] [blame] | 57 |
|
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 58 | <property name="tests.are.setup" value="true"/>
|
| 59 | </target>
|
| 60 |
|
| 61 | <target name="runtests"
|
| 62 | description="Runs ant on the test.xml for a specified plugin.
|
| 63 | Requires a property value setting for testPlugin only if test.properties is not available.
|
| 64 | The property testPlugin represents a directory name made up of the plugin id and plugin version.
|
| 65 | This directory must contain a valid test.xml."
|
| 66 | >
|
| 67 | <ant antfile="plugins/${testPlugin}/test.xml" dir="${test.eclipseDir}">
|
| 68 | <property name="eclipse-home" value="${test.eclipseDir}" />
|
Stephan Herrmann | f71123a | 2013-04-30 01:18:01 +0200 | [diff] [blame] | 69 | <property name="library-file" value="${test.root.dir}/library.xml"/>
|
Stephan Herrmann | f7cad8b | 2017-11-16 16:22:52 +0100 | [diff] [blame] | 70 | <property name="extraVMargs" value="-XX:+HeapDumpOnOutOfMemoryError -ea --add-modules ALL-SYSTEM --add-opens java.base/jdk.internal.loader=ALL-UNNAMED -Djava.io.tmpdir=${test.tmpDir} -Dot.weaving=otdre -javaagent:${otequinox.agent.jar}"/>
|
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 71 | </ant>
|
| 72 | </target>
|
| 73 |
|
| 74 | <target name="otdt_tests" description="Runs the org.eclipse.objectteams.otdt.tests test.xml">
|
| 75 | <antcall target="runtests">
|
Stephan Herrmann | 32ed6af | 2014-01-05 02:44:25 +0100 | [diff] [blame] | 76 | <param name="testPlugin" value="org.eclipse.objectteams.otdt.tests_${org.eclipse.objectteams.otdt.tests}" />
|
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 77 | </antcall>
|
| 78 | </target>
|
| 79 |
|
| 80 | <target name="jdtcore_compiler_tests" description="Runs the org.eclipse.jdt.core.tests.compiler test.xml">
|
| 81 | <antcall target="runtests">
|
Stephan Herrmann | 32ed6af | 2014-01-05 02:44:25 +0100 | [diff] [blame] | 82 | <param name="testPlugin" value="org.eclipse.jdt.core.tests.compiler_${org.eclipse.jdt.core.tests.compiler}" />
|
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 83 | </antcall>
|
| 84 | </target>
|
| 85 |
|
| 86 | <target name="jdtcore_model_tests" description="Runs the org.eclipse.jdt.core.tests.model test.xml">
|
| 87 | <antcall target="runtests">
|
Stephan Herrmann | 32ed6af | 2014-01-05 02:44:25 +0100 | [diff] [blame] | 88 | <param name="testPlugin" value="org.eclipse.jdt.core.tests.model_${org.eclipse.jdt.core.tests.model}" />
|
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 89 | </antcall>
|
| 90 | </target>
|
| 91 |
|
| 92 | <target name="jdt_builder_tests" description="Runs the org.eclipse.jdt.core.tests.builder test.xml">
|
| 93 | <property name="library-file"
|
Stephan Herrmann | a1eeb30 | 2013-04-29 23:51:25 +0200 | [diff] [blame] | 94 | value="${test.root.dir}/library.xml"/>
|
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 95 | <antcall target="runtests">
|
Stephan Herrmann | 32ed6af | 2014-01-05 02:44:25 +0100 | [diff] [blame] | 96 | <param name="testPlugin" value="org.eclipse.jdt.core.tests.builder_${org.eclipse.jdt.core.tests.builder}" />
|
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 97 | </antcall>
|
| 98 | </target>
|
| 99 |
|
| 100 |
|
| 101 | <target name="otdt_ui_tests" description="Runs the org.eclipse.objectteams.otdt.ui.tests test.xml">
|
| 102 | <antcall target="runtests">
|
Stephan Herrmann | 32ed6af | 2014-01-05 02:44:25 +0100 | [diff] [blame] | 103 | <param name="testPlugin" value="org.eclipse.objectteams.otdt.ui.tests_${org.eclipse.objectteams.otdt.ui.tests}" />
|
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 104 | </antcall>
|
| 105 | </target>
|
| 106 |
|
| 107 | <target name="otdt_dom_tests" description="Runs the org.eclipse.objectteams.otdt.ui.tests.dom test.xml">
|
| 108 | <antcall target="runtests">
|
Stephan Herrmann | 32ed6af | 2014-01-05 02:44:25 +0100 | [diff] [blame] | 109 | <param name="testPlugin" value="org.eclipse.objectteams.otdt.ui.tests.dom_${org.eclipse.objectteams.otdt.ui.tests.dom}" />
|
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 110 | </antcall>
|
| 111 | </target>
|
| 112 |
|
| 113 | <target name="otdt_ref_tests" description="Runs the org.eclipse.objectteams.otdt.ui.tests.refactoring test.xml">
|
| 114 | <antcall target="runtests">
|
Stephan Herrmann | 32ed6af | 2014-01-05 02:44:25 +0100 | [diff] [blame] | 115 | <param name="testPlugin" value="org.eclipse.objectteams.otdt.ui.tests.refactoring_${org.eclipse.objectteams.otdt.ui.tests.refactoring}" />
|
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 116 | </antcall>
|
| 117 | </target>
|
| 118 |
|
| 119 | <target name="jdt_ui_tests" description="Runs the org.eclipse.jdt.ui.tests test.xml">
|
Stephan Herrmann | 855fbd7 | 2010-09-28 16:00:49 +0000 | [diff] [blame] | 120 | <property name="library-file"
|
Stephan Herrmann | a1eeb30 | 2013-04-29 23:51:25 +0200 | [diff] [blame] | 121 | value="${test.root.dir}/library.xml"/>
|
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 122 | <antcall target="runtests">
|
Stephan Herrmann | 32ed6af | 2014-01-05 02:44:25 +0100 | [diff] [blame] | 123 | <param name="testPlugin" value="org.eclipse.jdt.ui.tests_${org.eclipse.jdt.ui.tests}" />
|
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 124 | </antcall>
|
| 125 | </target>
|
| 126 |
|
| 127 | <target name="jdt_ref_tests" description="Runs the org.eclipse.jdt.ui.tests.refactoring test.xml">
|
Stephan Herrmann | 855fbd7 | 2010-09-28 16:00:49 +0000 | [diff] [blame] | 128 | <property name="library-file"
|
Stephan Herrmann | a1eeb30 | 2013-04-29 23:51:25 +0200 | [diff] [blame] | 129 | value="${test.root.dir}/library.xml"/>
|
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 130 | <antcall target="runtests">
|
Stephan Herrmann | 32ed6af | 2014-01-05 02:44:25 +0100 | [diff] [blame] | 131 | <param name="testPlugin" value="org.eclipse.jdt.ui.tests.refactoring_${org.eclipse.jdt.ui.tests.refactoring}" />
|
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 132 | </antcall>
|
| 133 | </target>
|
| 134 |
|
| 135 | <target name="jdt_debug_tests" description="Runs the org.eclipse.jdt.debug.tests test.xml">
|
| 136 | <property name="library-file"
|
Stephan Herrmann | a1eeb30 | 2013-04-29 23:51:25 +0200 | [diff] [blame] | 137 | value="${test.root.dir}/library.xml"/>
|
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 138 | <antcall target="runtests">
|
Stephan Herrmann | 32ed6af | 2014-01-05 02:44:25 +0100 | [diff] [blame] | 139 | <param name="testPlugin" value="org.eclipse.jdt.debug.tests_${org.eclipse.jdt.debug.tests}" />
|
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 140 | </antcall>
|
| 141 | </target>
|
| 142 |
|
| 143 | <target name="otdt_debug_tests" description="Runs the org.eclipse.objectteams.otdt.debug.tests test.xml">
|
| 144 | <antcall target="runtests">
|
Stephan Herrmann | 32ed6af | 2014-01-05 02:44:25 +0100 | [diff] [blame] | 145 | <param name="testPlugin" value="org.eclipse.objectteams.otdt.debug.tests_${org.eclipse.objectteams.otdt.debug.tests}" />
|
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 146 | </antcall>
|
| 147 | </target>
|
| 148 |
|
| 149 | <target name="otdt_builder_tests" description="Runs the org.eclipse.objectteams.otdt.test.builder test.xml">
|
| 150 | <antcall target="runtests">
|
Stephan Herrmann | 32ed6af | 2014-01-05 02:44:25 +0100 | [diff] [blame] | 151 | <param name="testPlugin" value="org.eclipse.objectteams.otdt.test.builder_${org.eclipse.objectteams.otdt.test.builder}" />
|
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 152 | </antcall>
|
| 153 | </target>
|
| 154 |
|
| 155 | <target name="all">
|
| 156 | <!-- enable if we want to debug otre/otequinox:
|
| 157 | <property name="extraVMargs" value="-Dot.dump=1 -Dotequinox.debug=OK" />
|
| 158 | -->
|
| 159 | <!-- debug tests don't like parallelization -->
|
| 160 | <antcall target="jdt_debug_tests" />
|
| 161 | <antcall target="otdt_debug_tests" />
|
Stephan Herrmann | 5aecfe1 | 2010-05-03 23:53:54 +0000 | [diff] [blame] | 162 | <!--parallel threadCount="2"-->
|
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 163 | <!-- "slow", ui tests come first -->
|
| 164 | <antcall target="jdt_ref_tests" />
|
| 165 | <antcall target="jdt_ui_tests" />
|
| 166 | <antcall target="otdt_ui_tests" />
|
| 167 | <antcall target="otdt_ref_tests" />
|
| 168 | <antcall target="otdt_dom_tests" />
|
| 169 | <antcall target="otdt_tests" />
|
| 170 | <antcall target="jdt_builder_tests" />
|
| 171 | <antcall target="jdtcore_compiler_tests" />
|
| 172 | <antcall target="jdtcore_model_tests" />
|
| 173 | <antcall target="otdt_builder_tests" />
|
| 174 | <!-- antcall target="otdt_metrics_tests" / -->
|
Stephan Herrmann | 5aecfe1 | 2010-05-03 23:53:54 +0000 | [diff] [blame] | 175 | <!--/parallel-->
|
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 176 | </target>
|
Stephan Herrmann | d8c8165 | 2010-11-06 15:01:14 +0000 | [diff] [blame] | 177 |
|
| 178 | <target name="otdt-tests">
|
| 179 | <!-- enable if we want to debug otre/otequinox:
|
| 180 | <property name="extraVMargs" value="-Dot.dump=1 -Dotequinox.debug=OK" />
|
| 181 | -->
|
| 182 | <!-- debug tests don't like parallelization -->
|
| 183 | <antcall target="otdt_debug_tests" />
|
| 184 | <!--parallel threadCount="2"-->
|
| 185 | <!-- "slow", ui tests come first -->
|
| 186 | <antcall target="otdt_ui_tests" />
|
| 187 | <antcall target="otdt_ref_tests" />
|
| 188 | <antcall target="otdt_dom_tests" />
|
| 189 | <antcall target="otdt_tests" />
|
| 190 | <antcall target="jdt_builder_tests" />
|
| 191 | <antcall target="jdtcore_compiler_tests" />
|
| 192 | <antcall target="jdtcore_model_tests" />
|
| 193 | <antcall target="otdt_builder_tests" />
|
| 194 | <!-- antcall target="otdt_metrics_tests" / -->
|
| 195 | <!--/parallel-->
|
| 196 | </target>
|
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 197 |
|
| 198 | <target name="onlyone">
|
| 199 | <antcall target="otdt_ui_tests" />
|
| 200 | </target>
|
| 201 |
|
| 202 | </project>
|