Added support to run the optional testsuites.

This commit is contained in:
Manuel Canales Esparcia 2005-09-28 19:30:31 +00:00
parent b8bf2f858a
commit db9cec66f1
2 changed files with 23 additions and 6 deletions

View file

@ -6,6 +6,8 @@
<!-- XSLT stylesheet to create shell scripts from LFS books. --> <!-- XSLT stylesheet to create shell scripts from LFS books. -->
<xsl:param name="testsuite" select="0"/>
<xsl:template match="/"> <xsl:template match="/">
<xsl:apply-templates select="//sect1"/> <xsl:apply-templates select="//sect1"/>
</xsl:template> </xsl:template>
@ -42,7 +44,7 @@
<!-- Creating dirs and files --> <!-- Creating dirs and files -->
<exsl:document href="{$dirname}/{$order}-{$filename}" method="text"> <exsl:document href="{$dirname}/{$order}-{$filename}" method="text">
<xsl:text>#!/bin/sh&#xA;&#xA;</xsl:text> <xsl:text>#!/bin/sh&#xA;&#xA;</xsl:text>
<xsl:apply-templates select=".//screen"/> <xsl:apply-templates select=".//para/userinput | .//screen"/>
</exsl:document> </exsl:document>
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
@ -52,7 +54,7 @@
<xsl:choose> <xsl:choose>
<xsl:when test="@role = 'nodump'"/> <xsl:when test="@role = 'nodump'"/>
<xsl:otherwise> <xsl:otherwise>
<xsl:apply-templates select="userinput"/> <xsl:apply-templates select="userinput" mode="screen"/>
<xsl:if test="position() != last() and <xsl:if test="position() != last() and
not(contains(string(),'EOF'))"> not(contains(string(),'EOF'))">
<xsl:text> &amp;&amp;</xsl:text> <xsl:text> &amp;&amp;</xsl:text>
@ -63,7 +65,14 @@
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
<xsl:template match="userinput"> <xsl:template match="para/userinput">
<xsl:if test="$testsuite = '0'">
<xsl:apply-templates/>
<xsl:text> &amp;&amp;&#xA;</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="userinput" mode="screen">
<xsl:apply-templates/> <xsl:apply-templates/>
</xsl:template> </xsl:template>

14
jhalfs
View file

@ -3,7 +3,7 @@
version=" version="
jhalfs development jhalfs development
Written by Jeremy Huntwork. Originally written by Jeremy Huntwork.
Maintained by Manuel Canales Esparcia. Maintained by Manuel Canales Esparcia.
This program is published under the \ This program is published under the \
@ -22,6 +22,7 @@ Options:
DIR/jhalfs DIR/jhalfs
-D, --download-client=CLIENT use CLIENT as the program for retrieving -D, --download-client=CLIENT use CLIENT as the program for retrieving
packages packages
-T, --no-testsuites don't run the package's testsuites.
" "
help="\ help="\
@ -77,6 +78,12 @@ while test $# -gt 0 ; do
shift shift
;; ;;
--no-testsuites | -T )
shift
TEST=1
shift
;;
* ) * )
echo "$usage" echo "$usage"
exit 1 exit 1
@ -110,6 +117,7 @@ JHALFSDIR=$BUILDDIR/jhalfs
LOG=build.log LOG=build.log
MKFILE=$JHALFSDIR/Makefile MKFILE=$JHALFSDIR/Makefile
XSL=dump-commands.xsl XSL=dump-commands.xsl
if [ -z $TEST ] ; then TEST=0 ; fi
get_book() { get_book() {
# Check for Subversion instead of just letting the script hit 'svn' and fail. # Check for Subversion instead of just letting the script hit 'svn' and fail.
@ -156,8 +164,8 @@ extract_commands() {
echo -n "Extracting commands... " echo -n "Extracting commands... "
# Dump the commands in shell script form from the LFS book. # Dump the commands in shell script form from the LFS book.
xsltproc --nonet --xinclude -o ./commands/ $XSL \ xsltproc --nonet --xinclude --stringparam testsuite $TEST -o ./commands/ \
lfs-$LFSVRS/index.xml >>$JHALFSDIR/$LOG 2>&1 $XSL lfs-$LFSVRS/index.xml >>$JHALFSDIR/$LOG 2>&1
# Grab the patches and package names. # Grab the patches and package names.
cd $JHALFSDIR cd $JHALFSDIR