فهرست منبع

stale results highlighting

[SVN r28752]
Aleksey Gurtovoy 21 سال پیش
والد
کامیت
018a972942

+ 3 - 0
tools/regression/xsl_reports/test/common.py

@@ -1,4 +1,5 @@
 import xml.sax.saxutils
+import time
 
 def make_test_name( library_idx, test_idx ):
     return "test_%02d_%02d" % ( library_idx, test_idx )
@@ -29,6 +30,8 @@ def make_test_target_directory( library_idx, toolset_idx, test_name, variant ):
     else:
         return base
 
+def format_timestamp( timestamp ):
+    return time.strftime( "%Y-%m-%dT%H:%M:%SZ", timestamp )
 
 def make_test_log( xml_generator
                    , library_idx

+ 4 - 2
tools/regression/xsl_reports/test/generate_test_results.py

@@ -40,6 +40,7 @@ def test_run_type( runner_idx ):
     if runner_idx % 2: return "incremental"
     else:              return "full"
 
+
 def make_test_results():
     if not os.path.exists( results_directory ):
         os.makedirs( results_directory )
@@ -54,8 +55,9 @@ def make_test_results():
             
         g.startElement( "test-run", { "platform": platform
                                       , "runner": runner_id
-                                      , "timestamp": time.strftime( "%a, %d %b %Y %H:%M:%S +0000"
-                                                                   , time.gmtime())
+                                      , "timestamp": common.format_timestamp( 
+                                                          time.gmtime( time.time() - i_runner * 24*60*60 )
+                                                        )
                                       , "source": test_run_source( i_runner )
                                       , "run-type": test_run_type( i_runner )
                                       } )

+ 3 - 1
tools/regression/xsl_reports/test/test.py

@@ -5,8 +5,10 @@ sys.path.append( '..' )
 import os
 
 import boost_wide_report
+import common
 import utils
 import shutil
+import time
 
 tag = "CVS-HEAD"
 
@@ -20,7 +22,7 @@ boost_wide_report.unzip_archives_task = lambda incoming_dir, processed_dir, unzi
 boost_wide_report.execute_tasks(
     tag = tag
     , user = None
-    , run_date = "Today date"
+    , run_date = common.format_timestamp( time.gmtime() )
     , comment_file = os.path.abspath( "comment.html" )
         , results_dir = os.path.abspath( "results" )
         , output_dir = os.path.abspath( "output" )

+ 45 - 2
tools/regression/xsl_reports/xsl/v2/common.xsl

@@ -13,11 +13,12 @@ http://www.boost.org/LICENSE_1_0.txt)
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:exsl="http://exslt.org/common"
     xmlns:func="http://exslt.org/functions"
+    xmlns:date="http://exslt.org/dates-and-times"
     xmlns:str="http://exslt.org/strings"
     xmlns:set="http://exslt.org/sets"
     xmlns:meta="http://www.meta-comm.com"
     extension-element-prefixes="func"
-    exclude-result-prefixes="exsl func str set meta"
+    exclude-result-prefixes="exsl func date str set meta"
     version="1.0">
 
     <xsl:variable name="output_directory" select="'output'"/>
@@ -170,6 +171,38 @@ http://www.boost.org/LICENSE_1_0.txt)
         </xsl:choose>
     </func:function>
 
+    <!-- date-time -->
+
+    <func:function name="meta:timestamp_difference">
+        <xsl:param name="x"/>
+        <xsl:param name="y"/>
+
+        <xsl:variable name="duration" select="date:difference( $x, $y )"/>
+        <xsl:choose>
+            <xsl:when test="contains( $duration, 'D' )">
+                <xsl:variable name="days" select="substring-before( $duration, 'D' )"/>
+                <func:result select="substring-after( $days, 'P' )"/>
+            </xsl:when>
+            <xsl:otherwise>
+                <func:result select="0"/>
+            </xsl:otherwise>
+        </xsl:choose>
+
+    </func:function>
+    
+    <func:function name="meta:format_timestamp">
+        <xsl:param name="timestamp"/>
+
+        <xsl:variable name="time" select="substring-before( date:time( $timestamp ), 'Z' )"/>
+        <xsl:variable name="day" select="date:day-in-month( $timestamp )"/>
+        <xsl:variable name="day_abbrev" select="date:day-abbreviation( $timestamp )"/>
+        <xsl:variable name="month_abbrev" select="date:month-abbreviation( $timestamp )"/>
+        <xsl:variable name="year" select="date:year( $timestamp )"/>        
+        
+        <func:result select="concat( $day_abbrev, ', ', $day, ' ', $month_abbrev, ' ', $year, ' ', $time, ' +0000' )"/>
+
+    </func:function>
+    
     <!-- path -->
 
     <func:function name="meta:encode_path">
@@ -309,6 +342,8 @@ http://www.boost.org/LICENSE_1_0.txt)
     <xsl:template name="insert_runners_rows">
         <xsl:param name="mode"/>
         <xsl:param name="top_or_bottom"/>
+        <xsl:param name="run_toolsets"/>
+        <xsl:param name="run_date"/>
 
         <xsl:variable name="colspan">
             <xsl:choose>
@@ -347,7 +382,10 @@ http://www.boost.org/LICENSE_1_0.txt)
         <tr>
             <td colspan="{$colspan}">&#160;</td>
             <xsl:for-each select="$run_toolsets//runs/run[ count(toolset) > 0 ]">
-                <td colspan="{count(toolset)}" class="timestamp"><xsl:value-of select="@timestamp"/></td>
+                <xsl:variable name="age" select="meta:timestamp_difference( @timestamp, $run_date )"/>
+                <td colspan="{count(toolset)}" class="timestamp">
+                    <span class="timestamp-{$age}"><xsl:value-of select="meta:format_timestamp( @timestamp )"/></span>
+                </td>
             </xsl:for-each>
             <td colspan="{$colspan}">&#160;</td>
         </tr>
@@ -372,6 +410,7 @@ http://www.boost.org/LICENSE_1_0.txt)
         <xsl:param name="mode"/>
         <xsl:param name="library"/>
         <xsl:param name="library_marks"/>
+        <xsl:param name="run_date"/>
 
         <tr valign="middle">
             <xsl:variable name="colspan">
@@ -406,6 +445,8 @@ http://www.boost.org/LICENSE_1_0.txt)
                 </xsl:variable>
 
                 <td class="{$class}">
+                    <xsl:variable name="age" select="meta:timestamp_difference( ../@timestamp, $run_date )"/>
+                    <span class="timestamp-{$age}">
 
                     <!-- break toolset names into words -->
                     <xsl:for-each select="str:tokenize($toolset, '-')">
@@ -438,6 +479,8 @@ http://www.boost.org/LICENSE_1_0.txt)
                             </span>
                         </xsl:if>
                     </xsl:if>
+
+                    </span>
                 </td>
             </xsl:for-each>
               

+ 7 - 2
tools/regression/xsl_reports/xsl/v2/result_page.xsl

@@ -143,7 +143,7 @@ http://www.boost.org/LICENSE_1_0.txt)
 
                 <div class="report-info">
                     <div>
-                        <b>Report Time: </b> <xsl:value-of select="$run_date"/>
+                        <b>Report Time: </b> <xsl:value-of select="meta:format_timestamp( $run_date )"/>
                     </div>
                       
                     <div>
@@ -289,7 +289,7 @@ http://www.boost.org/LICENSE_1_0.txt)
                 </h1>
 
                 <div class="report-info">
-                    <b>Report Time: </b> <xsl:value-of select="$run_date"/>
+                    <b>Report Time: </b> <xsl:value-of select="meta:format_timestamp( $run_date )"/>
                 </div>
 
                 <!-- library marks = library-unusable markup for toolsets in the report  -->
@@ -302,12 +302,14 @@ http://www.boost.org/LICENSE_1_0.txt)
                         <xsl:with-param name="mode" select="'details'"/>
                         <xsl:with-param name="top_or_bottom" select="'top'"/>
                         <xsl:with-param name="run_toolsets" select="$run_toolsets"/>
+                        <xsl:with-param name="run_date" select="$run_date"/>
                       </xsl:call-template>
                       
                       <xsl:call-template name="insert_toolsets_row">
                         <xsl:with-param name="mode" select="'details'"/>
                         <xsl:with-param name="library_marks" select="$library_marks"/>
                         <xsl:with-param name="library" select="$library"/>
+                        <xsl:with-param name="run_date" select="$run_date"/>
                       </xsl:call-template>
                     </thead>
                     <tfoot>
@@ -315,11 +317,14 @@ http://www.boost.org/LICENSE_1_0.txt)
                         <xsl:with-param name="mode" select="'details'"/>
                         <xsl:with-param name="library_marks" select="$library_marks"/>
                         <xsl:with-param name="library" select="$library"/>
+                        <xsl:with-param name="run_date" select="$run_date"/>
                       </xsl:call-template>
 
                       <xsl:call-template name="insert_runners_rows">
                           <xsl:with-param name="mode" select="'details'"/>
                           <xsl:with-param name="top_or_bottom" select="'bottom'"/>
+                          <xsl:with-param name="run_toolsets" select="$run_toolsets"/>
+                          <xsl:with-param name="run_date" select="$run_date"/>
                       </xsl:call-template>
                     </tfoot>
 

+ 7 - 1
tools/regression/xsl_reports/xsl/v2/summary_page.xsl

@@ -112,7 +112,7 @@ http://www.boost.org/LICENSE_1_0.txt)
             </h1>
 
             <div class="report-info">
-                <b>Report Time: </b> <xsl:value-of select="$run_date"/>
+                <b>Report Time: </b> <xsl:value-of select="meta:format_timestamp( $run_date )"/>
             </div>
 
             <div class="statistics">
@@ -131,20 +131,26 @@ http://www.boost.org/LICENSE_1_0.txt)
                 <xsl:call-template name="insert_runners_rows">
                     <xsl:with-param name="mode" select="'summary'"/>
                     <xsl:with-param name="top_or_bottom" select="'top'"/>
+                    <xsl:with-param name="run_toolsets" select="$run_toolsets"/>
+                    <xsl:with-param name="run_date" select="$run_date"/>
                 </xsl:call-template>
 
                 <xsl:call-template name="insert_toolsets_row">
                     <xsl:with-param name="mode" select="'summary'"/>
+                    <xsl:with-param name="run_date" select="$run_date"/>
                 </xsl:call-template>
             </thead>
 
             <tfoot>
                 <xsl:call-template name="insert_toolsets_row">
                     <xsl:with-param name="mode" select="'summary'"/>
+                    <xsl:with-param name="run_date" select="$run_date"/>
                 </xsl:call-template>
                 <xsl:call-template name="insert_runners_rows">
                     <xsl:with-param name="mode" select="'summary'"/>
                     <xsl:with-param name="top_or_bottom" select="'bottom'"/>
+                    <xsl:with-param name="run_toolsets" select="$run_toolsets"/>
+                    <xsl:with-param name="run_date" select="$run_date"/>
                 </xsl:call-template>
             </tfoot>
           

粤ICP备19079148号