Misha Bergal 21 лет назад
Родитель
Сommit
fa530fe844

+ 33 - 11
tools/regression/xsl_reports/test/common.py

@@ -4,31 +4,49 @@ def make_test_name( library_idx, test_idx ):
     return "test_%02d_%02d" % ( library_idx, test_idx )
 
 def make_library_name( library_idx ):
-    return "library_%02d" % library_idx
+    if library_idx % 4 in ( 0, 1 ):
+        return "library_%02d/%02d" % ( int( library_idx / 4 ) * 4, library_idx % 4 )
+    else:
+        return "library_%02d" % library_idx
 
 def make_toolset_name( toolset_idx ):
     return "toolset_%02d" % toolset_idx
 
-def make_library_target_directory( library_idx, toolset_idx ):
-    return "lib/%s/%s" % ( make_library_name( library_idx )
+def make_library_target_directory( library_idx, toolset_idx, variant = None ):
+    base = "lib/%s/%s" % ( make_library_name( library_idx )
                            , make_toolset_name( toolset_idx ) )
+    if variant is not None:
+        return "%s/%s" % ( base, variant )
+    else:
+        return base
 
-def make_test_target_directory( library_idx, toolset_idx, test_idx ):
-    return "%s/%s/%s" % ( make_library_name( library_idx )
+def make_test_target_directory( library_idx, toolset_idx, test_name, variant ):
+    base = "%s/%s/%s" % ( make_library_name( library_idx )
                           , make_toolset_name( toolset_idx )
-                          , make_test_name( test_idx ) )
-
-
-def make_test_log( xml_generator, library_idx, toolset_idx, test_name, test_type, test_result, show_run_output ):
+                          , test_name )
+    if variant is not None:
+        return "%s/%s" % ( base, variant )
+    else:
+        return base
+
+
+def make_test_log( xml_generator
+                   , library_idx
+                   , toolset_idx
+                   , test_name
+                   , test_type
+                   , test_result
+                   , show_run_output
+                   , variant ):
     library = make_library_name( library_idx )
     toolset_name = make_toolset_name( toolset_idx )
     
     target_directory = ""
 
     if test_type == "run":
-        target_directory = "%s/%s/%s" % ( library, toolset_name, test_name )
+        target_directory = make_test_target_directory( library_idx, toolset_idx, test_name, variant )
     if test_type == "lib":
-        target_directory = make_library_target_directory( library_idx, toolset_idx )
+        target_directory = make_library_target_directory( library_idx, toolset_idx, variant )
         
     xml_generator.startElement( "test-log", { "library": library
                                   , "test-name":  test_name
@@ -121,3 +139,7 @@ def make_expicit_failure_markup( num_of_libs, num_of_toolsets, num_of_tests ):
         
     g.endElement( "explicit-failures-markup" )
 
+
+def make_expected_results( num_of_libs, num_of_toolsets, num_of_tests ):
+    pass
+

+ 25 - 6
tools/regression/xsl_reports/test/generate_test_results.py

@@ -4,8 +4,8 @@ import xml.sax.saxutils
 import os
 import time
 
-num_of_libs = 2
-num_of_runners = 3
+num_of_libs = 5
+num_of_runners = 5
 num_of_toolsets = 3
 num_of_tests = 10
 
@@ -28,7 +28,11 @@ def make_test_results():
     for i_runner in range( 0, num_of_runners ):
         runner_id = "runner_%02d" % i_runner
         g = xml.sax.saxutils.XMLGenerator( open( os.path.join( tag, runner_id + ".xml" ), "w" ) )
-        platform = "Win32"
+        if i_runner % 2:
+            platform = "Win32"
+        else:
+            platform = "Unix"
+            
         g.startElement( "test-run", { "platform": platform
                                       , "runner": runner_id
                                       , "timestamp": time.strftime( "%a, %d %b %Y %H:%M:%S +0000"
@@ -52,7 +56,8 @@ def make_test_results():
                                       , test_name = ""
                                       , test_type = "lib"
                                       , test_result = test_result
-                                      , show_run_output = "false" )
+                                      , show_run_output = "false"
+                                      , variant = None )
 
     
         for i_lib in range( 0, num_of_libs ):
@@ -80,8 +85,22 @@ def make_test_results():
 
                     if test_result == "success" and ( 0 == i_test % 5 ):
                         show_run_output = "true"
-                        
-                    common.make_test_log( g, i_lib, i_toolset, test_name, test_type, test_result, show_run_output )
+
+                    if i_toolset == 2:
+                        variants = [ "static-lib", "shared-lib" ]
+                    else:
+                        print i_toolset
+                        variants = [ None ]
+
+                    for variant in variants:
+                        common.make_test_log( xml_generator = g
+                                              , library_idx = i_lib
+                                              , toolset_idx = i_toolset
+                                              , test_name = test_name
+                                              , test_type = test_type
+                                              , test_result = test_result
+                                              , show_run_output = show_run_output
+                                              , variant = variant )
         g.endElement( "test-run" )
 
 

+ 36 - 0
tools/regression/xsl_reports/test/restrict_to_library.xsl

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="1.0">
+
+    <xsl:output method="xml" encoding="ascii"/>
+    <xsl:param name="library"/>
+
+
+    <xsl:template match="/">
+        <xsl:message>
+            <xsl:value-of select="$library"/>
+        </xsl:message>
+        <xsl:apply-templates/>
+    </xsl:template>
+
+    <xsl:template match="*">
+        <xsl:copy>
+            <xsl:apply-templates select="@*"/>
+            <xsl:apply-templates />
+        </xsl:copy>
+    </xsl:template>
+    
+    <xsl:template match="test-log">          
+      <xsl:if test="@library=$library">
+          <xsl:copy>
+              <xsl:apply-templates select="@*"/>
+              <xsl:apply-templates/>
+          </xsl:copy>
+      </xsl:if>
+  </xsl:template>
+  
+  <xsl:template match="@*">
+      <xsl:copy-of select="."/>
+  </xsl:template>
+  
+</xsl:stylesheet>

+ 4 - 4
tools/regression/xsl_reports/test/run.py

@@ -15,19 +15,19 @@ utils.makedirs( "results" )
     
 all_xml_file = "results/all.xml"
 all_xml_writer = open( all_xml_file, "w" )
-merger.merge_test_runs( ".", tag, all_xml_writer )
+merger.merge_test_runs( ".", tag, all_xml_writer, 1 )
 all_xml_writer.close()
 
 report.make_result_pages( 
       test_results_file = os.path.abspath( all_xml_file )
     , expected_results_file = ""
     , failures_markup_file = os.path.abspath( "explicit-failures-markup.xml" )
-    , source = tag
+    , tag = tag
     , run_date = "Today date"
     , comment_file = os.path.abspath( "comment.html" )
-    , results_dir = os.path.abspath( "results" )
+    , results_dir = "results"
     , result_prefix = ""
-    , reports = [ "x", "l", "dd", "ds" ]
+    , reports = [ "dd" ]
     , v2 = 1
     )
 

+ 32 - 0
tools/regression/xsl_reports/test/run_notes_regression.py

@@ -0,0 +1,32 @@
+import sys
+
+sys.path.append( '..' )
+
+import os
+
+import report
+import merger
+import utils
+
+
+tag = "1_32_0"
+
+# utils.makedirs( "results" )
+    
+all_xml_file = "a.xml"
+
+report.make_result_pages( 
+      test_results_file = os.path.abspath( all_xml_file )
+    , expected_results_file = ""
+    , failures_markup_file = os.path.abspath( "../../../../status/explicit-failures-markup.xml" )
+    , tag = tag
+    , run_date = "Today date"
+    , comment_file = os.path.abspath( "comment.html" )
+    , results_dir = "results"
+    , result_prefix = ""
+    , reports = [ "dd" ]
+    , v2 = 1
+    )
+
+
+

粤ICP备19079148号