<project name="Automated Eclipse Testing" default="all" basedir=".">

	<!--properties file containing the plugin directory name including version number,
	 and list of required test plug-ins expressed as command-line argument to unzip executable.-->
	<property file="test.properties" />

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

	<!--suffix added to report name to identify which platform tests results come from-->
	<property name="platform" value="${os}.${ws}.${arch}" />

	<!-- The directory that will contain the xml and html results from the tests that are run -->
	<property name="junit-report-output" value="${basedir}/results" />
	<property name="org.eclipse.test" value="org.eclipse.test" />

	<!-- The root of the eclipse installation -->
	<property name="eclipse-home" value="eclipse" />
	<property name="extraVMargs" value=""/>
	<property name="timeout" value="7200000" />
	<property name="formatter" value="org.eclipse.php.test.formatter.XMLJUnitResultFormatter"/>

	<target name="init">
		<mkdir dir="${junit-report-output}" />
	</target>

	<target name="junit">
		<property name="derby" value="" />
		<property name="test-output" value="${junit-report-output}/${classname}.result.xml" />	
		<ant antfile="${eclipse-home}/plugins/${org.eclipse.php.test}/test.xml" dir="." />
	</target>

	<target name="runtests" depends="init" unless="skip.test">
		<property name="${testPlugin}.prerequisites" value="" />
		<!--override the value of this property with performance if the tests run on performance machine-->
		<property name="test.target" value="junit" />
		<antcall target="${test.target}" />
	</target>

	<target name="php.test.core" description="Runs core tests">
		<antcall target="runtests">
			<param name="testPlugin" value="org.eclipse.php.test" />
			<param name="classname" value="org.eclipse.php.test.HeadlessTestSuite" />
			<param name="report" value="HeadlessTestSuite" />
			<param name="testPluginsRequired" value="" />
			<param name="application" value="org.eclipse.php.test.coretestapplication" />
			<param name="testTarget" value="HeadlessTestSuite" />
			<param name="vmargs" value="-ea -DCreateGolden=false -DEnableWorkbench=false" />
		</antcall>
	</target>

	<target name="php.test.ui" description="Runs ui tests">
		<antcall target="runtests">
			<param name="testPlugin" value="org.eclipse.php.test" />
			<param name="classname" value="org.eclipse.php.test.GUITestSuite" />
			<param name="report" value="GUITestSuite" />
			<param name="testPluginsRequired" value="" />
			<param name="application" value="org.eclipse.php.test.uitestapplication" />
			<param name="testTarget" value="GUITestSuite" />
			<param name="vmargs" value="-ea -DCreateGolden=false -DEnableWorkbench=true" />
		</antcall>
	</target>

	<target name="php.test.bare" description="Runs bare tests">
		<antcall target="runtests">
			<param name="testPlugin" value="org.eclipse.php.test" />
			<param name="classname" value="org.eclipse.php.test.BareTestSuite" />
			<param name="report" value="BareTestSuite" />
			<param name="testPluginsRequired" value="" />
			<param name="application" value="org.eclipse.php.test.coretestapplication" />
			<param name="testTarget" value="BareTestSuite" />
			<param name="vmargs" value="-ea -DCreateGolden=false -DEnableWorkbench=false" />
		</antcall>
	</target>

	<target name="all">
		<antcall target="php.test.bare" />
		<antcall target="php.test.core" />
		<antcall target="php.test.ui" />
	</target>
</project>
