Permalink
Fetching contributors…
Cannot retrieve contributors at this time
87 lines (77 sloc) 3.42 KB
<?xml version="1.0" encoding="utf-8"?>
<project name="PCT-Tests" xmlns:jacoco="antlib:org.jacoco.ant">
<!-- Default values when using command line -->
<property environment="env" />
<property name="DLC" value="${env.DLC}" />
<property name="PROFILER" value="false" />
<property name="TESTLIBS" value="${basedir}/lib" />
<!-- Assume version 11 when in local development -->
<condition property="GROUPS" value="v10,v11">
<not><isset property="OE_MAJOR_VERSION" /></not>
</condition>
<!-- Groups to be executed depending on OpenEdge major version -->
<condition property="GROUPS" value="v10">
<equals arg1="${OE_MAJOR_VERSION}" arg2="10" />
</condition>
<condition property="GROUPS" value="v10,v11">
<equals arg1="${OE_MAJOR_VERSION}" arg2="11" />
</condition>
<!-- Excluded group depending on OS -->
<condition property="EXCLUDES" value="unix" else="win">
<os family="windows" />
</condition>
<!-- Only for ProUnit and OEUnit -->
<condition property="SIXTYFOUR" value="-64" else="">
<and>
<equals arg1="${OE_MAJOR_VERSION}" arg2="10" />
<equals arg1="${OE_ARCH}" arg2="64" />
</and>
</condition>
<condition property="VERSION" value="dlc${OE_MAJOR_VERSION}${SIXTYFOUR}" else="dlc11">
<isset property="OE_MAJOR_VERSION" />
</condition>
<path id="test.run.cp">
<pathelement location="build/test" />
<fileset dir="dist" includes="PCT.jar" />
<fileset dir="lib" includes="*.jar" />
</path>
<path id="testng.cp">
<fileset dir="lib" includes="testng-6.13.1.jar,jcommander-1.30.jar" />
</path>
<path id="jacoco.cp">
<fileset dir="lib" includes="jacocoant.jar" />
</path>
<target name="init">
<unzip src="dist/testcases.zip" dest="." />
<mkdir dir="testbox/PCTCompileExt" />
<copy todir="testbox/PCTCompileExt">
<fileset dir="testbox/PCTCompile" />
</copy>
<!-- Only in testXX, test cases with number greater than 100 are reserved for PCTCompileExt -->
<replace dir="testbox/PCTCompileExt" includes="test??/build.xml" token="PCTCompile" value="PCTCompileExt" />
<replace dir="testbox/PCTCompileExt" includes="test??/build.xml" token="pct:compile" value="pct:compile_ext" />
</target>
<target name="test">
<!-- On Windows : ant -file tests.xml test -->
<mkdir dir="test-output" />
<mkdir dir="profiler" />
<taskdef resource="testngtasks" classpathref="testng.cp" />
<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpathref="jacoco.cp" />
<jacoco:coverage destFile="profiler/jacoco.exec">
<testng workingDir="testbox" outputdir="test-output" useDefaultListeners="true" groups="${GROUPS}" excludedGroups="${EXCLUDES}" suiteName="${TESTENV} tests">
<classfileset dir="build/test" includes="**/*Test.class" excludes="**/*BrokerTest.class" />
<classpath refid="test.run.cp" />
<jvmarg line="-DDLC=&quot;${DLC}&quot; -DPROFILER=${PROFILER} -DTESTLIBS=${TESTLIBS} -DVERSION=${VERSION}" />
</testng>
</jacoco:coverage>
</target>
<target name="dist" depends="test">
<copy file="test-output/emailable-report.html" tofile="emailable-report-${TESTENV}.html" />
<zip destFile="oe-profiler-data.zip">
<fileset dir="testbox" includes="**/profiler*.out" />
</zip>
<zip destFile="junitreports-${TESTENV}.zip">
<zipfileset dir="test-output/junitreports" includes="*.xml" prefix="junitreports-${TESTENV}" />
</zip>
</target>
</project>