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" />
|
| 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 Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 48 | <!-- do install using p2: -->
|
| 49 | <ant antfile="${OTScriptDir}/p2helper.xml" target="installTests" dir="${test.eclipseDir}"/>
|
| 50 |
|
| 51 | <property name="tests.are.setup" value="true"/>
|
| 52 | </target>
|
| 53 |
|
| 54 | <target name="runtests"
|
| 55 | description="Runs ant on the test.xml for a specified plugin.
|
| 56 | Requires a property value setting for testPlugin only if test.properties is not available.
|
| 57 | The property testPlugin represents a directory name made up of the plugin id and plugin version.
|
| 58 | This directory must contain a valid test.xml."
|
| 59 | >
|
| 60 | <ant antfile="plugins/${testPlugin}/test.xml" dir="${test.eclipseDir}">
|
| 61 | <property name="eclipse-home" value="${test.eclipseDir}" />
|
| 62 | <property name="extraVMargs" value="-XX:MaxPermSize=320m"/>
|
| 63 | </ant>
|
| 64 | </target>
|
| 65 |
|
| 66 | <target name="otdt_tests" description="Runs the org.eclipse.objectteams.otdt.tests test.xml">
|
| 67 | <antcall target="runtests">
|
| 68 | <param name="testPlugin" value="${org.eclipse.objectteams.otdt.tests}" />
|
| 69 | </antcall>
|
| 70 | </target>
|
| 71 |
|
| 72 | <target name="jdtcore_compiler_tests" description="Runs the org.eclipse.jdt.core.tests.compiler test.xml">
|
| 73 | <antcall target="runtests">
|
| 74 | <param name="testPlugin" value="${org.eclipse.jdt.core.tests.compiler}" />
|
| 75 | </antcall>
|
| 76 | </target>
|
| 77 |
|
| 78 | <target name="jdtcore_model_tests" description="Runs the org.eclipse.jdt.core.tests.model test.xml">
|
| 79 | <antcall target="runtests">
|
| 80 | <param name="testPlugin" value="${org.eclipse.jdt.core.tests.model}" />
|
| 81 | </antcall>
|
| 82 | </target>
|
| 83 |
|
| 84 | <target name="jdt_builder_tests" description="Runs the org.eclipse.jdt.core.tests.builder test.xml">
|
| 85 | <property name="library-file"
|
| 86 | value="${test.eclipseDir}/plugins/${org.eclipse.test}/library.xml"/>
|
| 87 | <antcall target="runtests">
|
| 88 | <param name="testPlugin" value="${org.eclipse.jdt.core.tests.builder}" />
|
| 89 | </antcall>
|
| 90 | </target>
|
| 91 |
|
| 92 |
|
| 93 | <target name="otdt_ui_tests" description="Runs the org.eclipse.objectteams.otdt.ui.tests test.xml">
|
| 94 | <antcall target="runtests">
|
| 95 | <param name="testPlugin" value="${org.eclipse.objectteams.otdt.ui.tests}" />
|
| 96 | </antcall>
|
| 97 | </target>
|
| 98 |
|
| 99 | <target name="otdt_dom_tests" description="Runs the org.eclipse.objectteams.otdt.ui.tests.dom test.xml">
|
| 100 | <antcall target="runtests">
|
| 101 | <param name="testPlugin" value="${org.eclipse.objectteams.otdt.ui.tests.dom}" />
|
| 102 | </antcall>
|
| 103 | </target>
|
| 104 |
|
| 105 | <target name="otdt_ref_tests" description="Runs the org.eclipse.objectteams.otdt.ui.tests.refactoring test.xml">
|
| 106 | <antcall target="runtests">
|
| 107 | <param name="testPlugin" value="${org.eclipse.objectteams.otdt.ui.tests.refactoring}" />
|
| 108 | </antcall>
|
| 109 | </target>
|
| 110 |
|
| 111 | <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^] | 112 | <property name="library-file"
|
| 113 | value="${test.eclipseDir}/plugins/${org.eclipse.test}/library.xml"/>
|
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 114 | <antcall target="runtests">
|
| 115 | <param name="testPlugin" value="${org.eclipse.jdt.ui.tests}" />
|
| 116 | </antcall>
|
| 117 | </target>
|
| 118 |
|
| 119 | <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^] | 120 | <property name="library-file"
|
| 121 | value="${test.eclipseDir}/plugins/${org.eclipse.test}/library.xml"/>
|
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 122 | <antcall target="runtests">
|
| 123 | <param name="testPlugin" value="${org.eclipse.jdt.ui.tests.refactoring}" />
|
| 124 | </antcall>
|
| 125 | </target>
|
| 126 |
|
| 127 | <target name="jdt_debug_tests" description="Runs the org.eclipse.jdt.debug.tests test.xml">
|
| 128 | <property name="library-file"
|
| 129 | value="${test.eclipseDir}/plugins/${org.eclipse.test}/library.xml"/>
|
| 130 | <antcall target="runtests">
|
| 131 | <param name="testPlugin" value="${org.eclipse.jdt.debug.tests}" />
|
| 132 | </antcall>
|
| 133 | </target>
|
| 134 |
|
| 135 | <target name="otdt_debug_tests" description="Runs the org.eclipse.objectteams.otdt.debug.tests test.xml">
|
| 136 | <antcall target="runtests">
|
| 137 | <param name="testPlugin" value="${org.eclipse.objectteams.otdt.debug.tests}" />
|
| 138 | </antcall>
|
| 139 | </target>
|
| 140 |
|
| 141 | <target name="otdt_builder_tests" description="Runs the org.eclipse.objectteams.otdt.test.builder test.xml">
|
| 142 | <antcall target="runtests">
|
| 143 | <param name="testPlugin" value="${org.eclipse.objectteams.otdt.test.builder}" />
|
| 144 | </antcall>
|
| 145 | </target>
|
| 146 |
|
| 147 | <target name="all">
|
| 148 | <!-- enable if we want to debug otre/otequinox:
|
| 149 | <property name="extraVMargs" value="-Dot.dump=1 -Dotequinox.debug=OK" />
|
| 150 | -->
|
| 151 | <!-- debug tests don't like parallelization -->
|
| 152 | <antcall target="jdt_debug_tests" />
|
| 153 | <antcall target="otdt_debug_tests" />
|
Stephan Herrmann | 5aecfe1 | 2010-05-03 23:53:54 +0000 | [diff] [blame] | 154 | <!--parallel threadCount="2"-->
|
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 155 | <!-- "slow", ui tests come first -->
|
| 156 | <antcall target="jdt_ref_tests" />
|
| 157 | <antcall target="jdt_ui_tests" />
|
| 158 | <antcall target="otdt_ui_tests" />
|
| 159 | <antcall target="otdt_ref_tests" />
|
| 160 | <antcall target="otdt_dom_tests" />
|
| 161 | <antcall target="otdt_tests" />
|
| 162 | <antcall target="jdt_builder_tests" />
|
| 163 | <antcall target="jdtcore_compiler_tests" />
|
| 164 | <antcall target="jdtcore_model_tests" />
|
| 165 | <antcall target="otdt_builder_tests" />
|
| 166 | <!-- antcall target="otdt_metrics_tests" / -->
|
Stephan Herrmann | 5aecfe1 | 2010-05-03 23:53:54 +0000 | [diff] [blame] | 167 | <!--/parallel-->
|
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 168 | </target>
|
| 169 |
|
| 170 | <target name="onlyone">
|
| 171 | <antcall target="otdt_ui_tests" />
|
| 172 | </target>
|
| 173 |
|
| 174 | </project>
|