Explorar el Código

fix apperance of .lib and .dll files in test cases

[SVN r23221]
Aleksey Gurtovoy hace 22 años
padre
commit
416b100e09

+ 129 - 126
tools/regression/xsl_reports/report.py

@@ -1,12 +1,8 @@
-# (C) Copyright MetaCommunications, Inc. 2003-2004.
+# Copyright (c) MetaCommunications, Inc. 2003-2004
 #
-# Permission to use, copy, modify, distribute and sell this software
-# and its documentation for any purpose is hereby granted without fee, 
-# provided that the above copyright notice appears in all copies and 
-# that both the copyright notice and this permission notice appear in 
-# supporting documentation. No representations are made about the 
-# suitability of this software for any purpose. It is provided "as is" 
-# without express or implied warranty.
+# Use, modification and distribution are subject to the Boost Software 
+# License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy 
+# at http://www.boost.org/LICENSE_1_0.txt)
 
 import shutil
 import sys
@@ -17,9 +13,9 @@ import time
 import inspect
 import getopt
 
-report_types = [ "us", "ds", "ud", "dd", "l", "p", "x", "i" ]
+report_types = [ 'us', 'ds', 'ud', 'dd', 'l', 'p', 'x', 'i' ]
 
-if __name__ == "__main__":
+if __name__ == '__main__':
     run_dir = os.path.abspath( os.path.dirname( sys.argv[ 0 ] ) )
 else:
     run_dir = os.path.abspath( os.path.dirname( sys.modules[ __name__ ].__file__ ) )
@@ -32,23 +28,23 @@ def log_level():
    frames = inspect.stack()
    level = 0
    for i in frames[ 3: ]:
-       if i[0].f_locals.has_key( "__log__" ):
-           level = level + i[0].f_locals[ "__log__" ]
+       if i[0].f_locals.has_key( '__log__' ):
+           level = level + i[0].f_locals[ '__log__' ]
    return level
  
 
 def stdlog( message ):
-    sys.stderr.write( "# " + "    " * log_level() +  message + "\n" );
+    sys.stderr.write( '# ' + '    ' * log_level() +  message + '\n' );
     sys.stderr.flush()
 
 log = stdlog
 # log = lambda x: x
 
 def system( commands ):
-    f = open( "tmp.cmd", "w" )
-    f.write( string.join( commands, "\n" ) )
+    f = open( 'tmp.cmd', 'w' )
+    f.write( string.join( commands, '\n' ) )
     f.close()
-    rc = os.system( "tmp.cmd" )
+    rc = os.system( 'tmp.cmd' )
     return rc
 
 
@@ -63,20 +59,20 @@ def set_char( str, index, char ):
 
 
 def process_xml_file( input_file, output_file ):
-    log( "Processing test log \"%s\"" % input_file )
+    log( 'Processing test log "%s"' % input_file )
     
-    f = open( input_file, "r" )
+    f = open( input_file, 'r' )
     xml = f.readlines();
     f.close()
     
     ascii_chars = ''.join(map(chr, range(0,128)))
     nonascii_chars = ''.join(map(chr, range(128,256)))
-    translated_ascii_chars = ''.join( map( lambda x: "?", range(128,256)))
+    translated_ascii_chars = ''.join( map( lambda x: '?', range(128,256)))
     for i in string.printable:
         if ( ord( i ) < 128 and ord(i) not in ( 12, ) ):
             translated_ascii_chars = set_char( translated_ascii_chars, ord(i), i )
         
-    translated_nonascii_chars = ''.join( map( lambda x: "?", range(128,256) ) )
+    translated_nonascii_chars = ''.join( map( lambda x: '?', range(128,256) ) )
     
     mask_nonascii_translation_table = string.maketrans( ascii_chars + nonascii_chars
                                                         , translated_ascii_chars + translated_nonascii_chars
@@ -88,23 +84,23 @@ def process_xml_file( input_file, output_file ):
 
 def process_test_log_files( output_file, dir, names ):
     for file in names:
-        if os.path.basename( file ) == "test_log.xml":
+        if os.path.basename( file ) == 'test_log.xml':
             process_xml_file( os.path.join( dir, file ), output_file )
 
 
 def collect_test_logs( input_dirs, output_file ):
     __log__ = 1
-    log( "Collecting test logs ..." )
-    f = open( output_file, "w+" )
-    f.write( "<tests>\n" );
+    log( 'Collecting test logs ...' )
+    f = open( output_file, 'w+' )
+    f.write( '<tests>\n' );
     for input_dir in input_dirs:
         os.path.walk( input_dir, process_test_log_files, f );
-    f.write( "</tests>\n" );
+    f.write( '</tests>\n' );
     f.close()
 
 
 def xalan( xml_file, xsl_file,output_file, parameters = None ):
-    transform_command = "xalan"
+    transform_command = 'xalan'
     transform_command = transform_command  + ' -o "%s" ' %  output_file
     if parameters is not None:
          for i in parameters: 
@@ -116,7 +112,7 @@ def xalan( xml_file, xsl_file,output_file, parameters = None ):
                   
 
 def msxsl( xml_file, xsl_file, output_file, parameters = None ):
-    transform_command = "msxsl"
+    transform_command = 'msxsl'
     transform_command = transform_command  + ' "%s"' %  xml_file
     transform_command = transform_command  + ' "%s"' %  xsl_file
     transform_command = transform_command  + ' -o  "%s" ' %  output_file
@@ -130,14 +126,14 @@ def msxsl( xml_file, xsl_file, output_file, parameters = None ):
 
 def libxslt( xml_file, xsl_file, output_file, parameters = None ):
 
-    if sys.platform == "win32":
+    if sys.platform == 'win32':
         os.chdir( os.path.dirname( xsl_file ) )
-    transform_command = "xsltproc"
-    transform_command = transform_command + ' -o ' + "%s" % output_file
+    transform_command = 'xsltproc'
+    transform_command = transform_command + ' -o ' + '%s' % output_file
 
     if parameters is not None:
          for i in parameters: 
-             parameters[i] = parameters[i].replace( "\\", "/" )
+             parameters[i] = parameters[i].replace( '\\', '/' )
              transform_command = transform_command + ' --param %s "\'%s\'" ' % ( i, parameters[ i ] )
 
     transform_command = transform_command + ' "%s" ' % xsl_file
@@ -146,16 +142,20 @@ def libxslt( xml_file, xsl_file, output_file, parameters = None ):
     os.system( transform_command )    
 
 
-registered_xsltprocs = {   "msxsl": msxsl
-                         , "xalan": xalan
-                         , "libxslt": libxslt
+registered_xsltprocs = {   'msxsl': msxsl
+                         , 'xalan': xalan
+                         , 'libxslt': libxslt
                          }
 
 def map_path( path ):
     return os.path.join( run_dir, path ) 
 
 def xsl_path( xsl_file_name ):
-    return map_path( os.path.join( "xsl", xsl_file_name ) )
+    return map_path( os.path.join( 'xsl', xsl_file_name ) )
+
+def makedirs( path ):
+    if not os.path.exists( path ):
+        os.makedirs( path )
 
 def make_result_pages( test_results_file
                        , expected_results_file
@@ -168,7 +168,7 @@ def make_result_pages( test_results_file
                        , xslt_proc_name
                        , reports
                        ):
-    log( "Producing the reports..." )
+    log( 'Producing the reports...' )
     __log__ = 1
     
     output_dir = os.path.join( results_dir, result_prefix )
@@ -177,96 +177,99 @@ def make_result_pages( test_results_file
         
     xslt_proc = registered_xsltprocs[ xslt_proc_name ]
     
-    if comment_file != "":
+    if comment_file != '':
         comment_file = os.path.abspath( comment_file )
         
-    if expected_results_file != "":
+    if expected_results_file != '':
         expected_results_file = os.path.abspath( expected_results_file )
     else:
-        expected_results_file = os.path.abspath( map_path( "empty_expected_results.xml" ) )
+        expected_results_file = os.path.abspath( map_path( 'empty_expected_results.xml' ) )
         
 
-    extended_test_results = os.path.join( output_dir, "extended_test_results.xml" )
-    if "x" in reports:    
-        log( "    Merging with expected results..." )
+    extended_test_results = os.path.join( output_dir, 'extended_test_results.xml' )
+    if 'x' in reports:    
+        log( '    Merging with expected results...' )
         xslt_proc( test_results_file
-                   , xsl_path( "add_expected_results.xsl" )
+                   , xsl_path( 'add_expected_results.xsl' )
                    , extended_test_results
-                   , { "expected_results_file": expected_results_file, "failures_markup_file" : failures_markup_file }
+                   , { 'expected_results_file': expected_results_file, 'failures_markup_file' : failures_markup_file }
                  )
 
-    links = os.path.join( output_dir, "links.html"  )
+    links = os.path.join( output_dir, 'links.html' )
     
-    test_output_dir  = os.path.join( output_dir, "output"  )
-    if not os.path.exists(  test_output_dir ):
-        os.makedirs( test_output_dir )
+    makedirs( os.path.join( output_dir, 'output' ) )
+    for mode in ( 'developer', 'user' ):
+        makedirs( os.path.join( output_dir, mode , 'output' ) )
         
-    if "l" in reports:        
-        log( "    Making test output files..." )
+    if 'l' in reports:        
+        log( '    Making test output files...' )
         xslt_proc( extended_test_results
-                   , xsl_path( "links_page.xsl" )
+                   , xsl_path( 'links_page.xsl' )
                    , links
                    , {
-                     "source": source
-                     , "run_date": run_date 
-                     , "comment_file": comment_file
-                     , "explicit_markup_file" : failures_markup_file
+                     'source': source
+                     , 'run_date': run_date 
+                     , 'comment_file': comment_file
+                     , 'explicit_markup_file' : failures_markup_file
                      }
                    )
 
-    issues = os.path.join( output_dir, "issues.html"  )
-    if "i" in reports:
-        log( "    Making issues list..." )
+    issues = os.path.join( output_dir, 'developer', 'issues.html'  )
+    if 'i' in reports:
+        log( '    Making issues list...' )
         xslt_proc( extended_test_results
-                   , xsl_path( "issues_page.xsl" )
+                   , xsl_path( 'issues_page.xsl' )
                    , issues
                    , {
-                     "source": source
-                     , "run_date": run_date 
-                     , "comment_file": comment_file
-                     , "explicit_markup_file" : failures_markup_file
+                     'source': source
+                     , 'run_date': run_date 
+                     , 'comment_file': comment_file
+                     , 'explicit_markup_file' : failures_markup_file
                      }
                    )
                    
-    for mode in ( "developer", "user" ):
-        if mode[0] + "d" in reports:
-            log( "    Making detailed %s  report..." % mode )
+    for mode in ( 'developer', 'user' ):
+        if mode[0] + 'd' in reports:
+            log( '    Making detailed %s  report...' % mode )
             xslt_proc(  extended_test_results
-                        , xsl_path( "result_page.xsl" )
-                        , os.path.join( output_dir, "%s_%s" % ( mode, "result_page.html" ) )
-                        , { "links_file": "links.html"
-                            , "mode": mode
-                            , "source": source
-                            , "run_date": run_date 
-                            , "comment_file": comment_file
-                            , "expected_results_file": expected_results_file
-                            , "explicit_markup_file" : failures_markup_file
+                        , xsl_path( 'result_page.xsl' )
+                        , os.path.join( output_dir, mode, 'index.html' )
+                        , { 'links_file': 'links.html'
+                            , 'mode': mode
+                            , 'source': source
+                            , 'run_date': run_date 
+                            , 'comment_file': comment_file
+                            , 'expected_results_file': expected_results_file
+                            , 'explicit_markup_file' : failures_markup_file
                             }
                         );
 
 
-    for mode in ( "developer", "user" ):
-        if mode[0] + "s" in reports:
-            log( "    Making summary %s  report..." % mode )
+    for mode in ( 'developer', 'user' ):
+        if mode[0] + 's' in reports:
+            log( '    Making summary %s  report...' % mode )
             xslt_proc(  extended_test_results
-                        , xsl_path( "summary_page.xsl" )
-                        , os.path.join( output_dir, "%s_%s" % ( mode, "summary_page.html" ) )
-                        , { "mode" : mode 
-                            , "source": source
-                            , "run_date": run_date 
-                            , "comment_file": comment_file
-                            , "explicit_markup_file" : failures_markup_file
+                        , xsl_path( 'summary_page.xsl' )
+                        , os.path.join( output_dir, mode, 'summary.html' )
+                        , { 'mode' : mode 
+                            , 'source': source
+                            , 'run_date': run_date 
+                            , 'comment_file': comment_file
+                            , 'explicit_markup_file' : failures_markup_file
                             }
                         );
 
-    if "e" in reports:
-        log( "    Generating expected_results ..." )
+    if 'e' in reports:
+        log( '    Generating expected_results ...' )
         xslt_proc( extended_test_results
-                   , xsl_path( "produce_expected_results.xsl" )
-                   , os.path.join( output_dir, "expected_results.xml" )
+                   , xsl_path( 'produce_expected_results.xsl' )
+                   , os.path.join( output_dir, 'expected_results.xml' )
                    )
     
-    shutil.copyfile( xsl_path( "master.css" ),  os.path.join( output_dir, "master.css" ) )
+    shutil.copyfile( 
+          xsl_path( 'html/master.css' )
+        , os.path.join( output_dir, 'master.css' )
+        )
 
 
 def build_experimental_reports( locate_root_dir
@@ -280,12 +283,12 @@ def build_experimental_reports( locate_root_dir
                                 , dont_collect_logs = 0
                                 , reports = report_types
                                 ):
-    ( run_date ) = time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime() )
-    test_results_file = os.path.join( results_dir, "test_results.xml" )
-    bin_boost_dir = os.path.join( locate_root_dir, "bin", "boost" )
-    print "dont_collect_logs: %s" % dont_collect_logs
+    ( run_date ) = time.strftime('%a, %d %b %Y %H:%M:%S +0000', time.gmtime() )
+    test_results_file = os.path.join( results_dir, 'test_results.xml' )
+    bin_boost_dir = os.path.join( locate_root_dir, 'bin', 'boost' )
+    print 'dont_collect_logs: %s' % dont_collect_logs
     if not dont_collect_logs:
-        collect_test_logs( [ os.path.join( bin_boost_dir, "libs" ), os.path.join( bin_boost_dir, "status" ) ]
+        collect_test_logs( [ os.path.join( bin_boost_dir, 'libs' ), os.path.join( bin_boost_dir, 'status' ) ]
                            , test_results_file
                            )
 
@@ -303,49 +306,49 @@ def build_experimental_reports( locate_root_dir
 
 
 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="
-                                                                     , "xsltproc="
-                                                                     , "dont-collect-logs"
-                                                                     , "reports="
-                                                                     , "help"
+    ( option_pairs, rest_args ) = getopt.getopt( sys.argv[1:], '', [ 'locate-root='
+                                                                     , 'tag='
+                                                                     , 'expected-results='
+                                                                     , 'failures-markup='
+                                                                     , 'comment='
+                                                                     , 'results-dir='
+                                                                     , 'results-prefix='
+                                                                     , 'xsltproc='
+                                                                     , 'dont-collect-logs'
+                                                                     , 'reports='
+                                                                     , 'help'
                                                                      ] )
-    options = { "--comment": ""
-                , "--expected-results": ""
-                , "--failures-markup": ""
-                , "--reports" : string.join( report_types, "," ) }
+    options = { '--comment': ''
+                , '--expected-results': ''
+                , '--failures-markup': ''
+                , '--reports' : string.join( report_types, ',' ) }
     
     map( lambda x: options.__setitem__( x[0], x[1] ), option_pairs )
 
-    if ( options.has_key( "--help" ) or len( options.keys() ) == 4 ):
+    if ( options.has_key( '--help' ) or len( options.keys() ) == 4 ):
         usage()
         sys.exit( 1 )
 
-    if not options.has_key( "--results-dir" ):
-         options[ "--results-dir" ] = options[ "--locate-root" ]
+    if not options.has_key( '--results-dir' ):
+         options[ '--results-dir' ] = options[ '--locate-root' ]
          
-    return ( options[ "--locate-root" ]
-             , options[ "--tag" ]
-             , options[ "--expected-results" ]
-             , options[ "--failures-markup" ]
-             , options[ "--comment" ]
-             , options[ "--results-dir" ]
-             , options[ "--results-prefix" ]
-             , options[ "--xsltproc" ]
+    return ( options[ '--locate-root' ]
+             , options[ '--tag' ]
+             , options[ '--expected-results' ]
+             , options[ '--failures-markup' ]
+             , options[ '--comment' ]
+             , options[ '--results-dir' ]
+             , options[ '--results-prefix' ]
+             , options[ '--xsltproc' ]
              , options.has_key( '--dont-collect-logs' )
-             , options[ "--reports" ].split( "," )
+             , options[ '--reports' ].split( ',' )
              )
 
 def usage():
-    print "Usage: %s [options]" % os.path.basename( sys.argv[0] )
-    print    """
+    print 'Usage: %s [options]' % os.path.basename( sys.argv[0] )
+    print    '''
 \t--locate-root       the same as --locate-root in compiler_status
-\t--tag               the tag for the results (i.e. "CVS main trunk")
+\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--failures-markup   the file with the failures markup
@@ -373,7 +376,7 @@ The following options are useful in debugging:
 \t                        p  - patches
 \t                        x  - extended results file
 \t                        i  - issues
-    """
+    '''
 
 def main():
     apply( build_experimental_reports, accept_args( sys.argv[ 1 : ] ) )

+ 99 - 0
tools/regression/xsl_reports/test_results.xsd

@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+
+    <xs:simpleType name="test_result">
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:enumeration value="fail"/>
+            <xs:enumeration value="succeed"/>
+        </xs:restriction>
+    </xs:simpleType>
+    
+    <xs:simpleType name="run_test_result">
+        <xs:restriction base="test_result">
+            <xs:enumeration value="note"/>
+        </xs:restriction>
+    </xs:simpleType>
+            
+    <xs:simpleType name="test_type">
+        <xs:restriction base="xs:NMTOKEN">
+            <xs:enumeration value="compile"/>
+            <xs:enumeration value="compile_fail"/>
+            <xs:enumeration value="lib"/>
+            <xs:enumeration value="pyd"/>
+            <xs:enumeration value="run"/>
+            <xs:enumeration value="run_pyd"/>
+        </xs:restriction>
+    </xs:simpleType>
+                        
+    <xs:element name="compile">
+        <xs:complexType>
+            <xs:simpleContent>
+                <xs:extension base="xs:string">
+                    <xs:attribute name="result" type="test_result" use="required"/>
+                    <xs:attribute name="timestamp" type="xs:string" use="required"/>
+                </xs:extension>
+            </xs:simpleContent>
+        </xs:complexType>
+    </xs:element>
+
+    <xs:element name="link">
+        <xs:complexType>
+            <xs:simpleContent>
+                <xs:extension base="xs:string">
+                    <xs:attribute name="result" type="test_result" use="required"/>
+                    <xs:attribute name="timestamp" type="xs:string" use="required"/>
+                </xs:extension>
+            </xs:simpleContent>
+        </xs:complexType>
+    </xs:element>
+
+    <xs:element name="lib">
+        <xs:complexType>
+            <xs:simpleContent>
+                <xs:extension base="xs:string">
+                    <xs:attribute name="result" type="test_result" use="required"/>
+                    <xs:attribute name="timestamp" type="xs:string" use="required"/>
+                </xs:extension>
+            </xs:simpleContent>
+        </xs:complexType>
+    </xs:element>
+
+
+    <xs:element name="run">
+        <xs:complexType>
+            <xs:simpleContent>
+                <xs:extension base="xs:string">
+                    <xs:attribute name="result" type="run_test_result" use="required"/>
+                    <xs:attribute name="timestamp" type="xs:string" use="required"/>
+                </xs:extension>
+            </xs:simpleContent>
+        </xs:complexType>
+    </xs:element>
+
+    <xs:element name="test-log">
+        <xs:complexType>
+            <xs:sequence>
+                <xs:element ref="compile" minOccurs="0"/>
+                <xs:element ref="link" minOccurs="0"/>
+                <xs:element ref="run" minOccurs="0"/>
+                <xs:element ref="lib" minOccurs="0"/>
+            </xs:sequence>
+            <xs:attribute name="library" type="xs:string" use="required"/>
+            <xs:attribute name="test-name" type="xs:string" use="required"/>
+            <xs:attribute name="test-type" type="test_type" use="required"/>
+            <xs:attribute name="test-program" type="xs:string" use="required"/>
+            <xs:attribute name="target-directory" type="xs:string" use="required"/>
+            <xs:attribute name="toolset" type="xs:string" use="required"/>
+            <xs:attribute name="show-run-output" type="xs:boolean" use="required"/>
+        </xs:complexType>
+    </xs:element>
+
+    <xs:element name="tests">
+        <xs:complexType>
+            <xs:sequence>
+                <xs:element ref="test-log" maxOccurs="unbounded"/>
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>
+
+</xs:schema>

+ 5 - 0
tools/regression/xsl_reports/xsl/common.xsl

@@ -48,6 +48,11 @@
     
   </xsl:template>
 
+  <func:function name="meta:is_test_log_a_test_case">
+      <xsl:param name="test_log"/>      
+      <func:result select="$test_log/@test-type='compile' or $test_log/@test-type='compile_fail' or $test_log/@test-type='run' or $test_log/@test-type='run_pyd'"/>
+  </func:function>
+
   <func:function name="meta:is_unusable">
       <xsl:param name="explicit_markup"/>
       <xsl:param name="library"/>

+ 1 - 1
tools/regression/xsl_reports/xsl/issues_page.xsl

@@ -62,7 +62,7 @@
     <!-- libraries -->
     <xsl:variable name="libraries" select="//test-log[ @library != '' and generate-id(.) = generate-id( key('library_key',@library)[1] )  ]/@library"/>
 
-    <xsl:variable name="unexpected_test_cases" select="//test-log[ @status='unexpected' and @result='fail' and @toolset = $required_toolset_names]"/>
+    <xsl:variable name="unexpected_test_cases" select="//test-log[ @status='unexpected' and @result='fail' and @toolset = $required_toolset_names and meta:is_test_log_a_test_case(.)]"/>
 
     <func:function name="meta:get_library_tests">
         <xsl:param name="tests"/>

+ 3 - 1
tools/regression/xsl_reports/xsl/produce_expected_results.xsl

@@ -13,7 +13,9 @@
   </xsl:template>
   
   <xsl:template match="test-log">
-    <test-result library="{@library}" test-name="{@test-name}" toolset="{@toolset}" result="{@result}" />
+    <xsl:if test="meta:is_test_log_a_test_case(.)">
+        <test-result library="{@library}" test-name="{@test-name}" toolset="{@toolset}" result="{@result}" />
+    </xsl:if>
   </xsl:template>
 
 </xsl:stylesheet>

+ 7 - 6
tools/regression/xsl_reports/xsl/result_page.xsl

@@ -13,6 +13,7 @@
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
     xmlns:exsl="http://exslt.org/common"
     xmlns:func="http://exslt.org/functions"
+    xmlns:set="http://exslt.org/sets"
     xmlns:meta="http://www.meta-comm.com"
     extension-element-prefixes="func exsl"
     version="1.0">
@@ -49,10 +50,6 @@
         name="test_name_key" 
         match="test-log" 
         use="concat( @library, '&gt;@&lt;', @test-name )"/>
-    <xsl:key 
-        name="library_key" 
-        match="test-log" 
-        use="@library"/>
     <xsl:key name="toolset_key" match="test-log" use="@toolset"/>
 
     <!-- toolsets -->
@@ -71,7 +68,8 @@
     <xsl:variable name="ordered_toolsets" select="exsl:node-set( $ordered_toolsets_fragment )"/>
 
     <!-- libraries -->
-    <xsl:variable name="libraries" select="//test-log[ @library != '' and generate-id(.) = generate-id( key('library_key',@library)[1] )  ]/@library"/>
+    <xsl:variable name="test_case_logs" select="//test-log[ meta:is_test_log_a_test_case(.) ]"/>
+    <xsl:variable name="libraries" select="set:distinct( $test_case_logs/@library )"/>
 
     <xsl:template name="insert_toolsets_row">
         <xsl:param name="library"/>
@@ -134,6 +132,9 @@
             <xsl:when test="$test_type='run_fail'">     <xsl:text>rf</xsl:text> </xsl:when>
             <xsl:when test="$test_type='compile'">      <xsl:text>c</xsl:text>  </xsl:when>
             <xsl:when test="$test_type='compile_fail'"> <xsl:text>cf</xsl:text> </xsl:when>
+            <xsl:otherwise>
+                <xsl:message terminate="yes">Incorrect test type "<xsl:value-of select="$test_type"/>"</xsl:message>
+            </xsl:otherwise>
             </xsl:choose>
         </a>
         </td>
@@ -334,7 +335,7 @@
 
                     <tbody>
                         <!-- lib_tests = test_log* -->
-                        <xsl:variable name="lib_tests" select="//test-log[@library = $library]" /> 
+                        <xsl:variable name="lib_tests" select="$test_case_logs[@library = $library]" /> 
 
                         <!-- lib_unique_test_names = test_log* -->
                         <xsl:variable name="lib_unique_test_names" 

+ 8 - 10
tools/regression/xsl_reports/xsl/summary_page.xsl

@@ -13,6 +13,7 @@
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
     xmlns:exsl="http://exslt.org/common"
     xmlns:func="http://exslt.org/functions"
+    xmlns:set="http://exslt.org/sets"
     xmlns:meta="http://www.meta-comm.com"
     extension-element-prefixes="func exsl"
     version="1.0">
@@ -39,10 +40,6 @@
         name="library_test_name_key" 
         match="test-log" 
         use="concat( @library, '&gt;@&lt;', @test-name )"/>
-    <xsl:key 
-        name="library_key" 
-        match="test-log" 
-        use="@library"/>
     <xsl:key name="toolset_key" match="test-log" use="@toolset"/>
     <xsl:key name="test_name_key"  match="test-log" use="@test-name "/>
 
@@ -63,7 +60,8 @@
         
     <!-- libraries -->
 
-    <xsl:variable name="libraries" select="//test-log[ generate-id(.) = generate-id( key('library_key',@library)[1] ) and @library != '' ]/@library"/>
+    <xsl:variable name="test_case_logs" select="//test-log[ meta:is_test_log_a_test_case(.) ]"/>
+    <xsl:variable name="libraries" select="set:distinct( $test_case_logs/@library )"/>
 
     <xsl:variable name="sorted_libraries_output">
         <xsl:for-each select="$libraries">
@@ -132,12 +130,12 @@
             </tfoot>
           
             <tbody>
-                <xsl:variable name="test_logs" select="//test-log"/>
+                <xsl:variable name="test_logs" select="$test_case_logs"/>
 
                 <!-- for each library -->
                 <xsl:for-each select="$sorted_libraries">
                 <xsl:variable name="library" select="."/>
-                <xsl:variable name="current_row" select="$test_logs[ @library=$library ]"/>
+                <xsl:variable name="current_row" select="$test_logs[ @library=$library]"/>
 
                 <xsl:variable name="expected_test_count" select="count( $current_row[ generate-id(.) = generate-id( key('test_name_key',@test-name)[1] ) ] )"/>
                 <xsl:variable name="library_header">
@@ -293,9 +291,9 @@
         </xsl:when>
         <xsl:otherwise>
             <xsl:message terminate="yes">
-            Unknown status
-            <xsl:copy-of select="$current_cell">
-            </xsl:copy-of>
+                Unknown status
+                <xsl:copy-of select="$current_cell">
+                </xsl:copy-of>
             </xsl:message>
         </xsl:otherwise>
         </xsl:choose>

粤ICP备19079148号