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

Warnings in reports

[SVN r29475]
Aleksey Gurtovoy 21 лет назад
Родитель
Сommit
fd6a63365b

+ 12 - 1
tools/regression/xsl_reports/boost_wide_report.py

@@ -395,6 +395,7 @@ def execute_tasks(
         , results_dir
         , output_dir
         , reports
+        , warnings
         , extended_test_results
         , dont_collect_logs
         , expected_results_file
@@ -448,6 +449,7 @@ def execute_tasks(
         , comment_file
         , output_dir
         , reports
+        , warnings
         )
 
         
@@ -460,10 +462,13 @@ def make_result_pages(
         , comment_file
         , output_dir
         , reports
+        , warnings
         ):
 
     utils.log( 'Producing the reports...' )
     __log__ = 1
+
+    warnings_text = '+'.join( warnings )
     
     if comment_file != '':
         comment_file = os.path.abspath( comment_file )
@@ -504,7 +509,8 @@ def make_result_pages(
                       'links_file':             'links.html'
                     , 'mode':                   mode
                     , 'source':                 tag
-                    , 'run_date':               run_date 
+                    , 'run_date':               run_date
+                    , 'warnings':               warnings_text
                     , 'comment_file':           comment_file
                     , 'expected_results_file':  expected_results_file
                     , 'explicit_markup_file' :  failures_markup_file
@@ -523,6 +529,7 @@ def make_result_pages(
                       'mode' :                  mode 
                     , 'source':                 tag
                     , 'run_date':               run_date 
+                    , 'warnings':               warnings_text
                     , 'comment_file':           comment_file
                     , 'explicit_markup_file' :  failures_markup_file
                     }
@@ -541,6 +548,7 @@ def make_result_pages(
                     , 'mode':                   mode
                     , 'source':                 tag
                     , 'run_date':               run_date 
+                    , 'warnings':               warnings_text
                     , 'comment_file':           comment_file
                     , 'expected_results_file':  expected_results_file
                     , 'explicit_markup_file' :  failures_markup_file
@@ -560,6 +568,7 @@ def make_result_pages(
                       'mode' :                  mode
                     , 'source':                 tag
                     , 'run_date':               run_date 
+                    , 'warnings':               warnings_text
                     , 'comment_file':           comment_file
                     , 'explicit_markup_file' :  failures_markup_file
                     , 'release':                'yes'
@@ -600,6 +609,7 @@ def build_xsl_reports(
         , result_file_prefix
         , dont_collect_logs = 0
         , reports = report_types
+        , warnings = []
         , user = None
         , upload = False
         ):
@@ -630,6 +640,7 @@ def build_xsl_reports(
         , results_dir
         , output_dir
         , reports
+        , warnings
         , extended_test_results
         , dont_collect_logs
         , expected_results_file

+ 11 - 10
tools/regression/xsl_reports/runner/regression.py

@@ -829,13 +829,14 @@ Options:
     print 'For more documentation, see http://tinyurl.com/4f2zp\n'
 
 
-if len(sys.argv) > 1 and sys.argv[1] in commands:
-    command = sys.argv[1]
-    args = sys.argv[ 2: ]
-    if command not in [ 'collect-logs', 'upload-logs' ]:
-        args.insert( 0, '--runner=' )
-else:
-    command = 'regression'
-    args = sys.argv[ 1: ]
-    
-commands[ command ]( **accept_args( args ) )
+if __name__ == '__main__':
+    if len(sys.argv) > 1 and sys.argv[1] in commands:
+        command = sys.argv[1]
+        args = sys.argv[ 2: ]
+        if command not in [ 'collect-logs', 'upload-logs' ]:
+            args.insert( 0, '--runner=' )
+    else:
+        command = 'regression'
+        args = sys.argv[ 1: ]
+
+    commands[ command ]( **accept_args( args ) )

+ 18 - 0
tools/regression/xsl_reports/xsl/v2/common.xsl

@@ -317,6 +317,24 @@ http://www.boost.org/LICENSE_1_0.txt)
         </func:result>
     </func:function>
 
+    <xsl:template name="insert_report_header">
+        <xsl:param name="run_date"/>
+        <xsl:param name="warnings"/>
+
+        <div class="report-info">
+            <b>Report Time: </b> <xsl:value-of select="meta:format_timestamp( $run_date )"/>
+        </div>
+
+        <xsl:if test="$warnings">
+            <xsl:for-each select="str:split( $warnings )">
+                <div class="report-warning">
+                    <b>Warning: </b> <xsl:value-of select="."/>
+                </div>
+            </xsl:for-each>
+        </xsl:if>
+
+    </xsl:template>
+
 
     <xsl:template name="insert_view_link">
         <xsl:param name="page"/>

+ 6 - 5
tools/regression/xsl_reports/xsl/v2/issues_page.xsl

@@ -31,6 +31,7 @@ http://www.boost.org/LICENSE_1_0.txt)
   
   <xsl:param name="source"/>
   <xsl:param name="run_date"/>
+  <xsl:param name="warnings"/>
   <xsl:param name="comment_file"/>
   <xsl:param name="expected_results_file"/>
   <xsl:param name="explicit_markup_file"/>
@@ -112,14 +113,14 @@ http://www.boost.org/LICENSE_1_0.txt)
             <xsl:text>Unresolved Issues: </xsl:text>
             <a class="hover-link" href="summary{$release_postfix}.html" target="_top"><xsl:value-of select="$source"/></a>
           </h1>
+
+          <xsl:call-template name="insert_report_header">
+            <xsl:with-param name="run_date" select="$run_date"/>
+            <xsl:with-param name="warnings" select="$warnings"/>
+          </xsl:call-template>
           
           <div class="report-info">
-            <div>
-              <b>Report Time: </b> <xsl:value-of select="$run_date"/>
-            </div>
-            <div>
               <b>Purpose: </b> Provides a list of current unresolved test failures. 
-            </div>
           </div>
 
           <!-- Emit the index -->  

+ 22 - 21
tools/regression/xsl_reports/xsl/v2/result_page.xsl

@@ -31,6 +31,7 @@ http://www.boost.org/LICENSE_1_0.txt)
     <xsl:param name="mode"/>
     <xsl:param name="source"/>
     <xsl:param name="run_date"/>
+    <xsl:param name="warnings"/>
     <xsl:param name="comment_file"/>
     <xsl:param name="expected_results_file"/>
     <xsl:param name="explicit_markup_file"/>
@@ -166,25 +167,24 @@ http://www.boost.org/LICENSE_1_0.txt)
                     <a class="hover-link" href="summary.html" target="_top"><xsl:value-of select="$source"/></a>
                 </h1>                            
 
+                <xsl:call-template name="insert_report_header">
+                    <xsl:with-param name="run_date" select="$run_date"/>
+                    <xsl:with-param name="warnings" select="$warnings"/>
+                </xsl:call-template>
+
                 <div class="report-info">
-                    <div>
-                        <b>Report Time: </b> <xsl:value-of select="meta:format_timestamp( $run_date )"/>
-                    </div>
-                      
-                    <div>
-                        <b>Purpose: </b>
-                        <xsl:choose>
-                            <xsl:when test="$mode='user'">
-                                The purpose of this report is to help a user to find out whether a particular library 
-                                works on the particular compiler(s). For CVS "health report", see 
-                                <a href="../{$alternate_mode}/index.html" target="_top">developer summary</a>.
-                            </xsl:when>
-                            <xsl:when test="$mode='developer'">
-                                Provides Boost developers with visual indication of the CVS "health". For user-level 
-                                report, see <a href="../{$alternate_mode}/index.html" target="_top">user summary</a>.
-                            </xsl:when>
-                        </xsl:choose>
-                    </div>
+                    <b>Purpose: </b>
+                    <xsl:choose>
+                        <xsl:when test="$mode='user'">
+                            The purpose of this report is to help a user to find out whether a particular library 
+                            works on the particular compiler(s). For CVS "health report", see 
+                            <a href="../{$alternate_mode}/index.html" target="_top">developer summary</a>.
+                        </xsl:when>
+                        <xsl:when test="$mode='developer'">
+                            Provides Boost developers with visual indication of the CVS "health". For user-level 
+                            report, see <a href="../{$alternate_mode}/index.html" target="_top">user summary</a>.
+                        </xsl:when>
+                    </xsl:choose>
                 </div>
                               
                 <div class="comment">
@@ -313,9 +313,10 @@ http://www.boost.org/LICENSE_1_0.txt)
                     <a class="hover-link" href="summary.html" target="_top"><xsl:value-of select="$source"/></a>
                 </h1>
 
-                <div class="report-info">
-                    <b>Report Time: </b> <xsl:value-of select="meta:format_timestamp( $run_date )"/>
-                </div>
+                <xsl:call-template name="insert_report_header">
+                    <xsl:with-param name="run_date" select="$run_date"/>
+                    <xsl:with-param name="warnings" select="$warnings"/>
+                </xsl:call-template>
 
                 <!-- library marks = library-unusable markup for toolsets in the report  -->
                 <xsl:variable name="library_marks" select="$explicit_markup//library[ @name = $library ]/mark-unusable/toolset[  meta:re_match( @name, $run_toolsets//toolset/@name ) ]/.."/>

+ 5 - 4
tools/regression/xsl_reports/xsl/v2/summary_page.xsl

@@ -27,10 +27,10 @@ http://www.boost.org/LICENSE_1_0.txt)
         indent="yes"
         />
 
-
     <xsl:param name="mode"/>
     <xsl:param name="source"/>
     <xsl:param name="run_date"/>
+    <xsl:param name="warnings"/>
     <xsl:param name="comment_file"/>
     <xsl:param name="explicit_markup_file"/>
     <xsl:param name="release"/>
@@ -131,9 +131,10 @@ http://www.boost.org/LICENSE_1_0.txt)
                 <a class="hover-link" href="summary{$release_postfix}.html" target="_top"><xsl:value-of select="$source"/></a>
             </h1>
 
-            <div class="report-info">
-                <b>Report Time: </b> <xsl:value-of select="meta:format_timestamp( $run_date )"/>
-            </div>
+            <xsl:call-template name="insert_report_header">
+                <xsl:with-param name="run_date" select="$run_date"/>
+                <xsl:with-param name="warnings" select="$warnings"/>
+            </xsl:call-template>
 
             <div class="statistics">
             Unusable: <xsl:value-of select="count( $test_case_logs[ meta:test_case_status( . ) = 'unusable' ] )"/>

粤ICP备19079148号