| <!-- | |
| Copyright (c) 2010, 2011 IBM Corporation 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: | |
| IBM Corporation - initial API and implementation | |
| --> | |
| <project name="Automated Testing" default="all" basedir="." > | |
| <!--properties file containing the plugin directory name including version number--> | |
| <property file="test.properties" /> | |
| <!-- urls and such from the build --> | |
| <property file="${basedir}/../../../build.cfg" /> | |
| <!--default directory where test-eclipse will be installed--> | |
| <property name="install" value="${basedir}/target" /> | |
| <!--name that can be added to report name to identify which platform tests results come from--> | |
| <property name="platform" value="" /> | |
| <!-- The root of the eclipse installation --> | |
| <property name="eclipse-home" value="${install}/eclipse" /> | |
| <!-- The directory that will contain the xml and html results from the tests that are run --> | |
| <property name="results" value="${basedir}/results" /> | |
| <target name="setup" if="clean" description="Reinstall the test Eclipse installation if specified by user"> | |
| <property name="test.target" value="junits" /> | |
| <delete dir="${install}" /><mkdir dir="${install}" /> | |
| <!-- TODO: if your project requires more dependencies, add them here; if it does not require all of these, remove those not required --> | |
| <echo message="Download, then unpack dependencies ..." /> | |
| <property name="common.releng.dir" value="${basedir}/../../../org.eclipse.modeling.common.releng"/> | |
| <property name="getTestDependencies.xml" value="${common.releng.dir}/scripts/getTestDependencies.xml"/> | |
| <ant target="getTestDependency" antfile="${getTestDependencies.xml}" dir="${common.releng.dir}"> | |
| <property name="url" value="${eclipseURL}" /> | |
| <property name="file" value="${eclipseFile}" /> | |
| <property name="unpackDest" value="${install}"/> | |
| </ant> | |
| <ant target="getTestDependency" antfile="${getTestDependencies.xml}" dir="${common.releng.dir}"> | |
| <property name="url" value="${emfURL}" /> | |
| <property name="file" value="${emfFile}" /> | |
| <property name="unpackDest" value="${install}"/> | |
| </ant> | |
| <property name="dir" location="."/> | |
| <echo message="Unpack SDK + examples + JUnit Tests (${dir}/gmf-*.zip) ..."/> | |
| <unzip dest="${install}/eclipse/dropins" overwrite="true"> | |
| <fileset dir="${dir}"><include name="**/gmf-*.zip"/></fileset> | |
| </unzip> | |
| <echo message="install: ${install}, dropins: ${install}/eclipse/dropins"/> | |
| <echo message="eclipse-home: ${eclipse-home}, dropins-eclipse-home: ${eclipse-home}/dropins/eclipse"/> | |
| </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."> | |
| <!-- TODO: if your test plugin is jarred, comment the next line and uncomment the 4 lines after that. | |
| TODO: if your test plugin is NOT a jarred plugin, do nothing here --> | |
| <echo message="${eclipse-home}/plugins/${testPlugin} is not a jarred plugin. No unpack required!"/> | |
| <!-- <echo message="Unpack ${eclipse-home}/plugins/${testPlugin}.jar to ${eclipse-home}/plugins/${testPlugin} ... "/> | |
| <move file="${eclipse-home}/plugins/${testPlugin}.jar" tofile="${eclipse-home}/plugins/${testPlugin}_.jar"/> | |
| <unjar src="${eclipse-home}/plugins/${testPlugin}_.jar" dest="${eclipse-home}/plugins/${testPlugin}"/> | |
| <delete file="${eclipse-home}/plugins/${testPlugin}_.jar"/> --> | |
| <echo message="Running test.xml from jarfile ${eclipse-home}/dropins/eclipse/plugins/${testPlugin} ... "/> | |
| <ant antfile="${eclipse-home}/dropins/eclipse/plugins/${testPlugin}/test.xml" dir="${eclipse-home}" target="${test.target}"/> | |
| <copy file="${eclipse-home}/${report}.xml" tofile="${results}/xml/${report}_${platform}.xml" /> | |
| </target> | |
| <target name="sdk" depends="setup" description="Runs the test.xml of the tests plugin"> | |
| <antcall target="runtests"> | |
| <param name="testPlugin" value="${org.eclipse.gmf.tests.runtime.notation}" /> | |
| <param name="report" value="org.eclipse.gmf.tests.runtime.notation" /> | |
| </antcall> | |
| </target> | |
| <target name="chkpii" description="Runs CHKPII tests"> | |
| <!-- test if chkpii script exists before proceeding --> | |
| <property name="common.releng.dir" value="${basedir}/../../../org.eclipse.modeling.common.releng"/> | |
| <property name="chkpii.xml" value="${common.releng.dir}/scripts/chkpii.xml"/> | |
| <available file="${chkpii.xml}" property="chkpiiXMLAvailable"/> | |
| <antcall target="runChkpii"/> | |
| </target> | |
| <target name="runChkpii" if="chkpiiXMLAvailable"> | |
| <ant target="chkpii" antfile="${chkpii.xml}" inheritall="true"> | |
| <property name="zipPattern" value="gmf-*.zip"/> | |
| </ant> | |
| </target> | |
| <target name="all"> | |
| <antcall target="sdk" /> | |
| <antcall target="genHtml" /> | |
| </target> | |
| <target name="genHtml" description="Generates HTML results with provided JUNIT.XSL provided"> | |
| <style style="JUNIT.XSL" basedir="${results}/xml" destdir="${results}/html" /> | |
| </target> | |
| </project> |