Jskad/junitbuild.xml
dchandler bb19c4f6d1 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

60 lines
2.4 KiB
XML

<!-- @author David Chandler, dchandler@users.sourceforge.net
We have a document,
http://thdltools.sourceforge.net/BuildSystems.html, that you
probably should read.
-->
<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"/>
<taskdef name="junitreport"
classname="org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator"/>
<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-all-junit-tests"
description="Assuming that compilation of appropriate classes has been done, this target runs all the JUnit tests in the project.">
<junit fork="no" printsummary="yes" haltonfailure="yes" haltonerror="yes">
<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="org.thdl.util.ThdlLazyExceptionTest"/>
<test name="org.thdl.util.TrieTest"/>
</junit>
</target>
<!-- 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 target `run-all-junit-tests'.">
<junitreport todir="${dist}">
<fileset dir=".">
<include name="TEST-*.xml"/>
</fileset>
<report format="noframes" todir="${dist}"/>
</junitreport>
<delete file="${dist}/TESTS-TestSuites.xml"/>
</target>
</project>