| <project name="testng" default="all" basedir=".."> |
| |
| <property file="build.properties" /> |
| |
| <property name="test14.dir" value="${basedir}/test-14" /> |
| <property name="test.src.dir" value="${test14.dir}/src" /> |
| <property name="test.build.dir" value="${test14.dir}/build" /> |
| |
| <property name="report.dir" value="${test14.dir}/test-output" /> |
| <property name="junit.report.dir" value="${report.dir}/test-tmp" /> |
| <property name="testng.report.dir" value="${report.dir}" /> |
| |
| <target name="all" depends="prepare,compile,run,reports" /> |
| |
| <path id="compile.cp"> |
| <pathelement location="${jdk14.testng.jar}" /> |
| <fileset dir="${lib.dir}"> |
| <include name="junit.jar" /> |
| <include name="${qdox.jar}" /> |
| <include name="concurrent-1.3.4.jar" /> |
| <include name="${beanshell.jar}"/> |
| <include name="util-concurrent.jar" /> |
| </fileset> |
| </path> |
| |
| <path id="run.cp"> |
| <path refid="compile.cp" /> |
| <pathelement location="${java.home}/../lib/tools.jar" /> |
| <pathelement location="${test.build.dir}" /> |
| </path> |
| |
| <path id="run.cp.14"> |
| <path refid="compile.cp" /> |
| <pathelement location="${java14.home}/../lib/tools.jar" /> |
| <pathelement location="${test.build.dir}" /> |
| </path> |
| |
| <target name="env:info"> |
| <echo> |
| BASEDIR =${basedir} |
| TEST15.DIR =${test15.dir} |
| TEST14.DIR =${test14.dir} |
| TEST.SRC.DIR =${test.src.dir} |
| TEST.BUILD.DIR =${test.build.dir} |
| REPORT.DIR =${report.dir} |
| JUNIT.REPORT.DIR =${junit.report.dir} |
| TESTNG.REPORT.DIR=${testng.report.dir} |
| </echo> |
| </target> |
| |
| <!-- ==================================================================== --> |
| <!-- Compile --> |
| <!-- ==================================================================== --> |
| <target name="compile" depends="prepare"> |
| <echo message=" -- Compiling JDK 1.4 tests --" /> |
| |
| <javac classpathref="compile.cp" |
| source="1.4" |
| debug="true" |
| srcdir="${test.src.dir}" |
| destdir="${test.build.dir}" |
| verbose="false" |
| /> |
| </target> |
| |
| <target name="prepare"> |
| <tstamp /> |
| <mkdir dir="${test.build.dir}" /> |
| <mkdir dir="${junit.report.dir}" /> |
| <mkdir dir="${testng.report.dir}" /> |
| </target> |
| |
| <!-- ==================================================================== --> |
| <!-- Run --> |
| <!-- ==================================================================== --> |
| |
| <target name="run" description="Run tests" depends="compile"> |
| <echo> -- Running JDK 1.4 tests (1.5)--</echo> |
| <echo> -- ${jdk14.testng.jar} --</echo> |
| |
| <taskdef name="testng-14" |
| classname="org.testng.TestNGAntTask" |
| classpath="${jdk14.testng.jar}"/> |
| |
| <testng-14 classpathref="run.cp" |
| outputDir="${testng.report.dir}" |
| sourcedir="${test.src.dir}"> |
| <xmlfileset dir="${test14.dir}" includes="testng.xml"/> |
| </testng-14> |
| |
| <echo> -- Running JDK 1.4 tests (1.4)--</echo> |
| <echo> -- ${jdk15.testng.jar} --</echo> |
| |
| <taskdef name="testng-15" |
| classname="org.testng.TestNGAntTask" |
| classpath="${jdk15.testng.jar}"/> |
| |
| <testng-15 classpathref="run.cp" target="1.4" |
| outputDir="${testng.report.dir}" |
| sourcedir="${test.src.dir}"> |
| <xmlfileset dir="${test14.dir}" includes="testng.xml"/> |
| </testng-15> |
| |
| <antcall target="clean.tmp" /> |
| </target> |
| |
| <target name="run:jdk14"> |
| <java classpathref="run.cp.14" jvmversion="5.0" classname="org.testng.TestNG"> |
| <arg line="-d ${testng.report.dir} -sourcedir ${test.src.dir} test-14/testng.xml" /> |
| </java> |
| </target> |
| |
| <target name="run:single" description="Run 1 property file named with the ant property test" depends="compile"> |
| <echo message=" -- testng-run-single --" /> |
| <taskdef name="testng" |
| classname="org.testng.TestNGAntTask" |
| classpath="${jdk15.testng.jar}"/> |
| |
| <testng outputdir="${testng.report.dir}" target="1.4" |
| sourcedir="${test.src.dir}" |
| classpathref="run.cp"> |
| <xmlfileset dir="${test14.dir}" includes="testng-single.xml" /> |
| </testng> |
| |
| <antcall target="clean.tmp" /> |
| </target> |
| |
| <!-- ==================================================================== --> |
| <!-- Run specific configuration --> |
| <!-- ==================================================================== --> |
| <target name="run:conf" if="testng.conf" depends="clean:reports,compile" description="Run specified tests"> |
| <echo message=" -- testng-tests-run --" /> |
| <echo message="using: ${testng.conf}.xml" /> |
| |
| <testng classpathref="run.cp" |
| outputDir="${testng.report.dir}" |
| sourcedir="${test.src.dir}"> |
| <xmlfileset dir="${test14.dir}" includes="${testng.conf}.xml" /> |
| </testng> |
| |
| <antcall target="clean.tmp" /> |
| </target> |
| |
| |
| <!-- ==================================================================== --> |
| <!-- Reports --> |
| <!-- ==================================================================== --> |
| |
| <target name="reports"> |
| <junitreport todir="${junit.report.dir}"> |
| <fileset dir="${testng.report.dir}"> |
| <include name="*.xml" /> |
| <exclude name="testng-failures.xml"/> |
| </fileset> |
| <report format="noframes" todir="${junit.report.dir}" /> |
| </junitreport> |
| </target> |
| |
| <target name="clean.tmp"> |
| <delete dir="${basedir}/test-output-tests" /> |
| </target> |
| |
| <target name="clean:reports"> |
| <delete dir="${report.dir}" /> |
| <delete dir="${junit.report.dir}" /> |
| </target> |
| |
| <target name="clean" depends="clean.tmp,clean:reports"> |
| <echo message=" -- test clean --"/> |
| <delete dir="${test.build.dir}" /> |
| </target> |
| |
| </project> |