Jskad/junitbuild.xml

107 lines
4.8 KiB
XML
Raw Permalink Normal View History

<!-- @author David Chandler, dchandler@users.sourceforge.net
We have a document,
http://thdltools.sourceforge.net/BuildSystems.html, that you
probably should read.
-->
2003-02-01 06:43:13 +00:00
<project name="THDLTools-junit" default="fail-nicely" basedir=".">
<description>
This Jakarta Ant buildfile is used to do the low-level work of
unit testing our system. This is separate from build.xml because
to use this build file, you must have installed JUnit and the
JUnit Ant tasks (i.e., $ANT_HOME/lib/junit.jar and
$ANT_HOME/lib/optional.jar). Thus, this buildfile contains only
targets that must interact with JUnit.
Read the comments of this buildfile to learn more, or see
'http://thdltools.sourceforge.net/BuildSystems.html'.
</description>
<taskdef name="junit"
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>
You may no longer put xml-apis.jar, xercesImpl.jar, or xalan.jar in Jskad/extensions. If you're lazy, you can move them to extensions/drop-ins, but the correct thing to do is to move x*.jar to $ANT_HOME/lib [next to vamp.jar, if you're already set up for Java Web Start builds]. This is a side effect of improving the nightly builds. Nightly builds now feature an HTML summary of the JUnit test results, a datestamp, and full API docs in two flavors. If you use a patched vamp.jar [e-mail me] that can run when an X11 display is not available (there is not an analogous problem for Windows servers, I suspect), all you have to do to put up a nightly builds site is to set up CVS access so that no password is requires using SSH public-key crypto (sf.net documents how to do so well) and then use the following daily cron job on your Unix box: #! /bin/sh renice +19 -p $$ >/dev/null 2>&1 su -l joe-user /bin/sh -c /var/www/thdl/nightly/doTheBuild.sh where joe-user is an unprivileged user who has installed Ant properly (see the updated BuildSystems.html on the developer's site off of thdltools.sf.net) and set himself up a Jskad sandbox with a Fonts sandbox underneath it in, e.g., /var/www/thdl/nightly/Jskad. Here's doTheBuild.sh: #! /bin/sh JSKAD=/var/www/thdl/nightly/Jskad DEST=/var/www/thdl/nightly/builds HISTORY=/var/www/thdl/nightly/history DATE=`date` if test ! -d $DEST; then \ echo "$DEST does not exist ($DATE)." >> history; exit 1; fi (cd $JSKAD && ant dc-nightly-build \ && rm -fr ${DEST}/* \ && cp dist/nightlyBuild.zip $DEST \ && cd $DEST \ && unzip nightlyBuild.zip) if test $? != 0; then echo "NIGHTLY BUILDS FAILED on $DATE" >> $HISTORY; exit 2; fi DDDATE=`date` echo "Success on start=$DATE end=$DDDATE" >> $HISTORY exit 0
2003-02-10 04:22:38 +00:00
<taskdef name="junitreport"
classname="org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator"/>
<property file="build.properties"/>
<property name="halt.after.trouble" value="no"/>
<target name="fail-nicely"
description="Tells the user to use build.xml, not this subbuildfile.">
<fail message="Do not use this file directly; use build.xml instead, which then uses this file."/>
</target>
<!-- This creates output files TEST* in the Jskad/ directory. -->
<target name="run-headed-junit-tests"
description="Assuming that compilation of appropriate classes has been done, this target runs all the non-headless JUnit tests in the project.">
<junit fork="no" printsummary="yes" haltonfailure="${halt.after.trouble}" haltonerror="${halt.after.trouble}">
<!-- we don't halt on error because you get an error when you run
on a headless display -->
<classpath>
<pathelement location="${junitbin}"/>
<path refid="entire.class.path"/>
</classpath>
You may no longer put xml-apis.jar, xercesImpl.jar, or xalan.jar in Jskad/extensions. If you're lazy, you can move them to extensions/drop-ins, but the correct thing to do is to move x*.jar to $ANT_HOME/lib [next to vamp.jar, if you're already set up for Java Web Start builds]. This is a side effect of improving the nightly builds. Nightly builds now feature an HTML summary of the JUnit test results, a datestamp, and full API docs in two flavors. If you use a patched vamp.jar [e-mail me] that can run when an X11 display is not available (there is not an analogous problem for Windows servers, I suspect), all you have to do to put up a nightly builds site is to set up CVS access so that no password is requires using SSH public-key crypto (sf.net documents how to do so well) and then use the following daily cron job on your Unix box: #! /bin/sh renice +19 -p $$ >/dev/null 2>&1 su -l joe-user /bin/sh -c /var/www/thdl/nightly/doTheBuild.sh where joe-user is an unprivileged user who has installed Ant properly (see the updated BuildSystems.html on the developer's site off of thdltools.sf.net) and set himself up a Jskad sandbox with a Fonts sandbox underneath it in, e.g., /var/www/thdl/nightly/Jskad. Here's doTheBuild.sh: #! /bin/sh JSKAD=/var/www/thdl/nightly/Jskad DEST=/var/www/thdl/nightly/builds HISTORY=/var/www/thdl/nightly/history DATE=`date` if test ! -d $DEST; then \ echo "$DEST does not exist ($DATE)." >> history; exit 1; fi (cd $JSKAD && ant dc-nightly-build \ && rm -fr ${DEST}/* \ && cp dist/nightlyBuild.zip $DEST \ && cd $DEST \ && unzip nightlyBuild.zip) if test $? != 0; then echo "NIGHTLY BUILDS FAILED on $DATE" >> $HISTORY; exit 2; fi DDDATE=`date` echo "Success on start=$DATE end=$DDDATE" >> $HISTORY exit 0
2003-02-10 04:22:38 +00:00
<formatter type="xml"/><!-- If not XML, then 'ant -buildfile
build.xml check-report' will fail. -->
<test name="org.thdl.tib.input.DuffPaneTest"/>
<test name="org.thdl.tib.input.TinyTest"/>
</junit>
</target>
<target name="run-one-junit-test"
description="Runs soletest, a single JUnit test [class].">
<junit fork="no" printsummary="yes" haltonfailure="true" haltonerror="true">
<classpath>
<pathelement location="${junitbin}"/>
<path refid="entire.class.path"/>
</classpath>
<formatter type="xml"/><!-- If not XML, then 'ant -buildfile
build.xml check-report' will fail. -->
<test name="${soletest}"/>
</junit>
</target>
<target name="run-headless-junit-tests"
description="Assuming that compilation of appropriate classes has been done, this target runs all the headless JUnit tests in the project.">
<junit fork="no" printsummary="yes" haltonfailure="yes" haltonerror="yes">
<sysproperty key="java.awt.headless" value="true"/>
<classpath>
<pathelement location="${junitbin}"/>
<path refid="entire.class.path"/>
</classpath>
<formatter type="xml"/><!-- If not XML, then 'ant -buildfile
build.xml check-report' will fail. -->
<sysproperty key="java.awt.headless" value="true"/>
<test name="org.thdl.tib.text.reverter.ConverterTest"/>
<test name="org.thdl.tib.text.reverter.UnicodeToTranslitForXsltTest"/>
<test name="org.thdl.tib.text.ttt.EwtsToUnicodeForXsltTest"/>
<test name="org.thdl.tib.text.ttt.EWTSTest"/>
<test name="org.thdl.tib.text.ttt.EWTStibwniniTest"/>
<test name="org.thdl.tib.input.TMW_RTF_TO_THDL_WYLIETest"/>
<test name="org.thdl.tib.text.TibetanMachineWebTest"/>
<test name="org.thdl.tib.text.ttt.PackageTest"/>
<test name="org.thdl.tib.text.ttt.LotsOfTshegBarsTest"/>
<test name="org.thdl.util.RTFFixerInputStreamTest"/>
<test name="org.thdl.util.ThdlLazyExceptionTest"/>
<test name="org.thdl.util.TrieTest"/>
<test name="org.thdl.tib.text.tshegbar.UnicodeUtilsTest"/>
<test name="org.thdl.tib.text.tshegbar.LegalTshegBarTest"/>
<test name="org.thdl.tib.text.tshegbar.UnicodeGraphemeClusterTest"/>
<test name="org.thdl.tib.text.tshegbar.UnicodeCodepointToThdlWylieTest"/>
</junit>
</target>
You may no longer put xml-apis.jar, xercesImpl.jar, or xalan.jar in Jskad/extensions. If you're lazy, you can move them to extensions/drop-ins, but the correct thing to do is to move x*.jar to $ANT_HOME/lib [next to vamp.jar, if you're already set up for Java Web Start builds]. This is a side effect of improving the nightly builds. Nightly builds now feature an HTML summary of the JUnit test results, a datestamp, and full API docs in two flavors. If you use a patched vamp.jar [e-mail me] that can run when an X11 display is not available (there is not an analogous problem for Windows servers, I suspect), all you have to do to put up a nightly builds site is to set up CVS access so that no password is requires using SSH public-key crypto (sf.net documents how to do so well) and then use the following daily cron job on your Unix box: #! /bin/sh renice +19 -p $$ >/dev/null 2>&1 su -l joe-user /bin/sh -c /var/www/thdl/nightly/doTheBuild.sh where joe-user is an unprivileged user who has installed Ant properly (see the updated BuildSystems.html on the developer's site off of thdltools.sf.net) and set himself up a Jskad sandbox with a Fonts sandbox underneath it in, e.g., /var/www/thdl/nightly/Jskad. Here's doTheBuild.sh: #! /bin/sh JSKAD=/var/www/thdl/nightly/Jskad DEST=/var/www/thdl/nightly/builds HISTORY=/var/www/thdl/nightly/history DATE=`date` if test ! -d $DEST; then \ echo "$DEST does not exist ($DATE)." >> history; exit 1; fi (cd $JSKAD && ant dc-nightly-build \ && rm -fr ${DEST}/* \ && cp dist/nightlyBuild.zip $DEST \ && cd $DEST \ && unzip nightlyBuild.zip) if test $? != 0; then echo "NIGHTLY BUILDS FAILED on $DATE" >> $HISTORY; exit 2; fi DDDATE=`date` echo "Success on start=$DATE end=$DDDATE" >> $HISTORY exit 0
2003-02-10 04:22:38 +00:00
<!-- Note the odd dependencies. -->
<target name="make-nightly-report"
description="Creates an HTML report about the status of the tests; is dependent (via build.xml) on targets that execute JUnit Ant tasks.">
You may no longer put xml-apis.jar, xercesImpl.jar, or xalan.jar in Jskad/extensions. If you're lazy, you can move them to extensions/drop-ins, but the correct thing to do is to move x*.jar to $ANT_HOME/lib [next to vamp.jar, if you're already set up for Java Web Start builds]. This is a side effect of improving the nightly builds. Nightly builds now feature an HTML summary of the JUnit test results, a datestamp, and full API docs in two flavors. If you use a patched vamp.jar [e-mail me] that can run when an X11 display is not available (there is not an analogous problem for Windows servers, I suspect), all you have to do to put up a nightly builds site is to set up CVS access so that no password is requires using SSH public-key crypto (sf.net documents how to do so well) and then use the following daily cron job on your Unix box: #! /bin/sh renice +19 -p $$ >/dev/null 2>&1 su -l joe-user /bin/sh -c /var/www/thdl/nightly/doTheBuild.sh where joe-user is an unprivileged user who has installed Ant properly (see the updated BuildSystems.html on the developer's site off of thdltools.sf.net) and set himself up a Jskad sandbox with a Fonts sandbox underneath it in, e.g., /var/www/thdl/nightly/Jskad. Here's doTheBuild.sh: #! /bin/sh JSKAD=/var/www/thdl/nightly/Jskad DEST=/var/www/thdl/nightly/builds HISTORY=/var/www/thdl/nightly/history DATE=`date` if test ! -d $DEST; then \ echo "$DEST does not exist ($DATE)." >> history; exit 1; fi (cd $JSKAD && ant dc-nightly-build \ && rm -fr ${DEST}/* \ && cp dist/nightlyBuild.zip $DEST \ && cd $DEST \ && unzip nightlyBuild.zip) if test $? != 0; then echo "NIGHTLY BUILDS FAILED on $DATE" >> $HISTORY; exit 2; fi DDDATE=`date` echo "Success on start=$DATE end=$DDDATE" >> $HISTORY exit 0
2003-02-10 04:22:38 +00:00
<junitreport todir="${dist}">
<fileset dir=".">
<include name="TEST-*.xml"/>
</fileset>
<report format="noframes" todir="${dist}"/>
</junitreport>
<delete file="${dist}/TESTS-TestSuites.xml"/>
</target>
</project>