소스 검색

Added support for failures markup

[SVN r21014]
Misha Bergal 22 년 전
부모
커밋
1820d34651
3개의 변경된 파일70개의 추가작업 그리고 31개의 파일을 삭제
  1. 11 4
      tools/regression/xsl_reports/report.py
  2. 50 26
      tools/regression/xsl_reports/xsl/add_expected_results.xsl
  3. 9 1
      tools/regression/xsl_reports/xsl/links_page.xsl

+ 11 - 4
tools/regression/xsl_reports/report.py

@@ -153,6 +153,7 @@ def xsl_path( xsl_file_name ):
 
 def make_result_pages( test_results_file
                        , expected_results_file
+                       , failures_markup_file
                        , source
                        , run_date
                        , comment_file
@@ -183,7 +184,7 @@ def make_result_pages( test_results_file
     xslt_proc( test_results_file
                , xsl_path( "add_expected_results.xsl" )
                , extended_test_results
-               , { "expected_results_file": expected_results_file }
+               , { "expected_results_file": expected_results_file, "failures_markup_file" : failures_markup_file }
            )
 
     links = os.path.join( output_dir, "links.html"  )
@@ -236,6 +237,7 @@ def make_result_pages( test_results_file
 def build_experimental_reports( locate_root_dir
                                 , source
                                 , expected_results_file
+                                , failures_markup_file
                                 , comment_file
                                 , results_dir
                                 , result_file_prefix
@@ -249,6 +251,7 @@ def build_experimental_reports( locate_root_dir
 
     make_result_pages( test_results_file
                        , expected_results_file
+                       , failures_markup_file
                        , source
                        , run_date
                        , comment_file
@@ -262,6 +265,7 @@ def accept_args( args ):
     ( option_pairs, rest_args ) = getopt.getopt( sys.argv[1:], "", [ "locate-root="
                                                                      , "tag="
                                                                      , "expected-results="
+                                                                     , "failures-markup="
                                                                      , "comment="
                                                                      , "results-dir="
                                                                      , "results-prefix="
@@ -269,11 +273,12 @@ def accept_args( args ):
                                                                      , "help"
                                                                      ] )
     options = { "--comment": ""
-                , "--expected-results": "" }
+                , "--expected-results": ""
+                , "--failures-markup": "" }
     
     map( lambda x: options.__setitem__( x[0], x[1] ), option_pairs )
 
-    if ( options.has_key( "--help" ) or len( options.keys() ) == 2 ):
+    if ( options.has_key( "--help" ) or len( options.keys() ) == 3 ):
         usage()
         sys.exit( 1 )
 
@@ -283,6 +288,7 @@ def accept_args( args ):
     return ( options[ "--locate-root" ]
              , options[ "--tag" ]
              , options[ "--expected-results" ]
+             , options[ "--failures-markup" ]
              , options[ "--comment" ]
              , options[ "--results-dir" ]
              , options[ "--results-prefix" ]
@@ -295,7 +301,8 @@ def usage():
 \t--locate-root       the same as --locate-root in compiler_status
 \t--tag               the tag for the results (i.e. "CVS main trunk")
 \t--expected-results  the file with the results to be compared with
-\t                    the current run 
+\t                    the current run
+\t--failures-markup   the file with the failures markup
 \t--comment           an html comment file (will be inserted in the reports)
 \t--results-dir       the directory containing -links.html, -fail.html
 \t                    files produced by compiler_status (by default the

+ 50 - 26
tools/regression/xsl_reports/xsl/add_expected_results.xsl

@@ -17,7 +17,9 @@
   <xsl:output method="xml" encoding="utf-8"/>
   
   <xsl:param name="expected_results_file"/>
+  <xsl:param name="failures_markup_file"/>
   <xsl:variable name="expected_results" select="document( $expected_results_file )" />
+  <xsl:variable name="failures_markup" select="document( $failures_markup_file )" />
 
   <xsl:template match="/">
     <xsl:apply-templates/>
@@ -43,47 +45,67 @@
       </xsl:variable>
 
       <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="failures_markup" select="$failures_markup//*/mark[ @library=$library and ( @test = $test-name or @test = '*' ) and ( @toolset = $toolset or @toolset = '*' ) ]"/>
+
+      <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="expected_result">
         <xsl:choose>
-          <xsl:when test="$expected_results_test_case and $expected_results_test_case/@result = 'fail'">
+          <xsl:when test='count( $failures_markup ) &gt; 0'>
             <xsl:text>fail</xsl:text>
           </xsl:when>
-          <xsl:otherwise>success</xsl:otherwise>
+          
+          <xsl:otherwise>
+            <xsl:choose>
+              <xsl:when test="$expected_results_test_case and $expected_results_test_case/@result = 'fail'">
+                <xsl:text>fail</xsl:text>
+              </xsl:when>
+              
+              <xsl:otherwise>success</xsl:otherwise>
+            </xsl:choose>
+          </xsl:otherwise>
         </xsl:choose>
       </xsl:variable>
 
+      <!--      <a><xsl:value-of select="count( $failures_markup )"/></a> -->
       <xsl:variable name="status">
         <xsl:choose>
-          <xsl:when test="$expected_result = $actual_result">expected</xsl:when>
-          <xsl:otherwise>unexpected</xsl:otherwise>
-        </xsl:choose>
-      </xsl:variable>
+          <xsl:when test="count( $failures_markup ) &gt; 0">
+            <xsl:choose>
+              <xsl:when test="$expected_result = $actual_result">expected</xsl:when>
+              <xsl:otherwise>unexpected</xsl:otherwise>
+            </xsl:choose>
+          </xsl:when>
 
-      <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:otherwise>
+            <xsl:choose>
+              <xsl:when test="$expected_result = $actual_result">expected</xsl:when>
+              <xsl:otherwise>unexpected</xsl:otherwise>
+            </xsl:choose>
+          </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:choose>
+          <xsl:when test='count( $failures_markup ) &gt; 0'>
+            <xsl:for-each select="$failures_markup/note">
               <xsl:copy-of select="."/>
-            </xsl:otherwise>
-          </xsl:choose>
-        </xsl:for-each>
-        <!--        <xsl:copy-of select="$expected_results_test_case/node()"/>-->
+            </xsl:for-each>
+            <!--        <xsl:copy-of select="$expected_results_test_case/node()"/>-->
+          </xsl:when>
+
+          
+        </xsl:choose>
       </xsl:variable>
 
       <xsl:attribute name="result"><xsl:value-of select="$actual_result"/></xsl:attribute>
@@ -91,6 +113,8 @@
       <xsl:attribute name="status"><xsl:value-of select="$status"/></xsl:attribute>
       <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:element>
   </xsl:template>

+ 9 - 1
tools/regression/xsl_reports/xsl/links_page.xsl

@@ -81,7 +81,15 @@
         <div class="log-notes-title">Notes:</div>
         <div class="log-notes">
           <xsl:for-each select="notes/note">
-            <xsl:copy-of select="."/>
+            <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:copy-of select="text()"/>
+            </div>
           </xsl:for-each>
         </div>
       </p>

粤ICP备19079148号