Преглед изворни кода

Fixed notes. Implemented multiple note references in refid attribute. Added wildcard support for toolsets in unusable libraries markup

[SVN r25190]
Misha Bergal пре 21 година
родитељ
комит
6e17d5b36c

+ 27 - 13
tools/regression/xsl_reports/xsl/v2/common.xsl

@@ -137,7 +137,7 @@
         <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:result select="count( $explicit_markup//library[ @name = $library ]/mark-unusable/toolset[ meta:re_match( @name, $toolset ) ] ) > 0"/>
     </func:function>
 
     <func:function name="meta:re_match">
@@ -355,6 +355,7 @@
 
                 <td class="{$class}">
 
+                    <!-- break toolset names into words -->
                     <xsl:for-each select="str:tokenize($toolset, '-')">
                         <xsl:value-of select="." />
                         <xsl:if test="position()!=last()">
@@ -363,9 +364,10 @@
                     </xsl:for-each>
                     
                     <xsl:if test="$mode = 'details'">
+                        <!-- prepare toolset notes -->
                         <xsl:variable name="toolset_notes_fragment">
                             <xsl:for-each select="$library_marks/note">
-                                <xsl:if test="../@toolset=$toolset or ( ../toolset/@name=$toolset or ../toolset/@name = '*' )">
+                                <xsl:if test="count( ../toolset[meta:re_match( @name, $toolset )] ) > 0">
                                     <note index="{position()}"/>
                                 </xsl:if>
                             </xsl:for-each>
@@ -394,13 +396,16 @@
     <xsl:template name="show_notes">
         <xsl:param name="explicit_markup"/>
         <xsl:param name="notes"/>
+        <notes>
+            <xsl:copy-of select="$notes"/>
+        </notes>
             <div class="notes">
             <xsl:for-each select="$notes">
                 <div>
-                    <xsl:variable name="refid" select="@refid"/>
+                    <xsl:variable name="ref_id" 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:with-param name="references" select="$ref_id"/>
                     </xsl:call-template>
                 </div>
             </xsl:for-each>
@@ -409,16 +414,14 @@
 
     <xsl:template name="show_note">
         <xsl:param name="note"/>
-        <xsl:param name="reference"/>
+        <xsl:param name="references"/>
+
         <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>
@@ -430,9 +433,6 @@
                     <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>
@@ -453,9 +453,23 @@
             </xsl:choose>
         </span>
 
-        <xsl:if test="$reference">
-            <xsl:copy-of select="$reference/node()"/>                
+        <xsl:if test="$references">
+            <!-- lookup references (refid="17,18") -->
+            <xsl:for-each select="str:tokenize($references, ',')">
+                <xsl:variable name="ref_id" select="."/>
+                <xsl:variable name="referenced_note" select="$explicit_markup//note[ $ref_id = @id ]"/>
+
+                <xsl:choose>
+                    <xsl:when test="$referenced_note">
+                        <xsl:copy-of select="$referenced_note/node()"/>
+                    </xsl:when>
+                    <xsl:otherwise>
+                        <xsl:value-of select="$ref_id"/>
+                    </xsl:otherwise>
+                </xsl:choose>
+            </xsl:for-each>
         </xsl:if>
+
         <xsl:copy-of select="$note/node()"/>      
 
         </div>

+ 6 - 3
tools/regression/xsl_reports/xsl/v2/result_page.xsl

@@ -280,8 +280,11 @@
                     <b>Report Time: </b> <xsl:value-of select="$run_date"/>
                 </div>
 
-                <!--                <xsl:variable name="library_marks" select="$explicit_markup//library[ @name = $library ]/mark-unusable[ toolset/@name = $not_ordered_toolsets ]"/> -->
-                <xsl:variable name="library_marks" select="$explicit_markup//library[ @name = $library ]/mark-unusable"/>
+                <!-- library marks = library-unusable markup for toolsets in the report  -->
+                <xsl:variable name="library_marks" select="$explicit_markup//library[ @name = $library ]/mark-unusable[  meta:re_match( toolset/@name, $run_toolsets//toolset/@name ) ]"/>
+                <lmarks>
+                    <xsl:copy-of select="$library_marks"/>
+                </lmarks>
 
                 <table border="0" cellspacing="0" cellpadding="0" class="library-table" width="1%" summary="Library results">
 
@@ -368,7 +371,7 @@
                             <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:with-param name="references" select="$refid"/>
                             </xsl:call-template>
                         </td>
                         </tr>

粤ICP备19079148号