ソースを参照

xsl_reports produce one html file per test failure (as opposite to one big html file with all failures).
It should significantly improve the download speed.


[SVN r22381]

Misha Bergal 22 年 前
コミット
95c858c92e

+ 6 - 1
tools/regression/xsl_reports/report.py

@@ -194,8 +194,13 @@ def make_result_pages( test_results_file
                  )
 
     links = os.path.join( output_dir, "links.html"  )
+    
+    test_output_dir  = os.path.join( output_dir, "output"  )
+    if not os.path.exists(  test_output_dir ):
+        os.makedirs( test_output_dir )
+        
     if "l" in reports:        
-        log( "    Making -links file..." )
+        log( "    Making test output files..." )
         xslt_proc( extended_test_results
                    , xsl_path( "links_page.xsl" )
                    , links

+ 13 - 0
tools/regression/xsl_reports/xsl/common.xsl

@@ -20,6 +20,8 @@
   extension-element-prefixes="func"
   version="1.0">
 
+  <xsl:variable name="output_directory" select="'output'"/>
+
   <xsl:template name="get_toolsets">
     <xsl:param name="toolsets"/>
     <xsl:param name="required-toolsets"/>
@@ -58,6 +60,16 @@
       <func:result select="$explicit_markup//library[ @name = $library ]/mark-unusable[ toolset/@name = $toolset or toolset/@name='*' ]"/>
   </func:function>
 
+  <func:function name="meta:encode_path">
+      <xsl:param name="path"/>
+      <func:result select="translate( translate( $path, '/', '-' ), './', '-' )"/>
+  </func:function>
+
+  <func:function name="meta:output_file_path">
+      <xsl:param name="path"/>
+      <func:result select="concat( $output_directory, '/', meta:encode_path( $path ), '.html' )"/>
+  </func:function>
+
   <xsl:template name="show_notes">
       <xsl:param name="explicit_markup"/>
       <xsl:param name="notes"/>
@@ -129,4 +141,5 @@
   </xsl:template>
 
 
+
 </xsl:stylesheet>

+ 92 - 75
tools/regression/xsl_reports/xsl/links_page.xsl

@@ -16,7 +16,8 @@
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
   xmlns:func="http://exslt.org/functions"
   xmlns:meta="http://www.meta-comm.com"
-  extension-element-prefixes="func"
+  xmlns:exsl="http://exslt.org/common"
+  extension-element-prefixes="func exsl"
   version="1.0">
 
   <xsl:import href="common.xsl"/>
@@ -66,6 +67,8 @@
               <td class="header-item-content">
                 Provides notes,  compiler, linker and run output of the
                 regression tests. 
+                
+                This file is not being used any more.
               </td>
             </tr>
           </table>
@@ -83,82 +86,96 @@
 
 
   <xsl:template match="test-log">
-    <div>
-      <xsl:choose>
-        <xsl:when test="@test-name != ''">
-          <xsl:variable name="test-anchor">
-            <xsl:value-of select="concat( @library, '-', @test-name, '-', @toolset )"/>
-          </xsl:variable>
-          <div class="log-test-title">
-            <a name="{$test-anchor}"><xsl:value-of select="concat( @library, ' - ', @test-name, ' / ', @toolset )"/></a>
+    <xsl:variable name="document_path" select="meta:output_file_path( @target-directory )"/>
+
+    <xsl:message>Writing document <xsl:value-of select="$document_path"/></xsl:message>
+
+    <exsl:document href="{$document_path}" 
+      method="html" 
+      doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" 
+      encoding="utf-8"
+      indent="yes">
+
+      <html>
+        <xsl:variable name="component">
+          <xsl:choose>
+            <xsl:when test="@test-name != ''">
+              <div class="log-test-title">
+                <xsl:value-of select="concat( @library, ' - ', @test-name, ' / ', @toolset )"/>
+              </div>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="@target-dir"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:variable>
+        
+        <head>
+          <link rel="stylesheet" type="text/css" href="../master.css" title="master" />
+          <title>Boost regression - test run output: <xsl:value-of select="$component"/></title>
+        </head>
+
+        <body>
+          <div>
+            <div class="log-test-title">
+              Boost regression - test run output: <xsl:value-of select="$component"/>
           </div>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:variable name="test-anchor">
-            <xsl:value-of select="meta:path-to-anchor( @target-directory )"/>
-          </xsl:variable>
-          <div class="log-test-title">
-            <a name="{$test-anchor}"><xsl:value-of select="@target-directory"/></a>
-          </div>
-        </xsl:otherwise>
-      </xsl:choose>
-
-    <xsl:if test="notes/note">
-      <p>
-        <div class="notes-title">Notes</div>
-        <xsl:call-template name="show_notes">
-            <xsl:with-param name="notes" select="notes/note"/>
-            <xsl:with-param name="explicit_markup" select="$explicit_markup"/>
-        </xsl:call-template>
-      </p>
-    </xsl:if>
-
-    <xsl:if test="compile">
-      <p>
-        <div class="log-compiler-output-title">Compiler&#160;output:</div>
-        <pre>
-          <xsl:copy-of select="compile/node()"/>
-        </pre>
-      </p>
-    </xsl:if>
-
-    <xsl:if test="link">
-      <p>
-        <div class="log-linker-output-title">Linker&#160;output:</div>
-        <pre>
-          <xsl:copy-of select="link/node()"/>
-        </pre>
-      </p>
-    </xsl:if>
-
-    <xsl:if test="lib">
-      <p>
-        <div class="log-linker-output-title">Lib &#160;output:</div>
-        <p>
-          See <a href="#{meta:path-to-anchor( lib/node() )}">
-            <xsl:copy-of select="lib/node()"/>
-          </a>
-        </p>
-      </p>
-    </xsl:if>
-
-    <xsl:if test="run">
-      <p>
-        <div class="log-run-output-title">Run&#160;output:</div>
-        <pre>
-          <xsl:copy-of select="run/node()"/>
-        </pre>
-      </p>
-    </xsl:if>
-
-    </div>
-
+        
+
+          <xsl:if test="notes/note">
+            <p>
+              <div class="notes-title">Notes</div>
+              <xsl:call-template name="show_notes">
+                <xsl:with-param name="notes" select="notes/note"/>
+                <xsl:with-param name="explicit_markup" select="$explicit_markup"/>
+              </xsl:call-template>
+            </p>
+          </xsl:if>
+          
+          <xsl:if test="compile">
+            <p>
+              <div class="log-compiler-output-title">Compiler output:</div>
+              <pre>
+                <xsl:copy-of select="compile/node()"/>
+              </pre>
+            </p>
+          </xsl:if>
+          
+          <xsl:if test="link">
+            <p>
+              <div class="log-linker-output-title">Linker output:</div>
+              <pre>
+                <xsl:copy-of select="link/node()"/>
+              </pre>
+            </p>
+          </xsl:if>
+
+          <xsl:if test="lib">
+            <p>
+              <div class="log-linker-output-title">Lib output:</div>
+              <p>
+                See <a href="#{meta:encode_path( lib/node() )}">
+                <xsl:copy-of select="lib/node()"/>
+                </a>
+              </p>
+            </p>
+          </xsl:if>
+          
+          <xsl:if test="run">
+            <p>
+              <div class="log-run-output-title">Run output:</div>
+              <pre>
+                <xsl:copy-of select="run/node()"/>
+              </pre>
+            </p>
+          </xsl:if>
+          
+        </div>
+      </body>
+    </html>
+  </exsl:document>  
   </xsl:template>
 
-  <func:function name="meta:path-to-anchor">
-      <xsl:param name="path"/>
-      <func:result select="translate( $path, '/', '-' )"/>
-  </func:function>
-  
+
 
 </xsl:stylesheet>

+ 4 - 2
tools/regression/xsl_reports/xsl/result_page.xsl

@@ -38,6 +38,8 @@
   <xsl:param name="expected_results_file"/>
   <xsl:param name="explicit_markup_file"/>
 
+  <xsl:variable name="output_directory" select="'output'"/>
+
   <!-- the author-specified expected test results -->
   <xsl:variable name="explicit_markup" select="document( $explicit_markup_file )"/>
   <xsl:variable name="expected_results" select="document( $expected_results_file )" />
@@ -554,13 +556,13 @@
           <xsl:when test="$mode='user'">
             <xsl:call-template name="insert_cell_user">
               <xsl:with-param name="test_log" select="$test_result_for_toolset"/>
-              <xsl:with-param name="log_link" select="concat( $links_file, '#', $library, '-', $test_name, '-', $toolset )"/>
+              <xsl:with-param name="log_link" select="meta:output_file_path( $test_result_for_toolset/@target-directory )"/>
             </xsl:call-template>
           </xsl:when>
           <xsl:when test="$mode='developer'">
             <xsl:call-template name="insert_cell_developer">
               <xsl:with-param name="test_log" select="$test_result_for_toolset"/>
-              <xsl:with-param name="log_link" select="concat( $links_file, '#',  $library, '-', $test_name, '-', $toolset )"/>
+              <xsl:with-param name="log_link" select="meta:output_file_path( $test_result_for_toolset/@target-directory )"/>
             </xsl:call-template>
           </xsl:when>
         </xsl:choose>

粤ICP备19079148号