CLFS xsl update proposal

William Harrington kb0iic at berzerkula.org
Wed Feb 12 20:53:20 PST 2014


Greetings,

Finally got around to looking through clfs.xsl and adding support for  
the remap=test so extraction of the commands required for the test  
suites are  properly included with the output using our current xml.   
I followed what was in LFS/lfs.xsl as  guide and changed some of the  
lines and added some lines which are particular to CLFS only. Such as  
isl, cloog, ppl (for older books).  I didn't add an entry for cloog- 
ppl, yet ( only valid for CLFS books up to version 1.2.0):

+                          not(ancestor::sect1[@id='ch-system-cloog- 
ppl']) and

I changed Config.in to output different wording for the Final system  
test suites for TST_1 when not using the CLFS_BOOK and when using the  
CLFS_BOOK. It is trivial, really not needed, but if too much gets put  
in one line, it looks bad when in the menu portion when selecting the  
testsuite options.

I think I have done this properly, let me know if you see something  
that is improper.

Index: CLFS/clfs.xsl
===================================================================
--- CLFS/clfs.xsl       (revision 3782)
+++ CLFS/clfs.xsl       (working copy)
@@ -184,41 +184,99 @@
        </xsl:when>
        <!-- No interactive commands are needed if the .config file is  
the proper one -->
        <xsl:when test="contains(string(),'menuconfig')"/>
-      <!-- The Coreutils and Module-Init-Tools test suites are  
optional -->
-      <xsl:when test="(ancestor::sect1[@id='ch-system-coreutils'] or
-                ancestor::sect1[@id='ch-system-module-init-tools']) and
-                (contains(string(),'check') or
-                contains(string(),'dummy'))">
+<!-- test instructions -->
+       <xsl:when test="@remap = 'test'">
          <xsl:choose>
-          <xsl:when test="$testsuite = '0' or $testsuite = '1'"/>
+          <xsl:when test="$testsuite = '0'"/>
+          <xsl:when test="$testsuite = '1' and
+                          not(ancestor::sect1[@id='ch-system-gcc']) and
+                          not(ancestor::sect1[@id='ch-system- 
eglibc']) and
+                          not(ancestor::sect1[@id='ch-system-gmp']) and
+                          not(ancestor::sect1[@id='ch-system-mpfr'])  
and
+                          not(ancestor::sect1[@id='ch-system-mpc']) and
+                          not(ancestor::sect1[@id='ch-system-ppl']) and
+                          not(ancestor::sect1[@id='ch-system-isl']) and
+                          not(ancestor::sect1[@id='ch-system-cloog'])  
and
+                          not(ancestor::sect1[@id='ch-system- 
binutils'])"/>
+          <xsl:when test="$testsuite = '2' and
+                          ancestor::chapter[@id='ch-temp-system']"/>
            <xsl:otherwise>
-            <xsl:if test="not(contains(string(),'check'))">
-              <xsl:apply-templates/>
-              <xsl:text>&#xA;</xsl:text>
-            </xsl:if>
-            <xsl:if test="contains(string(),'check')">
-              <xsl:choose>
-                <xsl:when test="$bomb-testsuite = 'n'">
-                  <xsl:value-of select="substring- 
before(string(),'check')"/>
-                  <xsl:text>-k check</xsl:text>
-                  <xsl:value-of select="substring- 
after(string(),'check')"/>
-                  <xsl:text> >> $TEST_LOG 2>&1 ||  
true&#xA;</xsl:text>
-                </xsl:when>
-                <xsl:otherwise>
-                  <xsl:apply-templates/>
-                  <xsl:text> >> $TEST_LOG 2>&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:choose>
+              <xsl:when test="$bomb-testsuite = 'n'">
+                <xsl:choose>
+                  <!-- special case for eglibc -->
+                  <xsl:when test="contains(string(), 'eglibc-check- 
log')">
+                    <xsl:value-of
+                       select="substring-before(string(),'2>& 
1')"/>
+                    <xsl:text>>> $TEST_LOG 2>&1 ||  
true&#xA;</xsl:text>
+                  </xsl:when>
+                  <!-- special case for procps-ng -->
+                  <xsl:when test="contains(string(), 'pushd')">
+                    <xsl:text>{ </xsl:text>
+                    <xsl:apply-templates/>
+                    <xsl:text>; } >> $TEST_LOG 2>&1 ||  
true&#xA;</xsl:text>
+                  </xsl:when>
+                  <xsl:when test="contains(string(), 'make -k')">
+                    <xsl:apply-templates/>
+                    <xsl:text> >> $TEST_LOG 2>&1 ||  
true&#xA;</xsl:text>
+                  </xsl:when>
+                  <xsl:when test="contains(string(), 'make')">
+                    <xsl:value-of select="substring- 
before(string(),'make')"/>
+                    <xsl:text>make -k</xsl:text>
+                    <xsl:value-of select="substring- 
after(string(),'make')"/>
+                    <xsl:text> >> $TEST_LOG 2>&1 ||  
true&#xA;</xsl:text>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:apply-templates/>
+                    <xsl:if test="not(contains(string(), '>>'))">
+                      <xsl:text> >> $TEST_LOG 2>&1</ 
xsl:text>
+                    </xsl:if>
+                    <xsl:text>&#xA;</xsl:text>
+                  </xsl:otherwise>
+                </xsl:choose>
+              </xsl:when>
+              <xsl:otherwise>
+                <!-- bomb-testsuite != 'n'-->
+                <xsl:choose>
+                  <!-- special case for eglibc -->
+                  <xsl:when test="contains(string(), 'eglibc-check- 
log')">
+                    <xsl:value-of
+                       select="substring-before(string(),'2>& 
1')"/>
+                    <xsl:text>>> $TEST_LOG 2>&1 ||  
true&#xA;</xsl:text>
+                  </xsl:when>
+                  <!-- special case for gmp -->
+                  <xsl:when test="contains(string(), 'tee gmp-check- 
log')">
+                    <xsl:text>(</xsl:text>
+                    <xsl:apply-templates/>
+                    <xsl:text>>> $TEST_LOG 2>&1  
&& exit $PIPESTATUS)&#xA;</xsl:text>
+                  </xsl:when>
+                  <!-- special case for procps-ng -->
+                  <xsl:when test="contains(string(), 'pushd')">
+                    <xsl:text>{ </xsl:text>
+                    <xsl:apply-templates/>
+                    <xsl:text>; } >> $TEST_LOG 2>& 
1&#xA;</xsl:text>
+                  </xsl:when>
+                 <xsl:when test="contains(string(), 'make -k')">
+                   <xsl:apply-templates/>
+                   <xsl:text> >> $TEST_LOG 2>&1 ||  
true&#xA;</xsl:text>
+                 </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:apply-templates/>
+                    <xsl:if test="not(contains(string(), '>>'))">
+                      <xsl:text> >> $TEST_LOG 2>&1</ 
xsl:text>
+                    </xsl:if>
+                    <xsl:text>&#xA;</xsl:text>
+                  </xsl:otherwise>
+                </xsl:choose>
+              </xsl:otherwise>
+            </xsl:choose>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:when>
+<!-- End of test instructions -->
+
        <!-- Fixing toolchain test suites run XXX more to fix -->
-      <xsl:when test="contains(string(),'glibc-check-log')">
+      <xsl:when test="contains(string(),'eglibc-check-log')">
          <xsl:choose>
            <xsl:when test="$testsuite != '0'">
              <xsl:value-of select="substring- 
before(string(),'2>')"/>

Index: Config.in
===================================================================
--- Config.in   (revision 3782)
+++ Config.in   (working copy)
@@ -778,8 +778,11 @@
                 default TST_1

                 config  TST_1
-                       bool    "Only final system Glibc, GMP, MPFR,  
GCC and Binutils testsuites"
+                       bool    "Only final system Eglibc, GMP, MPFR,  
MPC, ISL, ClooG, GCC and Binutils testsuites" if BOOK_CLFS && ! 
BOOK_CLFS2 && !BOOK_CLFS3

+               config  TST_1
+                       bool    "Only final system Glibc, GMP, MPFR,  
GCC and Binutils testsuites" if !BOOK_CLFS && !BOOK_CLFS2 && !BOOK_CLFS3
+
                 config  TST_2
                         bool    "All final system testsuites"




I tested the various outputs with no testsuites, with only critical  
testsuites in final system and all final system testsuites,m and the  
generated clfs-commands/final-system/* had the proper content.

This will make life easier as I don't have to edit the generated clfs- 
commands/final-ssytem/* files which always had the test commands  
dumped when they shouldn't have been dumped. Perl would always dump  
and run tests, some others. Now I don' tneed to edit during a build  
when I don't want testsuites ran.

Sincerely,

WIlliam Harrington



More information about the alfs-discuss mailing list