Changeset 6caa5b8


Ignore:
Timestamp:
05/31/2020 07:31:32 AM (4 years ago)
Author:
Pierre Labastie <pierre@…>
Branches:
ablfs-more, legacy, trunk
Children:
7e0a1b8
Parents:
9728b23
Message:

Allows having << EOF in tests, and not generating >> $TEST_LOG... until the
matching EOF is found.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LFS/lfs.xsl

    r9728b23 r6caa5b8  
    10811081  <xsl:template name="comment-test">
    10821082    <xsl:param name="instructions" select="''"/>
     1083    <xsl:param name="eof-seen" select="false()"/>
    10831084    <xsl:choose>
    10841085      <xsl:when test="contains($instructions,'&#xA;')">
     
    10861087          <xsl:with-param name="instructions"
    10871088                          select="substring-before($instructions,'&#xA;')"/>
    1088         </xsl:call-template>
    1089         <xsl:call-template name="comment-test">
    1090           <xsl:with-param name="instructions"
    1091                           select="substring-after($instructions,'&#xA;')"/>
    1092         </xsl:call-template>
     1089          <xsl:with-param name="eof-seen" select="$eof-seen"/>
     1090        </xsl:call-template>
     1091        <xsl:choose>
     1092          <xsl:when test="contains(substring-before($instructions,'&#xA;'),
     1093                                   'EOF')">
     1094            <xsl:call-template name="comment-test">
     1095              <xsl:with-param name="instructions"
     1096                              select="substring-after($instructions,'&#xA;')"/>
     1097              <xsl:with-param name="eof-seen" select="not($eof-seen)"/>
     1098            </xsl:call-template>
     1099          </xsl:when>
     1100          <xsl:otherwise>
     1101            <xsl:call-template name="comment-test">
     1102              <xsl:with-param name="instructions"
     1103                              select="substring-after($instructions,'&#xA;')"/>
     1104              <xsl:with-param name="eof-seen" select="$eof-seen"/>
     1105            </xsl:call-template>
     1106          </xsl:otherwise>
     1107        </xsl:choose>
    10931108      </xsl:when>
    10941109      <xsl:otherwise>
     
    11091124              <xsl:when test="contains(string(), 'make -k')">
    11101125                <xsl:value-of select="$instructions"/>
    1111                 <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
     1126                <xsl:if test="not($eof-seen)">
     1127                  <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true</xsl:text>
     1128                </xsl:if>
     1129                <xsl:text>&#xA;</xsl:text>
    11121130              </xsl:when>
    11131131              <xsl:when test="contains($instructions, 'make')">
     
    11151133                <xsl:text>make -k</xsl:text>
    11161134                <xsl:value-of select="substring-after($instructions, 'make')"/>
    1117                 <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
     1135                <xsl:if test="not($eof-seen)">
     1136                  <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true</xsl:text>
     1137                </xsl:if>
     1138                <xsl:text>&#xA;</xsl:text>
    11181139              </xsl:when>
    11191140              <xsl:otherwise>
     
    11211142                <xsl:if
    11221143                  test="not(contains($instructions, '&gt;&gt;')) and
     1144                        not($eof-seen) and
    11231145                        substring($instructions,
    11241146                                  string-length($instructions)) != '\'">
    1125                   <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1</xsl:text>
     1147                  <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true</xsl:text>
    11261148                </xsl:if>
    11271149                <xsl:text>&#xA;</xsl:text>
     
    11341156              <xsl:when test="contains($instructions, 'make -k')">
    11351157                <xsl:value-of select="$instructions"/>
    1136                 <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
     1158                <xsl:if test="not($eof-seen)">
     1159                  <xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true</xsl:text>
     1160                </xsl:if>
     1161                <xsl:text>&#xA;</xsl:text>
    11371162              </xsl:when>
    11381163              <xsl:otherwise>
    11391164                <xsl:value-of select="$instructions"/>
    11401165                <xsl:if test="not(contains($instructions, '&gt;&gt;')) and
     1166                        not($eof-seen) and
    11411167                        substring($instructions,
    11421168                                  string-length($instructions)) != '\'">
Note: See TracChangeset for help on using the changeset viewer.