Просмотр исходного кода

1. Added issues report.

2. If detailed report has only one library the TOC, TOC links and
   library name are skipped.

3. Factored out some common functionality from some of the
   reports (is_unusable, show_notes, show_note).


[SVN r21406]
Misha Bergal 22 лет назад
Родитель
Сommit
7973af5efa

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

@@ -15,6 +15,9 @@
 
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:exsl="http://exslt.org/common"
+  xmlns:func="http://exslt.org/functions"
+  xmlns:meta="http://www.meta-comm.com"
+  extension-element-prefixes="func"
   version="1.0">
 
   <xsl:template name="get_toolsets">
@@ -47,6 +50,85 @@
     
   </xsl:template>
 
+  <func:function name="meta:is_unusable">
+      <xsl:param name="explicit_markup"/>
+      <xsl:param name="library"/>
+      <xsl:param name="toolset"/>
+      
+      <func:result select="$explicit_markup//library[ @name = $library ]/mark-unusable[ toolset/@name = $toolset or toolset/@name='*' ]"/>
+  </func:function>
+
+  <xsl:template name="show_notes">
+      <xsl:param name="explicit_markup"/>
+      <xsl:param name="notes"/>
+        <div class="log-notes">
+          <xsl:for-each select="notes/note">
+            <div>
+              <xsl:if test="@refid">
+                <xsl:variable name="refid" select="@refid"/>
+                <xsl:call-template name="show_note">
+                    <xsl:with-param name="note" select="."/>
+                    <xsl:with-param name="reference" select="$explicit_markup//note[ $refid = @id ]"/>
+                </xsl:call-template>
+              </xsl:if>
+            </div>
+          </xsl:for-each>
+        </div>
+  </xsl:template>
+
+  <xsl:template name="show_note">
+      <xsl:param name="note"/>
+      <xsl:param name="reference"/>
+      <div class="note">
+          <xsl:variable name="author">
+              <xsl:choose>
+                  <xsl:when test="$note/@author">
+                      <xsl:value-of select="$note/@author"/>
+                  </xsl:when>
+                  <xsl:when test="$reference">
+                      <xsl:value-of select="$reference/@author"/>                               
+                  </xsl:when>
+                  <xsl:otherwise>
+                      <xsl:text/>
+                  </xsl:otherwise>
+              </xsl:choose>
+          </xsl:variable>
+
+          <xsl:variable name="date">
+              <xsl:choose>
+                  <xsl:when test="$note/@date">
+                      <xsl:value-of select="$note/@date"/>
+                  </xsl:when>
+                  <xsl:when test="$reference">
+                      <xsl:value-of select="$reference/@date"/>                      
+                  </xsl:when>
+                  <xsl:otherwise>
+                      <xsl:text/>
+                  </xsl:otherwise>
+              </xsl:choose>
+          </xsl:variable>
+
+      <span class="note-header">
+          <xsl:choose>
+              <xsl:when test="$author != '' and $date != ''">
+                  [&#160;<xsl:value-of select="$author"/>&#160;<xsl:value-of select="$date"/>&#160;]
+              </xsl:when>
+              <xsl:when test="$author != ''">
+                  [&#160;<xsl:value-of select="$author"/>&#160;]                        
+              </xsl:when>
+              <xsl:when test="$date != ''">
+                  [&#160;<xsl:value-of select="$date"/>&#160;]                        
+              </xsl:when>
+          </xsl:choose>
+      </span>
+
+      <xsl:if test="$reference">
+          <xsl:copy-of select="$reference/node()"/>                
+      </xsl:if>
+      <xsl:copy-of select="$note/node()"/>      
+
+      </div>
+  </xsl:template>
 
 
 </xsl:stylesheet>

+ 133 - 0
tools/regression/xsl_reports/xsl/issues_page.xsl

@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ (C) Copyright MetaCommunications, Inc. 2003.
+
+ Permission to use, copy, modify, distribute and sell this software
+ and its documentation for any purpose is hereby granted without fee, 
+ provided that the above copyright notice appears in all copies and 
+ that both the copyright notice and this permission notice appear in 
+ supporting documentation. No representations are made about the 
+ suitability of this software for any purpose. It is provided "as is" 
+ without express or implied warranty.
+
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:exsl="http://exslt.org/common"
+  xmlns:func="http://exslt.org/functions"
+  xmlns:meta="http://www.meta-comm.com"
+  xmlns:set="http://exslt.org/sets"
+  extension-element-prefixes="func"
+  version="1.0">
+
+  <xsl:import href="common.xsl"/>
+
+  <xsl:output method="html" 
+    doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" 
+    encoding="utf-8" 
+    indent="yes"
+    />
+
+
+  <xsl:param name="links_file"/>
+  <xsl:param name="mode"/>
+  <xsl:param name="source"/>
+  <xsl:param name="run_date"/>
+  <xsl:param name="comment_file"/>
+  <xsl:param name="expected_results_file"/>
+  <xsl:param name="explicit_markup_file"/>
+
+  <!-- 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 )" />
+ 
+  <!-- necessary indexes -->
+  <xsl:key 
+    name="test_name_key" 
+    match="test-log" 
+    use="concat( @library, '@', @test-name )"/>
+                  <xsl:key 
+                      name="a" 
+                      match="." 
+                      use="concat( @library, '@', @test-name )"/>
+
+  <xsl:key 
+    name="library_key" 
+    match="test-log" 
+    use="@library"/>
+  <xsl:key name="toolset_key" match="test-log" use="@toolset"/>
+
+  <!-- toolsets -->
+
+  <xsl:variable name="required_toolsets" select="$explicit_markup//mark-toolset[ @status='required' ]"/>
+  <xsl:variable name="required_toolset_names" select="$explicit_markup//mark-toolset[ @status='required' ]/@name"/>
+   <!-- libraries -->
+  <xsl:variable name="libraries" select="//test-log[ @library != '' and generate-id(.) = generate-id( key('library_key',@library)[1] )  ]/@library"/>
+
+  <xsl:variable name="unexpected_test_cases" select="//test-log[ @status='unexpected' and @result='fail' and @toolset = $required_toolset_names]"/>
+
+  <func:function name="meta:get_library_tests">
+      <xsl:param name="tests"/>
+      <xsl:param name="library"/>
+      
+      <xsl:variable name="a">                  
+          <xsl:for-each select="$tests[ @library=$library ]">
+              <xsl:sort select="@test-name" order="ascending"/>
+              <xsl:copy-of select="."/>
+          </xsl:for-each>
+      </xsl:variable>
+      <func:result select="exsl:node-set( $a )/*"/>
+  </func:function>
+
+
+  <xsl:template match="/">
+      <html>
+          <head>
+              <link rel="stylesheet" type="text/css" href="master.css" title="master" />
+              <title>Boost not resolved issues: <xsl:value-of select="$source"/></title>
+          </head>
+          <body>
+              <table>
+                  <xsl:for-each select="$libraries">
+                      <xsl:sort select="." order="ascending"/>
+                      <xsl:variable name="library" select="."/>
+                  
+                      <xsl:variable name="library_tests" select="meta:get_library_tests( $unexpected_test_cases, $library )"/>
+                      <xsl:if test="count( $library_tests ) > 0">
+                          <xsl:variable name="library_test_names" select="set:distinct( $library_tests/@test-name )"/>
+
+                          <tr>
+                              <td colspan="2">
+                                  <div class="library-name"><xsl:value-of select="$library"/></div>
+                              </td>
+                          </tr>
+                          
+                          <xsl:for-each select="$library_test_names">
+                              <xsl:sort select="." order="ascending"/>
+                              <xsl:variable name="test_name" select="."/>
+                              
+                              <xsl:variable name="unexpected_toolsets" select="$library_tests[ @test-name = $test_name and not (meta:is_unusable( $explicit_markup, $library, @toolset )) ]/@toolset"/>
+                              
+                              <xsl:if test="count( $unexpected_toolsets ) > 0">
+                                  <tr>
+                                      <td class="test-name">
+                                          <xsl:value-of select="$test_name"/>:
+                                      </td>
+                                      <td>
+                                          <xsl:for-each select="$unexpected_toolsets">
+                                              <xsl:sort select="." order="ascending"/>
+                                              <xsl:if test="position() > 1">,&#160;</xsl:if>
+                                              <xsl:value-of select="."/>
+                                          </xsl:for-each>
+                                      </td>
+                                  </tr>
+                                  </xsl:if>
+                              </xsl:for-each>
+                          </xsl:if>
+                      </xsl:for-each>
+              </table>
+          </body>
+      </html>
+  </xsl:template>
+</xsl:stylesheet>

+ 12 - 19
tools/regression/xsl_reports/xsl/links_page.xsl

@@ -15,18 +15,22 @@
 
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 
+  <xsl:import href="common.xsl"/>
+
   <xsl:output method="html" 
     doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" 
     encoding="utf-8" 
     indent="yes"
     />
 
+
+
   <xsl:param name="source"/>
   <xsl:param name="run_date"/>
   <xsl:param name="comment_file"/>
   <xsl:param name="explicit_markup_file"/>
 
-  <xsl:variable name="explicit-markup" select="document( $explicit_markup_file )"/>
+  <xsl:variable name="explicit_markup" select="document( $explicit_markup_file )"/>
 
   <xsl:template match="/">
     <html>
@@ -80,24 +84,11 @@
 
     <xsl:if test="notes/note">
       <p>
-        <div class="log-notes-title">Notes:</div>
-        <div class="log-notes">
-          <xsl:for-each select="notes/note">
-            <div>
-              <xsl:if test="@date">
-                <xsl:value-of select="@date"/><xsl:text> </xsl:text>
-              </xsl:if>
-              <xsl:if test="@author">
-                <xsl:value-of select="@author"/><xsl:text> </xsl:text>
-              </xsl:if>
-              <xsl:if test="@refid">
-                <xsl:variable name="refid" select="@refid"/>
-                <xsl:copy-of select="$explicit-markup//note[ $refid = @id ]/node()"/>
-              </xsl:if>
-              <xsl:copy-of select="node()"/>
-            </div>
-          </xsl:for-each>
-        </div>
+        <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>
 
@@ -140,4 +131,6 @@
     </div>
 
   </xsl:template>
+
+
 </xsl:stylesheet>

+ 13 - 3
tools/regression/xsl_reports/xsl/master.css

@@ -374,7 +374,12 @@ tr.detail-library-note
     {
     }
 
-span.detail-library-note-header
+div.note
+    {
+    padding: 3pt;
+    }
+
+span.note-header
     {
     font-weight: bold;
     }
@@ -388,18 +393,23 @@ div.log-test-title
     border-bottom: 1px solid black;
     }
 
-div.log-notes-title
+div.notes-title
     {
     font-weight: bold;
     background-color:#FFFFCC;
     }
 
-div.log-notes
+div.notes
     {
     padding: 3pt;
     background-color:#FFFFCC;
     }
 
+div.notes-title
+    {
+    font-weight: bold;
+    }
+
 div.log-compiler-output-title
     {
     font-weight: bold;

+ 44 - 44
tools/regression/xsl_reports/xsl/result_page.xsl

@@ -275,30 +275,37 @@
          </div>
       </div>
 
+      <xsl:variable name="multiple.libraries" select="count( $libraries ) > 1"/>
+
       <!-- TOC -->
-      <div class="detail-toc">
-        <a name="toc"></a>
-        <ul>
-          <xsl:for-each select="$libraries">
-            <xsl:sort select="." order="ascending" />
-            <li class="detail-toc-entry">
-              <a href="#{.}" class="detail-toc-entry">
-                <xsl:value-of select="."/>
-              </a>
-            </li>
-          </xsl:for-each>
-        </ul>
-      </div>
-      
+      <xsl:if test="$multiple.libraries">
+          <div class="detail-toc">
+              <a name="toc"></a>
+              <ul>
+                  <xsl:for-each select="$libraries">
+                      <xsl:sort select="." order="ascending" />
+                      <li class="detail-toc-entry">
+                          <a href="#{.}" class="detail-toc-entry">
+                              <xsl:value-of select="."/>
+                          </a>
+                      </li>
+                  </xsl:for-each>
+              </ul>
+          </div>
+      </xsl:if> 
+     
       <!-- for each library -->
       <xsl:for-each select="$libraries">
         <xsl:sort select="." order="ascending" />
         <xsl:variable name="library" select="." />
-        <div class="library-name">
-            <a name="{$library}" href="../libs/{$library}" class="library-link">
-              <xsl:value-of select="$library" />
-            </a>
-          </div>
+        
+        <xsl:if test="$multiple.libraries">
+            <div class="library-name">
+                <a name="{$library}" href="../libs/{$library}" class="library-link">
+                    <xsl:value-of select="$library" />
+                </a>
+            </div>
+        </xsl:if>
 
           <xsl:variable name="library_marks" select="$explicit_markup//library[ @name = $library ]/mark-unusable[ toolset/@name = $not_ordered_toolsets ]"/>
 
@@ -372,34 +379,25 @@
                     </a>
                   </td>
                   <td>
-                    <span class="detail-library-note-header">
-                      <xsl:choose>
-                        <xsl:when test="@author and @date">
-                          [&#160;<xsl:value-of select="@author"/>&#160;<xsl:value-of select="@date"/>&#160;]
-                        </xsl:when>
-                        <xsl:when test="@author">
-                          [&#160;<xsl:value-of select="@author"/>&#160;]                        
-                        </xsl:when>
-                        <xsl:when test="@date">
-                          [&#160;<xsl:value-of select="@date"/>&#160;]                        
-                        </xsl:when>
-                      </xsl:choose>
-                    </span>
-                    <xsl:if test="@refid">
-                        <xsl:variable name="refid" select="@refid"/>
-                        <xsl:copy-of select="$explicit_markup//note[ $refid = @id ]/node()"/>
-                    </xsl:if>
-                    <xsl:copy-of select="node()"/>
+                      <xsl:variable name="refid" select="@refid"/>
+                      <xsl:call-template name="show_note">
+                          <xsl:with-param name="note" select="." />
+                          <xsl:with-param name="reference" select="$explicit_markup//note[ $refid = @id ]"/>
+                      </xsl:call-template>
                   </td>
                 </tr>
               </xsl:for-each>
             </table>
           </xsl:if>
-          <div class="detail-footer">
-            <a href="#toc" class="back-link">toc</a>
-            <xsl:text>&#160;|&#160;</xsl:text>
-            <a href="{$mode}_summary_page.html" class="back-link">summary</a>
-          </div>
+          
+          <!-- Dont generate the link to toc and summary if there is just on library -->
+          <xsl:if test="$multiple.libraries">
+              <div class="detail-footer">
+                  <a href="#toc" class="back-link">toc</a>
+                  <xsl:text>&#160;|&#160;</xsl:text>
+                  <a href="{$mode}_summary_page.html" class="back-link">summary</a>
+              </div>
+          </xsl:if>
         </xsl:for-each>
         <div>
           <a href="http://validator.w3.org/check/referer">
@@ -429,7 +427,7 @@
         <xsl:when test="not( $test_log )">
           <xsl:text>detail-missing</xsl:text>
         </xsl:when>
-        <xsl:when test="$explicit_markup//library[ @name=$test_log/@library ]/mark-unusable[ @toolset = $test_log/@toolset or toolset/@name = $test_log/@toolset ]">
+        <xsl:when test="meta:is_unusable( $explicit_markup, $test_log/@library, $test_log/@toolset )">
           <xsl:text>detail-unusable</xsl:text>
         </xsl:when>
         <xsl:otherwise>
@@ -476,7 +474,7 @@
         <xsl:when test="not( $test_log )">
           <xsl:text>detail-missing</xsl:text>
         </xsl:when>
-        <xsl:when test="$explicit_markup//library[ @name=$test_log/@library ]/test/mark-library[ @toolset = $test_log/@toolset or toolset/@name = $test_log/@toolset ]">
+        <xsl:when test="meta:is_unusable( $explicit_markup, $test_log/@library, $test_log/@toolset )">
           <xsl:text>detail-unusable</xsl:text>
         </xsl:when>
         <xsl:when test="$test_log[@result='fail' and @status='unexpected']">
@@ -614,4 +612,6 @@
       </xsl:variable>
       <func:result select="exsl:node-set( $a )/*"/>
   </func:function>
+
+
 </xsl:stylesheet>

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

@@ -15,6 +15,8 @@
 
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:exsl="http://exslt.org/common"
+  xmlns:func="http://exslt.org/functions"
+  xmlns:meta="http://www.meta-comm.com"
   version="1.0">
 
   <xsl:import href="common.xsl"/>
@@ -307,7 +309,7 @@
   <xsl:param name="expected_test_count"/>
   <xsl:variable name="class">
     <xsl:choose> 
-      <xsl:when test="$explicit_markup//library[ @name = $library ]/mark-unusable[ @toolset=$toolset or toolset/@name=$toolset]">
+      <xsl:when test="meta:is_unusable( $explicit_markup, $library, $toolset )">
         <xsl:text>summary-unusable</xsl:text>
       </xsl:when>
       <xsl:when test="count( $current_cell ) &lt; $expected_test_count">
@@ -368,7 +370,7 @@
   <xsl:param name="expected_test_count"/>
   <xsl:variable name="class">
     <xsl:choose>
-      <xsl:when test="$explicit_markup//library[ @name = $library ]/mark-unusable[ @toolset=$toolset or toolset/@name=$toolset ]">
+      <xsl:when test="meta:is_unusable( $explicit_markup, $library, $toolset )">
         <xsl:text>summary-unusable</xsl:text>
       </xsl:when>
       <xsl:when test="count( $current_cell ) &lt; $expected_test_count">

粤ICP备19079148号