Boost logo

Boost-Commit :

From: dave_at_[hidden]
Date: 2007-11-10 17:59:49


Author: dave
Date: 2007-11-10 17:59:49 EST (Sat, 10 Nov 2007)
New Revision: 41005
URL: http://svn.boost.org/trac/boost/changeset/41005

Log:
initial checkin. Too much work in one step!

Text files modified:
   branches/bitten/tools/build/v2/build-system.jam | 64 ++++++++++++++++++++++++++++
   branches/bitten/tools/regression/src/collect_and_upload_logs.py | 90 ++++++++++++++++++++++++++++++++++++++++
   branches/bitten/tools/regression/src/regression.py | 80 ++++++++++++++++++++---------------
   3 files changed, 199 insertions(+), 35 deletions(-)

Modified: branches/bitten/tools/build/v2/build-system.jam
==============================================================================
--- branches/bitten/tools/build/v2/build-system.jam (original)
+++ branches/bitten/tools/build/v2/build-system.jam 2007-11-10 17:59:49 EST (Sat, 10 Nov 2007)
@@ -24,6 +24,7 @@
 import "class" : new ;
 import toolset ;
 import regex ;
+import path ;
 
 import builtin ;
 import make ;
@@ -521,11 +522,72 @@
         to-clean-actual += [ $(t).actualize ] ;
     }
     common.Clean clean : $(to-clean-actual) ;
- UPDATE clean ;
+ UPDATE clean ;
+}
+
+# All Boost projects for which we've recorded dependency
+# info
+.all-dependents = ;
+
+pwd = [ path.pwd ] ;
+rule record-dependency ( p1 : p2 )
+{
+ local l1 = [ path.root [ $(p1).get location ] $(pwd) ] ;
+ local m1 = [ MATCH .*/libs/([^/]+)/* : $(l1) ] ;
     
+ local l2 = [ path.root [ $(p2).get location ] $(pwd) ] ;
+ local m2 = [ MATCH .*/libs/([^/]+)/* : $(l2) ] ;
+
+ if $(m1) && $(m2)
+ {
+ if ! $(m1) in $(.all-dependents)
+ {
+ .all-dependents += $(m1) ;
+ }
+ if $(m1) != $(m2) && ! $(m2) in $(.dependencies-$(m1))
+ {
+ .dependencies-$(m1) += $(m2) ;
+ }
+ }
+}
+
+rule print-dependencies ( )
+{
+ for d in $(.all-dependents)
+ {
+ ECHO "$(d):" $(.dependencies-$(d)) ;
+ }
+}
+
+
+
+if --boost-dependency-info in $(argv)
+{
+ local all-dependent-projects ;
+ for local t in [ virtual-target.all-targets ]
+ {
+ if [ $(t).action ]
+ {
+ # If a target has no action, it has
+ # no dependencies.
+
+ local p1 = [ $(t).project ] ;
+
+ local action = [ $(t).action ] ;
+ local used-targets = [ $(action).sources ] ;
+
+ for t2 in $(used-targets)
+ {
+ local p2 = [ $(t2).project ] ;
+ record-dependency $(p1) : $(p2) ;
+ }
+ }
+ }
+ print-dependencies ;
     
 }
 
+
 else
 {
     UPDATE all ;

Modified: branches/bitten/tools/regression/src/collect_and_upload_logs.py
==============================================================================
--- branches/bitten/tools/regression/src/collect_and_upload_logs.py (original)
+++ branches/bitten/tools/regression/src/collect_and_upload_logs.py 2007-11-10 17:59:49 EST (Sat, 10 Nov 2007)
@@ -83,7 +83,97 @@
     def send_host(self, connection, host):
         connection.putheader('Host',self.realhost)
     
+def create_bitten_report(
+ input_dir
+ ):
+ __log__ = 1
+ utils.log( 'Creating Bitten report from %s...' % input_dir )
 
+ report = xml.dom.minidom.parseString(
+'''<?xml version="1.0" encoding="UTF-8"?>
+<report category="test" generator="http://svn.boost.org/svn/boost/trunk/tools/regression/src/collect_and_upload_logs.py">
+</report>
+''')
+
+ def _collect_bitten_report_files_( unused, dir, names ):
+ for file in names:
+ if os.path.basename( file ) == 'test_log.xml':
+ file_path = os.path.join(dir,file)
+ utils.log( 'Creating Bitten report from "%s"' % file_path )
+ log_xml = open(file_path).read().translate(ascii_only_table)
+ os.unlink(file_path) # don't leave the file sitting around for
+ # the next run to find.
+
+ #~ utils.log( '--- XML:\n%s' % log_xml)
+ #~ It seems possible to get an empty XML result file
+ if log_xml == "": continue
+ log_dom = xml.dom.minidom.parseString(log_xml)
+
+ log_attrs = dict(log_dom.documentElement.attributes.items())
+ for node in log_dom.documentElement.childNodes:
+
+ if node.nodeType != xml.dom.Node.ELEMENT_NODE: continue
+
+ test = report.documentElement.appendChild(report.createElement('test'))
+ test.appendChild(
+ # We'll get the real timing info from bjam once we
+ # get this working.
+ report.createElement('duration')
+ ).appendChild(
+ report.createTextNode('0.0'))
+
+ test.appendChild(
+ report.createElement('status')
+ ).appendChild(
+ report.createTextNode(
+ node.attributes['result'].firstChild.wholeText == 'succeed'
+ and 'success' or 'failure'
+ ))
+
+ test.appendChild(
+ report.createElement('fixture')
+ ).appendChild(
+ report.createTextNode(
+ 'boost.%s.%s.%s' % (
+ log_attrs['library'],
+ log_attrs['test-name'],
+ node.localName
+ )))
+
+ test.appendChild(
+ report.createElement('fixture')
+ ).appendChild(
+ report.createTextNode(
+ 'boost.%s.%s' % (
+ log_attrs['library'],
+ log_attrs['test-name']
+ )))
+
+ test.appendChild(
+ report.createElement('name')
+ ).appendChild(
+ report.createTextNode(
+ node.localName
+ ))
+
+ test.appendChild(
+ report.createElement('file')
+ ).appendChild(
+ report.createTextNode(
+ log_attrs['test-program']
+ ))
+
+ test.appendChild(
+ report.createElement('stdout')
+ ).appendChild(
+ report.createTextNode(
+ node.firstChild.wholeText
+ ))
+
+ os.path.walk( input_dir, _collect_bitten_report_files_, None )
+
+ return report
+
 def publish_test_logs(
     input_dirs,
     runner_id, tag, platform, comment_file, timestamp, user, source, run_type,

Modified: branches/bitten/tools/regression/src/regression.py
==============================================================================
--- branches/bitten/tools/regression/src/regression.py (original)
+++ branches/bitten/tools/regression/src/regression.py 2007-11-10 17:59:49 EST (Sat, 10 Nov 2007)
@@ -61,6 +61,8 @@
         opt.add_option( '--timeout',
             help="specifies the timeout, in minutes, for a single test run/compilation",
             type='int' )
+ opt.add_option( '--library',
+ help="the library subdirectory in which to run tests")
         opt.add_option( '--bjam-options',
             help="options to pass to the regression test" )
         opt.add_option( '--bjam-toolset',
@@ -88,6 +90,8 @@
             help="FTP proxy server (e.g. 'ftpproxy')" )
         opt.add_option( '--dart-server',
             help="the dart server to send results to" )
+ opt.add_option( '--bitten-report',
+ help="Name of bitten XML report file to generate")
 
         #~ Debug Options:
         opt.add_option( '--debug-level',
@@ -121,8 +125,10 @@
         self.proxy=None
         self.ftp_proxy=None
         self.dart_server=None
+ self.bitten_report=None
         self.debug_level=0
         self.send_bjam_log=False
+ self.library=None
         self.mail=None
         self.smtp_login=None
         self.skip_tests=False
@@ -199,11 +205,14 @@
 
             self.log( 'Cleaning up "%s" directory ...' % self.regression_results )
             self.rmtree( self.regression_results )
-
- def command_get_tools(self):
- #~ Get Boost.Build v2...
- self.log( 'Getting Boost.Build v2...' )
- if self.user and self.user != '':
+
+ def _get_tool(self, tool_name, dest_dir):
+ local_path = os.path.join( self.regression_root, 'tools', tool_name )
+ if os.path.exists( local_path ):
+ import shutil
+ shutil.rmtree( dest_dir, ignore_errors=True )
+ shutil.copytree( local_path, dest_dir )
+ elif self.user and self.user != '':
             os.chdir( os.path.dirname(self.tools_bb_root) )
             self.svn_command( 'co %s %s' % (
                 self.svn_repository_url(repo_path['build']),
@@ -215,34 +224,16 @@
             self.unpack_tarball(
                 self.tools_bb_root+".tar.bz2",
                 os.path.basename(self.tools_bb_root) )
- #~ Get Boost.Jam...
+
+ def command_get_tools(self):
+ self.log( 'Getting Boost.Build v2...' )
+ self._get_tool('build', self.tools_bb_root)
+
         self.log( 'Getting Boost.Jam...' )
- if self.user and self.user != '':
- os.chdir( os.path.dirname(self.tools_bjam_root) )
- self.svn_command( 'co %s %s' % (
- self.svn_repository_url(repo_path['jam']),
- os.path.basename(self.tools_bjam_root) ) )
- else:
- self.retry( lambda: self.download_tarball(
- os.path.basename(self.tools_bjam_root)+".tar.bz2",
- self.tarball_url(repo_path['jam']) ) )
- self.unpack_tarball(
- self.tools_bjam_root+".tar.bz2",
- os.path.basename(self.tools_bjam_root) )
- #~ Get the regression tools and utilities...
- self.log( 'Getting regression tools an utilities...' )
- if self.user and self.user != '':
- os.chdir( os.path.dirname(self.tools_regression_root) )
- self.svn_command( 'co %s %s' % (
- self.svn_repository_url(repo_path['regression']),
- os.path.basename(self.tools_regression_root) ) )
- else:
- self.retry( lambda: self.download_tarball(
- os.path.basename(self.tools_regression_root)+".tar.bz2",
- self.tarball_url(repo_path['regression']) ) )
- self.unpack_tarball(
- self.tools_regression_root+".tar.bz2",
- os.path.basename(self.tools_regression_root) )
+ self._get_tool('jam/src', self.tools_bjam_root)
+
+ self.log( 'Getting regression tools and utilities...' )
+ self._get_tool('regression', self.tools_regression_root)
     
     def command_get_source(self):
         self.refresh_timestamp()
@@ -312,7 +303,11 @@
             self.regression_log )
         self.log( 'Starting tests (%s)...' % test_cmd )
         cd = os.getcwd()
- os.chdir( os.path.join( self.boost_root, 'status' ) )
+ if self.library:
+ os.chdir( os.path.join( self.boost_root, 'libs', self.library, 'test' ) )
+ else:
+ os.chdir( os.path.join( self.boost_root, 'status' ) )
+ self.log( '...in (%s).' % os.getcwd() )
         utils.system( [ test_cmd ] )
         os.chdir( cd )
 
@@ -371,8 +366,25 @@
             self.user,
             source, run_type,
             self.dart_server, self.proxy,
- revision )
+ revision)
+
+ def command_create_bitten_report(self):
+ self.import_utils()
+ from collect_and_upload_logs import create_bitten_report
         
+ if self.library:
+ xml_root = os.path.join( self.regression_results, 'boost',
+ 'bin.v2', 'libs', self.library, 'test'
+ )
+ else:
+ xml_root = os.path.join( self.regression_results, 'boost',
+ 'bin.v2' )
+
+ open(self.bitten_report, 'w').write(
+ create_bitten_report(
+ xml_root ).toxml('utf-8')
+ )
+
     def command_upload_logs(self):
         self.import_utils()
         from collect_and_upload_logs import upload_logs


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk