Always generate test instructions, and comment unwanted ones out.

Fixes ticket #1695, also for CLFS...
This commit is contained in:
Pierre Labastie 2018-01-07 21:22:46 +00:00
parent 1d5f3e309f
commit 489bdc21d1

View file

@ -137,24 +137,25 @@
<xsl:template match="para/userinput"> <xsl:template match="para/userinput">
<xsl:if test="(contains(string(),'test') or <xsl:if test="(contains(string(),'test') or
contains(string(),'check')) and contains(string(),'check')) and
($testsuite = '2' or $testsuite = '3')"> not($testsuite = '2' or $testsuite = '3')">
<xsl:choose> <xsl:text># </xsl:text>
<xsl:when test="$bomb-testsuite = 'n'">
<xsl:value-of select="substring-before(string(),'make')"/>
<xsl:text>make -k</xsl:text>
<xsl:value-of select="substring-after(string(),'make')"/>
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1</xsl:text>
<xsl:if test="contains(string(),' -k ')">
<xsl:text> || true</xsl:text>
</xsl:if>
<xsl:text>&#xA;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:if> </xsl:if>
<xsl:choose>
<xsl:when test="$bomb-testsuite = 'n'">
<xsl:value-of select="substring-before(string(),'make')"/>
<xsl:text>make -k</xsl:text>
<xsl:value-of select="substring-after(string(),'make')"/>
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1</xsl:text>
<xsl:if test="contains(string(),' -k ')">
<xsl:text> || true</xsl:text>
</xsl:if>
<xsl:text>&#xA;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template> </xsl:template>
<xsl:template match="userinput" mode="screen"> <xsl:template match="userinput" mode="screen">
@ -190,96 +191,95 @@
<!-- No interactive commands are needed if the .config file is the proper one --> <!-- No interactive commands are needed if the .config file is the proper one -->
<xsl:when test="contains(string(),'menuconfig')"/> <xsl:when test="contains(string(),'menuconfig')"/>
<!-- test instructions --> <!-- test instructions -->
<xsl:when test="@remap = 'test'"> <xsl:when test="@remap = 'test'">
<xsl:choose> <xsl:if test="not(ancestor::note[@os='a00'] and $method='chroot')">
<!-- Avoid executing the note before perl tests while in 'chroot' --> <!-- Avoid executing the note before perl tests while in 'chroot' -->
<xsl:when test="ancestor::note[@os='a00'] and $method='chroot'"/> <xsl:if test="
<xsl:when test="$testsuite = '0'"/> $testsuite = '0' or
<xsl:when test= $testsuite = '1' and
"$testsuite = '1' and not(ancestor::sect1[@id='ch-system-gcc']) and
not(ancestor::sect1[@id='ch-system-gcc']) and not(ancestor::sect1[contains(@id,'ch-system-eglibc')]) and
not(ancestor::sect1[contains(@id,'ch-system-eglibc')]) and not(ancestor::sect1[contains(@id,'ch-system-glibc')]) and
not(ancestor::sect1[contains(@id,'ch-system-glibc')]) and not(ancestor::sect1[contains(@id,'ch-system-gmp')]) and
not(ancestor::sect1[contains(@id,'ch-system-gmp')]) and not(ancestor::sect1[contains(@id,'ch-system-mpfr')]) and
not(ancestor::sect1[contains(@id,'ch-system-mpfr')]) and not(ancestor::sect1[contains(@id,'ch-system-mpc')]) and
not(ancestor::sect1[contains(@id,'ch-system-mpc')]) and not(ancestor::sect1[contains(@id,'ch-system-ppl')]) and
not(ancestor::sect1[contains(@id,'ch-system-ppl')]) and not(ancestor::sect1[contains(@id,'ch-system-isl')]) and
not(ancestor::sect1[contains(@id,'ch-system-isl')]) and not(ancestor::sect1[contains(@id,'ch-system-cloog')]) and
not(ancestor::sect1[contains(@id,'ch-system-cloog')]) and not(ancestor::sect1[contains(@id,'ch-system-cloog-ppl')]) and
not(ancestor::sect1[contains(@id,'ch-system-cloog-ppl')]) and not(ancestor::sect1[@id='ch-system-binutils'])">
not(ancestor::sect1[@id='ch-system-binutils'])"/> <xsl:text># </xsl:text>
<xsl:otherwise> </xsl:if>
<xsl:choose> <xsl:choose>
<xsl:when test="$bomb-testsuite = 'n'"> <xsl:when test="$bomb-testsuite = 'n'">
<xsl:choose> <xsl:choose>
<!-- special case for (e)glibc --> <!-- special case for (e)glibc -->
<xsl:when test="contains(string(), 'glibc-check-log')"> <xsl:when test="contains(string(), 'glibc-check-log')">
<xsl:value-of <xsl:value-of
select="substring-before(string(),'2&gt;&amp;1')"/> select="substring-before(string(),'2&gt;&amp;1')"/>
<xsl:text>&gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text> <xsl:text>&gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
</xsl:when> </xsl:when>
<!-- special case for procps-ng --> <!-- special case for procps-ng -->
<xsl:when test="contains(string(), 'pushd')"> <xsl:when test="contains(string(), 'pushd')">
<xsl:text>{ </xsl:text> <xsl:text>{ </xsl:text>
<xsl:apply-templates/> <xsl:apply-templates/>
<xsl:text>; } &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text> <xsl:text>; } &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
</xsl:when> </xsl:when>
<xsl:when test="contains(string(), 'make -k')"> <xsl:when test="contains(string(), 'make -k')">
<xsl:apply-templates/> <xsl:apply-templates/>
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text> <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
</xsl:when> </xsl:when>
<xsl:when test="contains(string(), 'make')"> <xsl:when test="contains(string(), 'make')">
<xsl:value-of select="substring-before(string(),'make')"/> <xsl:value-of select="substring-before(string(),'make')"/>
<xsl:text>make -k</xsl:text> <xsl:text>make -k</xsl:text>
<xsl:value-of select="substring-after(string(),'make')"/> <xsl:value-of select="substring-after(string(),'make')"/>
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text> <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:apply-templates/> <xsl:apply-templates/>
<xsl:if test="not(contains(string(), '&gt;&gt;'))"> <xsl:if test="not(contains(string(), '&gt;&gt;'))">
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1</xsl:text> <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1</xsl:text>
</xsl:if> </xsl:if>
<xsl:text>&#xA;</xsl:text> <xsl:text>&#xA;</xsl:text>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<!-- bomb-testsuite != 'n'--> <!-- bomb-testsuite != 'n'-->
<xsl:choose> <xsl:choose>
<!-- special case for (e)glibc --> <!-- special case for (e)glibc -->
<xsl:when test="contains(string(), 'glibc-check-log')"> <xsl:when test="contains(string(), 'glibc-check-log')">
<xsl:value-of <xsl:value-of
select="substring-before(string(),'2&gt;&amp;1')"/> select="substring-before(string(),'2&gt;&amp;1')"/>
<xsl:text>&gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text> <xsl:text>&gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
</xsl:when> </xsl:when>
<!-- special case for gmp --> <!-- special case for gmp -->
<xsl:when test="contains(string(), 'tee gmp-check-log')"> <xsl:when test="contains(string(), 'tee gmp-check-log')">
<xsl:text>(</xsl:text> <xsl:text>(</xsl:text>
<xsl:apply-templates/> <xsl:apply-templates/>
<xsl:text>&gt;&gt; $TEST_LOG 2&gt;&amp;1 &amp;&amp; exit $PIPESTATUS)&#xA;</xsl:text> <xsl:text>&gt;&gt; $TEST_LOG 2&gt;&amp;1 &amp;&amp; exit $PIPESTATUS)&#xA;</xsl:text>
</xsl:when> </xsl:when>
<!-- special case for procps-ng --> <!-- special case for procps-ng -->
<xsl:when test="contains(string(), 'pushd')"> <xsl:when test="contains(string(), 'pushd')">
<xsl:text>{ </xsl:text> <xsl:text>{ </xsl:text>
<xsl:apply-templates/> <xsl:apply-templates/>
<xsl:text>; } &gt;&gt; $TEST_LOG 2&gt;&amp;1&#xA;</xsl:text> <xsl:text>; } &gt;&gt; $TEST_LOG 2&gt;&amp;1&#xA;</xsl:text>
</xsl:when> </xsl:when>
<xsl:when test="contains(string(), 'make -k')"> <xsl:when test="contains(string(), 'make -k')">
<xsl:apply-templates/> <xsl:apply-templates/>
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text> <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:apply-templates/> <xsl:apply-templates/>
<xsl:if test="not(contains(string(), '&gt;&gt;'))"> <xsl:if test="not(contains(string(), '&gt;&gt;'))">
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1</xsl:text> <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1</xsl:text>
</xsl:if> </xsl:if>
<xsl:text>&#xA;</xsl:text> <xsl:text>&#xA;</xsl:text>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:otherwise> </xsl:if><!-- avoid executing note before perl tests -->
</xsl:choose>
</xsl:when> </xsl:when>
<!-- End of test instructions --> <!-- End of test instructions -->