Browse Source

new error log format (with notes); distinguish newly added tests/compilers

[SVN r19582]
Aleksey Gurtovoy 23 years ago
parent
commit
cc474df03c

+ 18 - 3
tools/regression/xsl_reports/report.py

@@ -17,7 +17,10 @@ import time
 import inspect
 import inspect
 import getopt
 import getopt
 
 
-run_dir = os.path.abspath( os.path.dirname( sys.argv[ 0 ] ) )
+if __name__ == "__main__":
+    run_dir = os.path.abspath( os.path.dirname( sys.argv[ 0 ] ) )
+else:
+    run_dir = os.path.abspath( os.path.dirname( sys.modules[ __name__ ].__file__ ) )
 
 
 class failure_exception:
 class failure_exception:
     def __init__( self, rc ):
     def __init__( self, rc ):
@@ -183,12 +186,24 @@ def make_result_pages( test_results_file
                , { "expected_results_file": expected_results_file }
                , { "expected_results_file": expected_results_file }
            )
            )
 
 
+    links = os.path.join( output_dir, "links.html"  )
+    log( "    Making -links file..." )
+    xslt_proc( extended_test_results
+               , xsl_path( "links_page.xsl" )
+               , links
+               , {
+                 "source": source
+                 , "run_date": run_date 
+                 , "comment_file": comment_file
+                 }
+           )
+
     log( "    Making detailed reports..." )
     log( "    Making detailed reports..." )
     for mode in ( "developer", "user" ):
     for mode in ( "developer", "user" ):
         xslt_proc(  extended_test_results
         xslt_proc(  extended_test_results
                     , xsl_path( "result_page.xsl" )
                     , xsl_path( "result_page.xsl" )
                     , os.path.join( output_dir, "%s_%s" % ( mode, "result_page.html" ) )
                     , os.path.join( output_dir, "%s_%s" % ( mode, "result_page.html" ) )
-                    , { "links_file": "../" + result_prefix + "-links.html"
+                    , { "links_file": "links.html"
                         , "mode": mode
                         , "mode": mode
                         , "source": source
                         , "source": source
                         , "run_date": run_date 
                         , "run_date": run_date 
@@ -258,7 +273,7 @@ def accept_args( args ):
     
     
     map( lambda x: options.__setitem__( x[0], x[1] ), option_pairs )
     map( lambda x: options.__setitem__( x[0], x[1] ), option_pairs )
 
 
-    if ( options.has_key( "--help" ) or len( options.keys() ) == 0 ):
+    if ( options.has_key( "--help" ) or len( options.keys() ) == 2 ):
         usage()
         usage()
         sys.exit( 1 )
         sys.exit( 1 )
 
 

+ 28 - 5
tools/regression/xsl_reports/xsl/add_expected_results.xsl

@@ -42,11 +42,11 @@
         </xsl:choose>                     
         </xsl:choose>                     
       </xsl:variable>
       </xsl:variable>
 
 
-      <xsl:variable name="expected_results_test_case" select="$expected_results//*/test-result[ @library=$library and @test-name=$test-name and @toolset = $toolset]"/>
+      <xsl:variable name="expected_results_test_case" select="$expected_results//*/test-result[ @library=$library and ( @test-name=$test-name or @test-name='*' ) and @toolset = $toolset]"/>
 
 
       <xsl:variable name="expected_result">
       <xsl:variable name="expected_result">
         <xsl:choose>
         <xsl:choose>
-          <xsl:when test="$expected_results_test_case">
+          <xsl:when test="$expected_results_test_case and $expected_results_test_case/@result = 'fail'">
             <xsl:text>fail</xsl:text>
             <xsl:text>fail</xsl:text>
           </xsl:when>
           </xsl:when>
           <xsl:otherwise>success</xsl:otherwise>
           <xsl:otherwise>success</xsl:otherwise>
@@ -60,14 +60,37 @@
         </xsl:choose>
         </xsl:choose>
       </xsl:variable>
       </xsl:variable>
 
 
-      <xsl:variable name="note">
-        <xsl:copy-of select="$expected_results_test_case/node()"/>
+      <xsl:variable name="is_new">
+         <xsl:choose>
+            <xsl:when test="$expected_results_test_case">
+               <xsl:text>no</xsl:text>
+            </xsl:when>
+            <xsl:otherwise>yes</xsl:otherwise>
+         </xsl:choose>
+      </xsl:variable>
+
+      <xsl:variable name="notes">
+        <xsl:for-each select="$expected_results_test_case/note">
+          <xsl:choose>
+            <xsl:when test="@ref">
+              <xsl:variable name="note-ref">
+                <xsl:value-of select="@ref"/>
+              </xsl:variable>
+              <xsl:copy-of select="$expected_results//*/note[@id=$note-ref]"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:copy-of select="."/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:for-each>
+        <!--        <xsl:copy-of select="$expected_results_test_case/node()"/>-->
       </xsl:variable>
       </xsl:variable>
 
 
       <xsl:attribute name="result"><xsl:value-of select="$actual_result"/></xsl:attribute>
       <xsl:attribute name="result"><xsl:value-of select="$actual_result"/></xsl:attribute>
       <xsl:attribute name="expected-result"><xsl:value-of select="$expected_result"/></xsl:attribute>
       <xsl:attribute name="expected-result"><xsl:value-of select="$expected_result"/></xsl:attribute>
       <xsl:attribute name="status"><xsl:value-of select="$status"/></xsl:attribute>
       <xsl:attribute name="status"><xsl:value-of select="$status"/></xsl:attribute>
-      <xsl:element name="note"><xsl:copy-of select="$note"/></xsl:element>
+      <xsl:attribute name="is-new"><xsl:value-of select="$is_new"/></xsl:attribute>
+      <xsl:element name="notes"><xsl:copy-of select="$notes"/></xsl:element>
       <xsl:apply-templates select="node()" />
       <xsl:apply-templates select="node()" />
     </xsl:element>
     </xsl:element>
   </xsl:template>
   </xsl:template>

+ 129 - 0
tools/regression/xsl_reports/xsl/links_page.xsl

@@ -0,0 +1,129 @@
+<?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" version="1.0">
+
+  <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="expected_results_file"/>
+
+  <xsl:template match="/">
+    <html>
+      <head>
+        <link rel="stylesheet" type="text/css" href="master.css" title="master" />
+        <title>Boost regression - test run output: <xsl:value-of select="$source"/></title>
+      </head>
+      <body>
+        <div>
+          <table border="0">
+            <tr>
+              <td><img border="0" src="../c++boost.gif" width="277" height="86" alt="Boost logo"></img></td>
+              <td>
+                <h1 class="page-title">
+                  <xsl:text>Regression Tests Log: </xsl:text>
+                  <xsl:value-of select="$source"/>
+                </h1>
+
+                <b>Report Time: </b> <xsl:value-of select="$run_date"/>
+                <xsl:if test="$comment_file != ''">
+                  <xsl:copy-of select="document( $comment_file )"/>
+                </xsl:if>
+              </td>
+            </tr>
+          </table>
+          <table border="0" class="header-table">
+            <tr>
+              <td class="header-item">Purpose</td>
+              <td class="header-item-content">
+                Provides notes,  compiler, linker and run output of the
+                regression tests. 
+              </td>
+            </tr>
+          </table>
+        </div>
+        <div>
+          <xsl:apply-templates select="//test-log[@result = 'fail']"/>
+        </div>
+      </body>
+    </html>
+  </xsl:template>
+
+  <xsl:template match="test-log">
+    <div>
+      <xsl:variable name="test-anchor">
+        <xsl:value-of select="concat( @test-name, '-', @toolset )"/>
+      </xsl:variable>
+      <div class="log-test-title">
+        <a name="{$test-anchor}"><xsl:value-of select="concat( @test-name, ' / ', @toolset )"/></a>
+      </div>
+
+    <xsl:if test="notes/note">
+      <p>
+        <div class="log-notes-title">Notes:</div>
+        <div class="log-notes">
+          <xsl:for-each select="notes/note">
+            <xsl:copy-of select="."/>
+          </xsl:for-each>
+        </div>
+      </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>
+        <pre>
+          <xsl:copy-of select="lib/node()"/>
+        </pre>
+      </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:template>
+</xsl:stylesheet>

+ 46 - 0
tools/regression/xsl_reports/xsl/master.css

@@ -194,6 +194,17 @@ td.result-fail-unexpected
   border: 2px solid black; 
   border: 2px solid black; 
 }
 }
 
 
+td.summary-fail-unexpected-new
+, td.result-fail-unexpected-new
+{ 
+  width: 60pt;
+  text-align: center;
+  background-color: yellow;
+  font-weight: bold;
+  color: black;
+  border: 2px solid black; 
+}
+
 td.result-user-fail-expected
 td.result-user-fail-expected
 { 
 { 
   width: 60pt;
   width: 60pt;
@@ -202,3 +213,38 @@ td.result-user-fail-expected
   color: black;
   color: black;
   border: 0px solid black; 
   border: 0px solid black; 
 }
 }
+
+div.log-test-title
+{
+  font-size: 1.5em;
+  font-weight: bold;
+  border-bottom: 1px solid black;
+}
+
+div.log-notes-title
+{
+  font-weight: bold;
+  background-color:#FFFFCC;
+}
+
+
+div.log-notes
+{
+  padding: 3pt;
+  background-color:#FFFFCC;
+}
+
+div.log-compiler-output-title
+{
+  font-weight: bold;
+}
+
+div.log-linker-output-title
+{
+  font-weight: bold;
+}
+
+div.log-run-output-title
+{
+  font-weight: bold;
+}

+ 2 - 2
tools/regression/xsl_reports/xsl/produce_expected_results.xsl

@@ -7,14 +7,14 @@
   <xsl:template match="/">
   <xsl:template match="/">
     <root>
     <root>
       <expected-failures>
       <expected-failures>
-        <xsl:apply-templates select="*/test-log[@result != 'success']"/>
+        <xsl:apply-templates select="*/test-log"/>
       </expected-failures>
       </expected-failures>
     </root>
     </root>
   </xsl:template>
   </xsl:template>
   
   
   <xsl:template match="test-log">
   <xsl:template match="test-log">
     <xsl:if test="@result != 'success'">
     <xsl:if test="@result != 'success'">
-      <test-result library="{@library}" test-name="{@test-name}" toolset="{@toolset}" />
+      <test-result library="{@library}" test-name="{@test-name}" toolset="{@toolset}" result="{@result}" />
     </xsl:if>
     </xsl:if>
   </xsl:template>
   </xsl:template>
 
 

+ 12 - 1
tools/regression/xsl_reports/xsl/result_page.xsl

@@ -143,6 +143,12 @@
                         expected failure
                         expected failure
                       </td>
                       </td>
                     </tr>
                     </tr>
+                    <tr>
+                      <td><table><tr><td class="result-fail-unexpected-new">fail</td></tr></table></td>
+                      <td class="legend-item">
+                        a failure on a newly added test or compiler
+                      </td>
+                    </tr>
                     <tr>
                     <tr>
                       <td><table><tr><td class="result-fail-unexpected">fail</td></tr></table></td>
                       <td><table><tr><td class="result-fail-unexpected">fail</td></tr></table></td>
                       <td>unexpected failure</td>
                       <td>unexpected failure</td>
@@ -294,7 +300,12 @@
     <xsl:param name="test_log"/>
     <xsl:param name="test_log"/>
     <xsl:param name="log_link"/>
     <xsl:param name="log_link"/>
     
     
-    <td class="result-{$test_log/@result}-{$test_log/@status}">
+    <xsl:variable name="is_new">
+       <xsl:if test="$test_log/@is-new = 'yes' and $test_log/@status = 'unexpected' and $test_log/@result != 'success'">
+          <xsl:value-of select="'-new'"/>
+       </xsl:if>
+    </xsl:variable>
+    <td class="result-{$test_log/@result}-{$test_log/@status}{$is_new}">
       <xsl:choose>
       <xsl:choose>
         <xsl:when test="$test_log/@result != 'success' and $test_log/@status = 'expected'">
         <xsl:when test="$test_log/@result != 'success' and $test_log/@status = 'expected'">
           <a href="{$log_link}" class="log-link">
           <a href="{$log_link}" class="log-link">

+ 12 - 3
tools/regression/xsl_reports/xsl/summary_page.xsl

@@ -131,6 +131,12 @@
                         unexpectedly pass as well
                         unexpectedly pass as well
                       </td>
                       </td>
                     </tr>
                     </tr>
+                    <tr>
+                      <td><table><tr><td class="summary-fail-unexpected-new">broken</td></tr></table></td>
+                      <td class="legend-item">
+                        there are some failures on a newly added test or compiler
+                      </td>
+                    </tr>
                     <tr>
                     <tr>
                       <td><table><tr><td class="summary-fail-unexpected">broken</td></tr></table></td>
                       <td><table><tr><td class="summary-fail-unexpected">broken</td></tr></table></td>
                       <td class="legend-item">
                       <td class="legend-item">
@@ -232,9 +238,12 @@
   <xsl:param name="library"/>
   <xsl:param name="library"/>
   <xsl:variable name="class">
   <xsl:variable name="class">
     <xsl:choose>
     <xsl:choose>
-      <xsl:when test="count( $current_cell[@result='fail' and  @status='unexpected'] )">
+      <xsl:when test="count( $current_cell[@result='fail' and  @status='unexpected' and @is-new='no'] )">
         <xsl:text>summary-fail-unexpected</xsl:text>
         <xsl:text>summary-fail-unexpected</xsl:text>
       </xsl:when>
       </xsl:when>
+      <xsl:when test="count( $current_cell[@result='fail' and  @status='unexpected' and @is-new='yes'] )">
+        <xsl:text>summary-fail-unexpected-new</xsl:text>
+      </xsl:when>
       <xsl:when test="count( $current_cell[@result='success' and  @status='unexpected'] )">
       <xsl:when test="count( $current_cell[@result='success' and  @status='unexpected'] )">
         <xsl:text>summary-success-unexpected</xsl:text>
         <xsl:text>summary-success-unexpected</xsl:text>
       </xsl:when>
       </xsl:when>
@@ -246,7 +255,7 @@
   
   
   <td class="{$class}">
   <td class="{$class}">
     <xsl:choose>
     <xsl:choose>
-      <xsl:when test="$class='summary-fail-unexpected'">
+      <xsl:when test="$class='summary-fail-unexpected' or $class='summary-fail-unexpected-new' ">
         <a href="{$mode}_result_page.html#{$library}" class="log-link">
         <a href="{$mode}_result_page.html#{$library}" class="log-link">
           <xsl:text>broken</xsl:text>
           <xsl:text>broken</xsl:text>
         </a>
         </a>
@@ -266,7 +275,7 @@
   <xsl:param name="library"/>
   <xsl:param name="library"/>
   <xsl:variable name="class">
   <xsl:variable name="class">
     <xsl:choose>
     <xsl:choose>
-      <xsl:when test="count( $current_cell[@result='fail' and @status='unexpected'] )">
+      <xsl:when test="count( $current_cell[@result='fail' and @status='unexpected' ] )">
         <xsl:text>summary-user-fail-unexpected</xsl:text>
         <xsl:text>summary-user-fail-unexpected</xsl:text>
       </xsl:when>
       </xsl:when>
       <xsl:when test="count( $current_cell[ @result='fail'] )">
       <xsl:when test="count( $current_cell[ @result='fail'] )">

粤ICP备19079148号