Allows having << EOF in tests, and not generating >> $TEST_LOG... until the
matching EOF is found.
This commit is contained in:
parent
9728b235e6
commit
6caa5b8816
1 changed files with 34 additions and 8 deletions
34
LFS/lfs.xsl
34
LFS/lfs.xsl
|
@ -1080,17 +1080,32 @@ LOGLEVEL="</xsl:text>
|
||||||
|
|
||||||
<xsl:template name="comment-test">
|
<xsl:template name="comment-test">
|
||||||
<xsl:param name="instructions" select="''"/>
|
<xsl:param name="instructions" select="''"/>
|
||||||
|
<xsl:param name="eof-seen" select="false()"/>
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="contains($instructions,'
')">
|
<xsl:when test="contains($instructions,'
')">
|
||||||
<xsl:call-template name="comment-test">
|
<xsl:call-template name="comment-test">
|
||||||
<xsl:with-param name="instructions"
|
<xsl:with-param name="instructions"
|
||||||
select="substring-before($instructions,'
')"/>
|
select="substring-before($instructions,'
')"/>
|
||||||
|
<xsl:with-param name="eof-seen" select="$eof-seen"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="contains(substring-before($instructions,'
'),
|
||||||
|
'EOF')">
|
||||||
<xsl:call-template name="comment-test">
|
<xsl:call-template name="comment-test">
|
||||||
<xsl:with-param name="instructions"
|
<xsl:with-param name="instructions"
|
||||||
select="substring-after($instructions,'
')"/>
|
select="substring-after($instructions,'
')"/>
|
||||||
|
<xsl:with-param name="eof-seen" select="not($eof-seen)"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:call-template name="comment-test">
|
||||||
|
<xsl:with-param name="instructions"
|
||||||
|
select="substring-after($instructions,'
')"/>
|
||||||
|
<xsl:with-param name="eof-seen" select="$eof-seen"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:if test="$testsuite = '0' or
|
<xsl:if test="$testsuite = '0' or
|
||||||
$testsuite = '1' and
|
$testsuite = '1' and
|
||||||
|
@ -1108,21 +1123,28 @@ LOGLEVEL="</xsl:text>
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="contains(string(), 'make -k')">
|
<xsl:when test="contains(string(), 'make -k')">
|
||||||
<xsl:value-of select="$instructions"/>
|
<xsl:value-of select="$instructions"/>
|
||||||
<xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
<xsl:if test="not($eof-seen)">
|
||||||
|
<xsl:text> >> $TEST_LOG 2>&1 || true</xsl:text>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:text>
</xsl:text>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:when test="contains($instructions, 'make')">
|
<xsl:when test="contains($instructions, 'make')">
|
||||||
<xsl:value-of select="substring-before($instructions, 'make')"/>
|
<xsl:value-of select="substring-before($instructions, 'make')"/>
|
||||||
<xsl:text>make -k</xsl:text>
|
<xsl:text>make -k</xsl:text>
|
||||||
<xsl:value-of select="substring-after($instructions, 'make')"/>
|
<xsl:value-of select="substring-after($instructions, 'make')"/>
|
||||||
<xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
<xsl:if test="not($eof-seen)">
|
||||||
|
<xsl:text> >> $TEST_LOG 2>&1 || true</xsl:text>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:text>
</xsl:text>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:value-of select="$instructions"/>
|
<xsl:value-of select="$instructions"/>
|
||||||
<xsl:if
|
<xsl:if
|
||||||
test="not(contains($instructions, '>>')) and
|
test="not(contains($instructions, '>>')) and
|
||||||
|
not($eof-seen) and
|
||||||
substring($instructions,
|
substring($instructions,
|
||||||
string-length($instructions)) != '\'">
|
string-length($instructions)) != '\'">
|
||||||
<xsl:text> >> $TEST_LOG 2>&1</xsl:text>
|
<xsl:text> >> $TEST_LOG 2>&1 || true</xsl:text>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<xsl:text>
</xsl:text>
|
<xsl:text>
</xsl:text>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
|
@ -1133,11 +1155,15 @@ LOGLEVEL="</xsl:text>
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="contains($instructions, 'make -k')">
|
<xsl:when test="contains($instructions, 'make -k')">
|
||||||
<xsl:value-of select="$instructions"/>
|
<xsl:value-of select="$instructions"/>
|
||||||
<xsl:text> >> $TEST_LOG 2>&1 || true
</xsl:text>
|
<xsl:if test="not($eof-seen)">
|
||||||
|
<xsl:text> >> $TEST_LOG 2>&1 || true</xsl:text>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:text>
</xsl:text>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:value-of select="$instructions"/>
|
<xsl:value-of select="$instructions"/>
|
||||||
<xsl:if test="not(contains($instructions, '>>')) and
|
<xsl:if test="not(contains($instructions, '>>')) and
|
||||||
|
not($eof-seen) and
|
||||||
substring($instructions,
|
substring($instructions,
|
||||||
string-length($instructions)) != '\'">
|
string-length($instructions)) != '\'">
|
||||||
<xsl:text> >> $TEST_LOG 2>&1</xsl:text>
|
<xsl:text> >> $TEST_LOG 2>&1</xsl:text>
|
||||||
|
|
Reference in a new issue