sboag 00/12/23 15:03:33
Modified: test/java build.xml
Log:
Add conftest, examplestest, and smoketest targets, to be called
by the XalanJ2 build.xml, after the fashion of minitest.
This obviously needs more work to call the tests more easily, as
I would like to be able to call a still more extensive list of tests,
perhaps all of them for a test-fill target, which seems difficult right
now given the granularity of the tests.
Revision Changes Path
1.14 +218 -5 xml-xalan/test/java/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/xml-xalan/test/java/build.xml,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- build.xml 2000/12/15 16:32:36 1.13
+++ build.xml 2000/12/23 23:03:33 1.14
@@ -69,6 +69,18 @@
<pathelement path="${java.class.path}" />
</path>
+ <path id="runconftest.class.path">
+ <pathelement path="${build.dir}/${testxsl.jar}" />
+ <pathelement path="${prepend.class.path}" />
+ <pathelement path="${java.class.path}" />
+ </path>
+
+ <path id="runexamplestest.class.path">
+ <pathelement path="${build.dir}/${testxsl.jar}" />
+ <pathelement path="${prepend.class.path}" />
+ <pathelement path="${java.class.path}" />
+ </path>
+
<!-- Prepare output tree; copy over prebuilt classes -->
<target name="prepare">
<echo message="Classpath is ${java.class.path}" />
@@ -206,6 +218,9 @@
description="Run the Minitest for Xalan-J 2.x">
</target>
+ <target name="conftest.xalan2"
depends="conftest-xalan2,conftest-report,conftest-not-pass,conftest-pass"
+ description="Run the Minitest for Xalan-J 2.x">
+ </target>
<!-- ===================================================================
-->
<!-- Worker targets to compile and run the minitest
-->
@@ -213,13 +228,13 @@
<target name="minitest-xalan1" depends="compile.xsl">
<echo message=" [minitest] SORRY! minitest.xalan1 is not implemented
yet!" />
</target>
- <target name="minitest-xalan2" depends="compile.xsl">
+ <target name="minitest-xalan2">
<property name="results.dir" value="../results-minitest" />
<property name="results.xml" value="${results.dir}/Minitest.xml" />
<property name="results.html" value="${results.dir}/Minitest.html" />
<property name="results.marker" value="${results.dir}/Minitest.Pass"
/>
<property name="tests.root" value="../tests" />
- <echo message=" [minitest] Compile the Minitest:
${prepend.class.path}:${java.class.path}" />
+ <echo message=" [minitest] Compile the Minitest." />
<javac srcdir="${test.dir}/trax"
destdir="${build.dir}"
includes="Minitest.java"
@@ -235,10 +250,10 @@
used for running the minitest with mixed / and \ characters,
the classpathref below correctly switches to the proper
path and file separators for your current platform. -->
- <echo message=" [minitest] Run the Minitest:
${build.dir}/${testxsl.jar}:${prepend.class.path}:${java.class.path}" />
+ <echo message=" [minitest] Run the Minitest." />
<java classname="org.apache.qetest.trax.Minitest"
classpathref="runminitest.class.path"
- fork="yes"
+ fork="no"
failonerror="no">
<!-- I can't get this to work without the fork="yes" statement
above - if we are called from a build.xml that just jar'd
@@ -259,7 +274,7 @@
<arg value="-logFile" />
<arg path="${results.xml}" />
<arg value="-loggingLevel" />
- <arg value="99" />
+ <arg value="5" />
</java>
<!-- Set properties for running other targets -->
<available file="${results.marker}" property="minitest-passed" />
@@ -291,6 +306,204 @@
<echo message=" [minitest] Please fix any Minitest problems before
checking in!" />
<fail message="Please fix any Minitest problems before checking in!"
/>
</target>
+
+
+ <!-- ===================================================================
-->
+ <!-- Worker targets to compile and run the conformance test
-->
+ <!-- ===================================================================
-->
+ <target name="conftest-xalan1" depends="compile.xsl">
+ <echo message=" [conftest] SORRY! conftest.xalan1 is not implemented
yet!" />
+ </target>
+ <target name="conftest-xalan2">
+ <property name="conftest-results.dir" value="../results-conftest" />
+ <property name="conftest-results.xml"
value="${conftest-results.dir}/ConformanceTest.xml" />
+ <property name="conftest-results.html"
value="${conftest-results.dir}/ConformanceTest.html" />
+ <property name="conftest-results.marker"
value="${conftest-results.dir}/ConformanceTest.Pass" />
+ <property name="conftest-tests.root" value="../tests" />
+ <echo message=" [conftest] Compile the ConformanceTest." />
+ <javac srcdir="${test.dir}/trax"
+ destdir="${build.dir}"
+ includes="ConformanceTest.java"
+ debug="${debug}"
+ classpathref="compiletest.class.path" />
+
+ <echo message=" [conftest] Jar the ConformanceTest" />
+ <jar jarfile="${build.dir}/${testxsl.jar}"
+ basedir="${build.dir}"
+ includes="**/*.class,**/*.properties" />
+
+ <!-- Note that while the echo line below prints out the classpath
+ used for running the conftest with mixed / and \ characters,
+ the classpathref below correctly switches to the proper
+ path and file separators for your current platform. -->
+ <echo message=" [conftest] Run the ConformanceTest." />
+ <java classname="org.apache.qetest.xsl.ConformanceTest"
+ classpathref="runconftest.class.path"
+ fork="no"
+ failonerror="yes">
+ <!-- I can't get this to work without the fork="yes" statement
+ above - if we are called from a build.xml that just jar'd
+ a xalan.jar, we get a wacky error trying to call any
+ Xalan API's (can't unpack the jar file).
+ I think because I'm trying to change the classpath
+ to include the xalan.jar that our calling build.xml may
+ have just created in this same Ant session, and I bet
+ the classloader gets confused somehow.
+ Hints, anyone?
+ -->
+ <arg value="-inputDir" />
+ <arg path="${conftest-tests.root}/conf" />
+ <arg value="-goldDir" />
+ <arg path="${conftest-tests.root}/conf-gold" />
+ <arg value="-outputDir" />
+ <arg path="${conftest-results.dir}" />
+ <arg value="-logFile" />
+ <arg path="${conftest-results.xml}" />
+ <arg value="-loggingLevel" />
+ <arg value="5" />
+ <arg value="-flavor" />
+ <arg value="trax" />
+ <!-- arg value="-category" />
+ <arg value="whitespace" / -->
+ <arg value="-noErrTest" />
+ <arg value="true" />
+ <arg value="-excludes"/>
+ <arg value="impincl12.xsl" />
+ <arg value="-fileChecker" />
+ <arg value="org.apache.qetest.xsl.XHTFileCheckService" />
+ </java>
+ <!-- Set properties for running other targets -->
+ <available file="${conftest-results.marker}"
property="conftest-passed" />
+ </target>
+
+ <!-- Common worker targets for other conftest targets to call -->
+ <target name="conftest-report" if="conftest-style">
+ <echo message=" [conftest] Create ConformanceTest report" />
+ <!-- I also can't get the style task to work, even after putting
+ the optional.jar in various locations and/or explicitly adding
+ it to the classpath in build.bat. More hints, anyone?
+ -->
+ <style processor="xalan"
+ style="../viewResults.xsl"
+ basedir="${conftest-results.dir}"
+ destdir="${conftest-results.dir}"
+ includes="ConformanceTest.xml" />
+ </target>
+ <target name="conftest-pass" if="conftest-passed">
+ <echo message=" [conftest] CONGRATULATIONS! The ConformanceTest
passed!" />
+ <echo message=" [conftest] See details in ${conftest-results.html}"
/>
+ </target>
+ <!-- Note: avoid the use of 'fail' in the target name, in case
+ any log-grepping tools are searching for this -->
+ <target name="conftest-not-pass" unless="conftest-passed">
+ <echo message=" [conftest] ERROR! The ConformanceTest failed!" />
+ <echo message=" [conftest] See details in ${conftest-results.xml} or
${conftest-results.html}" />
+ <echo message=" [conftest] Please fix any ConformanceTest problems
before checking in!" />
+ <fail message="Please fix any ConformanceTest problems before
checking in!" />
+ </target>
+
+ <!-- ===================================================================
-->
+ <!-- Worker targets to compile and run the examples test -->
+ <!-- ===================================================================
-->
+ <target name="examplestest-xalan1" depends="compile.xsl">
+ <echo message=" [examplestest] SORRY! examplestest.xalan1 is not
implemented yet!" />
+ </target>
+ <target name="examplestest-xalan2">
+ <property name="examplestest-results.dir"
value="../results-examplestest" />
+ <property name="examplestest-results.xml"
value="${results.dir}/ExamplesTest.xml" />
+ <property name="examplestest-results.html"
value="${results.dir}/ExamplesTest.html" />
+ <property name="examplestest-results.marker"
value="${results.dir}/ExamplesTest.Pass" />
+ <property name="examplestest-tests.root" value="../tests" />
+ <echo message=" [examplestest] Compile the ExamplesTest." />
+ <javac srcdir="${test.dir}/trax"
+ destdir="${build.dir}"
+ includes="ExamplesTest.java"
+ debug="${debug}"
+ classpathref="compiletest.class.path" />
+
+ <echo message=" [examplestest] Jar the ExamplesTest" />
+ <jar jarfile="${build.dir}/${testxsl.jar}"
+ basedir="${build.dir}"
+ includes="**/*.class,**/*.properties" />
+
+ <!-- Note that while the echo line below prints out the classpath
+ used for running the examplestest with mixed / and \
characters,
+ the classpathref below correctly switches to the proper
+ path and file separators for your current platform. -->
+ <echo message=" [examplestest] Run the ExamplesTest." />
+ <java classname="org.apache.qetest.trax.ExamplesTest"
+ classpathref="runexamplestest.class.path"
+ fork="no"
+ failonerror="no">
+ <!-- I can't get this to work without the fork="yes" statement
+ above - if we are called from a build.xml that just jar'd
+ a xalan.jar, we get a wacky error trying to call any
+ Xalan API's (can't unpack the jar file).
+ I think because I'm trying to change the classpath
+ to include the xalan.jar that our calling build.xml may
+ have just created in this same Ant session, and I bet
+ the classloader gets confused somehow.
+ Hints, anyone?
+ -->
+ <arg value="-inputDir" />
+ <arg path="${examplestest-tests.root}/api" />
+ <arg value="-goldDir" />
+ <arg path="${examplestest-tests.root}/api-gold" />
+ <arg value="-outputDir" />
+ <arg path="${examplestest-results.dir}" />
+ <arg value="-logFile" />
+ <arg path="${examplestest-results.xml}" />
+ <arg value="-loggingLevel" />
+ <arg value="50" />
+ <arg value="-flavor" />
+ <arg value="trax" />
+ <arg value="-noErrTest" />
+ <arg value="true" />
+ <arg value="-fileChecker" />
+ <arg value="org.apache.qetest.xsl.XHTFileCheckService" />
+ </java>
+ <!-- Set properties for running other targets -->
+ <available file="${examplestest-results.marker}"
property="examplestest-passed" />
+ <available
classname="org.apache.tools.ant.taskdefs.optional.XalanLiaison"
property="examplestest-style" />
+ </target>
+
+ <!-- Common worker targets for other examplestest targets to call -->
+ <target name="examplestest-report" if="examplestest-style">
+ <echo message=" [examplestest] Create ExamplesTest report" />
+ <!-- I also can't get the style task to work, even after putting
+ the optional.jar in various locations and/or explicitly adding
+ it to the classpath in build.bat. More hints, anyone?
+ -->
+ <style processor="xalan"
+ style="../viewResults.xsl"
+ basedir="${results.dir}"
+ destdir="${results.dir}"
+ includes="ExamplesTest.xml" />
+ </target>
+ <target name="examplestest-pass" if="examplestest-passed">
+ <echo message=" [examplestest] CONGRATULATIONS! The ExamplesTest
passed!" />
+ <echo message=" [examplestest] See details in
${examplestest-results.html}" />
+ </target>
+ <!-- Note: avoid the use of 'fail' in the target name, in case
+ any log-grepping tools are searching for this -->
+ <target name="examplestest-not-pass" unless="examplestest-passed">
+ <echo message=" [examplestest] ERROR! The ExamplesTest failed!" />
+ <echo message=" [examplestest] See details in
${examplestest-results.xml} or ${examplestest-results.html}" />
+ <echo message=" [examplestest] Please fix any ExamplesTest problems
before checking in!" />
+ <fail message="Please fix any ExamplesTest problems before checking
in!" />
+ </target>
+
+ <!-- ===================================================================
-->
+ <!-- Run a general smoke test composed of other tests
-->
+ <!-- ===================================================================
-->
+ <target name="smoketest-xalan2"
+ depends="conftest-xalan2, minitest-xalan2, examplestest-xalan2,
+ conftest-report,conftest-not-pass,conftest-pass,
+ minitest-report,minitest-not-pass,minitest-pass,
+ examplestest-report,examplestest-not-pass,examplestest-pass"/>
+
+
+ <!-- ===================================================================
-->
<!-- All wrappers; requires competitor's jars in the classpath, as
appropriate
(You may be better off compiling other wrappers by hand, and then
simply