mirror of
https://github.com/boostorg/boost.git
synced 2025-04-08 14:44:02 +00:00
Implement test case categories
[SVN r28758]
This commit is contained in:
parent
b7f07f81ed
commit
930ead461e
7 changed files with 55 additions and 61 deletions
|
@ -1394,7 +1394,7 @@ for more information.
|
|||
</mark-failure>
|
||||
</test>
|
||||
|
||||
<test name="is_convertible_fail" corner-case="yes">
|
||||
<test name="is_convertible_fail" category="Corner-case tests">
|
||||
<mark-failure>
|
||||
<toolset name="borland"/>
|
||||
<toolset name="borland-5_6_4"/>
|
||||
|
@ -1417,7 +1417,7 @@ for more information.
|
|||
</mark-failure>
|
||||
</test>
|
||||
|
||||
<test name="indirect_iter_member_types" corner-case="yes"/>
|
||||
<test name="indirect_iter_member_types" category="Corner-case tests"/>
|
||||
|
||||
<mark-expected-failures>
|
||||
<test name="indirect_iter_member_types"/>
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
<xs:element ref="note" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="name" type="xs:string" use="required"/>
|
||||
<xs:attribute name="corner-case" type="xs:string"/>
|
||||
<xs:attribute name="category" type="xs:string"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
|
|
|
@ -112,21 +112,22 @@ def make_expicit_failure_markup( num_of_libs, num_of_toolsets, num_of_tests ):
|
|||
|
||||
for i_test in range( 0, num_of_tests ):
|
||||
|
||||
corner_case_test = 0
|
||||
category = 0
|
||||
explicitly_marked_failure = 0
|
||||
unresearched = 0
|
||||
|
||||
if i_test > num_of_tests - 3: corner_case_test = 1
|
||||
if i_test % 2 == 0:
|
||||
category = i_test % 3
|
||||
|
||||
if i_test % 3 == 0:
|
||||
explicitly_marked_failure = 1
|
||||
if i_test % 2 == 0:
|
||||
unresearched = 1
|
||||
|
||||
if corner_case_test or explicitly_marked_failure:
|
||||
if category or explicitly_marked_failure:
|
||||
test_attrs = { "name": make_test_name( i_library, i_test ) }
|
||||
if corner_case_test:
|
||||
test_attrs[ "corner-case" ] = "yes"
|
||||
if category:
|
||||
test_attrs[ "category" ] = "Category %s" % category
|
||||
g.startElement( "test", test_attrs )
|
||||
if explicitly_marked_failure:
|
||||
failure_attrs = {}
|
||||
|
|
3
tools/regression/xsl_reports/test/expected_results.xml
Normal file
3
tools/regression/xsl_reports/test/expected_results.xml
Normal file
|
@ -0,0 +1,3 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<expected-failures>
|
||||
</expected-failures>
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
|
||||
Copyright MetaCommunications, Inc. 2003-2004.
|
||||
Copyright MetaCommunications, Inc. 2003-2005.
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See
|
||||
accompanying file LICENSE_1_0.txt or copy at
|
||||
|
@ -66,9 +66,20 @@ http://www.boost.org/LICENSE_1_0.txt)
|
|||
<xsl:for-each select="$expected_results">
|
||||
|
||||
<xsl:variable name="expected_results_test_case" select="key( 'trk', concat( $toolset, '-', $library, '-', $test-name ) )"/>
|
||||
<xsl:variable name="test_failures_markup" select="$failures_markup//library[@name=$library]/test[ meta:re_match( @name, $test-name ) ]/mark-failure/toolset[ meta:re_match( @name, $toolset ) ]/.."/>
|
||||
<xsl:variable name="test_case_markup" select="$failures_markup//library[@name=$library]/test[ meta:re_match( @name, $test-name ) ]"/>
|
||||
<xsl:variable name="test_failures_markup" select="$test_case_markup/mark-failure/toolset[ meta:re_match( @name, $toolset ) ]/.."/>
|
||||
<xsl:variable name="test_failures_markup2" select="$failures_markup//library[@name=$library]/mark-expected-failures/test[ meta:re_match( @name, $test-name ) ]/../toolset[ meta:re_match( @name, $toolset ) ]/.."/>
|
||||
|
||||
<xsl:variable name="category">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$test_case_markup/@category">
|
||||
<xsl:value-of select="$test_case_markup/@category"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>0</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
|
||||
|
||||
<xsl:variable name="is_new">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$expected_results_test_case">
|
||||
|
@ -194,6 +205,7 @@ http://www.boost.org/LICENSE_1_0.txt)
|
|||
<xsl:attribute name="expected-reason"><xsl:value-of select="$expected_reason"/></xsl:attribute>
|
||||
<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:attribute name="category"><xsl:value-of select="$category"/></xsl:attribute>
|
||||
<xsl:element name="notes"><xsl:copy-of select="$notes"/></xsl:element>
|
||||
|
||||
<xsl:apply-templates select="$test_log/node()" />
|
||||
|
|
|
@ -240,8 +240,9 @@ td.required-toolset-name
|
|||
font-weight: bold;
|
||||
}
|
||||
|
||||
td.library-corner-case-header
|
||||
td.library-test-category-header
|
||||
{
|
||||
border-top: 1px solid gray;
|
||||
}
|
||||
|
||||
tr.summary-row-first td
|
||||
|
|
|
@ -330,47 +330,20 @@ http://www.boost.org/LICENSE_1_0.txt)
|
|||
</tfoot>
|
||||
|
||||
<tbody>
|
||||
<!-- lib_tests = test_log* -->
|
||||
<xsl:variable name="lib_tests" select="$test_case_logs[@library = $library]" />
|
||||
|
||||
<!-- lib_unique_test_names = test_log* -->
|
||||
<xsl:variable name="lib_unique_test_names"
|
||||
<xsl:variable name="lib_unique_tests_list"
|
||||
select="$lib_tests[ generate-id(.) = generate-id( key('test_name_key', concat( @library, '>@<', @test-name ) ) ) ]" />
|
||||
|
||||
<xsl:variable name="lib_corner_case_tests_markup" select="$explicit_markup//library[ @name = $library ]/test[ @corner-case='yes' ]"/>
|
||||
|
||||
<xsl:variable name="lib_general_tests"
|
||||
select="meta:order_tests_by_name( $lib_unique_test_names[ not( @test-name = $lib_corner_case_tests_markup/@name ) ] )"/>
|
||||
|
||||
|
||||
<xsl:variable name="lib_corner_case_tests" select="meta:order_tests_by_name( $lib_unique_test_names[ @test-name = $lib_corner_case_tests_markup/@name ] ) " />
|
||||
|
||||
|
||||
<!-- general tests section -->
|
||||
<xsl:variable name="lib_tests_by_category"
|
||||
select="meta:order_tests_by_category( $lib_unique_tests_list )"/>
|
||||
|
||||
<xsl:call-template name="insert_test_section">
|
||||
<xsl:with-param name="library" select="$library"/>
|
||||
<xsl:with-param name="section_test_names" select="$lib_general_tests"/>
|
||||
<xsl:with-param name="section_test_names" select="$lib_tests_by_category"/>
|
||||
<xsl:with-param name="lib_tests" select="$lib_tests"/>
|
||||
<xsl:with-param name="toolsets" select="$run_toolsets"/>
|
||||
</xsl:call-template>
|
||||
|
||||
<!-- corner-case tests section -->
|
||||
|
||||
<xsl:if test="count( $lib_corner_case_tests ) > 0">
|
||||
<tr>
|
||||
<!--<td colspan="2"> </td> -->
|
||||
<td class="library-corner-case-header" colspan="{count($run_toolsets/platforms/platform/runs/run/toolset) + 3 }" align="center">Corner-case tests</td>
|
||||
<!--<td> </td>-->
|
||||
</tr>
|
||||
|
||||
<xsl:call-template name="insert_test_section">
|
||||
<xsl:with-param name="library" select="$library"/>
|
||||
<xsl:with-param name="section_test_names" select="$lib_corner_case_tests"/>
|
||||
<xsl:with-param name="lib_tests" select="$lib_tests"/>
|
||||
</xsl:call-template>
|
||||
|
||||
</xsl:if>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<xsl:if test="count( $library_marks/note ) > 0 ">
|
||||
|
@ -569,7 +542,6 @@ http://www.boost.org/LICENSE_1_0.txt)
|
|||
<xsl:param name="library"/>
|
||||
<xsl:param name="test_name"/>
|
||||
<xsl:param name="test_results"/>
|
||||
<xsl:param name="toolsets"/>
|
||||
<xsl:param name="line_mod"/>
|
||||
|
||||
<xsl:variable name="test_program">
|
||||
|
@ -620,33 +592,38 @@ http://www.boost.org/LICENSE_1_0.txt)
|
|||
|
||||
<xsl:template name="insert_test_section">
|
||||
<xsl:param name="library"/>
|
||||
<xsl:param name="section_test_nanes"/>
|
||||
<xsl:param name="section_test_names"/>
|
||||
<xsl:param name="lib_tests"/>
|
||||
<xsl:param name="toolsets"/>
|
||||
|
||||
<xsl:variable name="category_span" select="count($toolsets/platforms/platform/runs/run/toolset) + 3"/>
|
||||
|
||||
<xsl:for-each select="$section_test_names">
|
||||
|
||||
<xsl:variable name="test_name" select="@test-name"/>
|
||||
<xsl:variable name="category_start" select="position() = 1 or @category != preceding-sibling::*[1]/@category"/>
|
||||
<xsl:variable name="category_end" select="position() = last() or @category != following-sibling::*[1]/@category"/>
|
||||
|
||||
<xsl:variable name="line_mod">
|
||||
<xsl:choose>
|
||||
<xsl:when test="1 = last()">
|
||||
<xsl:text>-single</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="generate-id( . ) = generate-id( $section_test_names[1] )">
|
||||
<xsl:text>-first</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="generate-id( . ) = generate-id( $section_test_names[last()] )">
|
||||
<xsl:text>-last</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text></xsl:text>
|
||||
</xsl:otherwise>
|
||||
<xsl:when test="$category_start and $category_end"><xsl:text>-single</xsl:text></xsl:when>
|
||||
<xsl:when test="$category_start"><xsl:text>-first</xsl:text></xsl:when>
|
||||
<xsl:when test="$category_end"><xsl:text>-last</xsl:text></xsl:when>
|
||||
<xsl:otherwise><xsl:text></xsl:text></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
|
||||
|
||||
<xsl:if test="$category_start and @category != '0'">
|
||||
<tr>
|
||||
<td class="library-test-category-header" colspan="{$category_span}" align="center">
|
||||
<xsl:value-of select="@category"/>
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:call-template name="insert_test_line">
|
||||
<xsl:with-param name="library" select="$library"/>
|
||||
<xsl:with-param name="test_results" select="$lib_tests[ @test-name = $test_name ]"/>
|
||||
<xsl:with-param name="toolsets" select="$toolsets"/>
|
||||
<xsl:with-param name="test_name" select="$test_name"/>
|
||||
<xsl:with-param name="line_mod" select="$line_mod"/>
|
||||
</xsl:call-template>
|
||||
|
@ -654,12 +631,12 @@ http://www.boost.org/LICENSE_1_0.txt)
|
|||
|
||||
</xsl:template>
|
||||
|
||||
<func:function name="meta:order_tests_by_name">
|
||||
<func:function name="meta:order_tests_by_category">
|
||||
<xsl:param name="tests"/>
|
||||
|
||||
<xsl:variable name="a">
|
||||
<xsl:for-each select="$tests">
|
||||
<xsl:sort select="@test-name" order="ascending"/>
|
||||
<xsl:sort select="concat( @category, '|', @test-name )" order="ascending"/>
|
||||
<xsl:copy-of select="."/>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
|
|
Loading…
Add table
Reference in a new issue