Boost logo

Boost-Commit :

From: jurko.gospodnetic_at_[hidden]
Date: 2008-01-05 19:53:10


Author: jurko
Date: 2008-01-05 19:53:09 EST (Sat, 05 Jan 2008)
New Revision: 42507
URL: http://svn.boost.org/trac/boost/changeset/42507

Log:
No functional changes but only stylistic changes such as: comment typo corrections, wrapping lines to 80 characters, indentations, removing trailing spaces, removing empty lines, removed unnecessary module imports, etc.
Text files modified:
   trunk/tools/build/v2/build/modifiers.jam | 8
   trunk/tools/build/v2/build/project.jam | 50 ++--
   trunk/tools/build/v2/build/property.jam | 8
   trunk/tools/build/v2/build/toolset.jam | 360 +++++++++++++++++++--------------------
   trunk/tools/build/v2/test/BoostBuild.py | 26 +-
   5 files changed, 220 insertions(+), 232 deletions(-)

Modified: trunk/tools/build/v2/build/modifiers.jam
==============================================================================
--- trunk/tools/build/v2/build/modifiers.jam (original)
+++ trunk/tools/build/v2/build/modifiers.jam 2008-01-05 19:53:09 EST (Sat, 05 Jan 2008)
@@ -125,9 +125,10 @@
         return $(target) ;
     }
     
- # Utility, clones a file-target with optional changes to the name, type, and project
- # of the target.
- # NOTE: This functionality should be moved, and generalized, to virtual-targets.
+ # Utility, clones a file-target with optional changes to the name, type and
+ # project of the target.
+ # NOTE: This functionality should be moved, and generalized, to
+ # virtual-targets.
     #
     rule clone-file-target ( target : new-name ? : new-type ? : new-project ? )
     {
@@ -153,6 +154,7 @@
     }
 }
 
+
 # A modifier that changes the name of a target, after it's generated, given a
 # regular expression to split the name, and a set of token to insert between the
 # split tokens of the name. This also exposes the target for other uses with a

Modified: trunk/tools/build/v2/build/project.jam
==============================================================================
--- trunk/tools/build/v2/build/project.jam (original)
+++ trunk/tools/build/v2/build/project.jam 2008-01-05 19:53:09 EST (Sat, 05 Jan 2008)
@@ -4,36 +4,36 @@
 # Distributed under the Boost Software License, Version 1.0.
 # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
 
-# Implements project representation and loading.
-# Each project is represented by
+# Implements project representation and loading. Each project is represented
+# by:
 # - a module where all the Jamfile content live.
 # - an instance of 'project-attributes' class.
-# (given module name, can be obtained by 'attributes' rule)
+# (given a module name, can be obtained using the 'attributes' rule)
 # - an instance of 'project-target' class (from targets.jam)
-# (given a module name, can be obtained by 'target' rule)
+# (given a module name, can be obtained using the 'target' rule)
 #
 # Typically, projects are created as result of loading a Jamfile, which is done
 # by rules 'load' and 'initialize', below. First, module for Jamfile is loaded
 # and new project-attributes instance is created. Some rules necessary for
 # project are added to the module (see 'project-rules' module) at the bottom of
 # this file. Default project attributes are set (inheriting attributes of
-# parent project, if it exists). After that, Jamfile is read. It can declare
-# its own attributes, via 'project' rule, which will be combined with already
-# set attributes.
+# parent project, if it exists). After that the Jamfile is read. It can declare
+# its own attributes using the 'project' rule which will be combined with any
+# alread set attributes.
 #
-# The 'project' rule can also declare project id, which will be associated with
-# the project module.
+# The 'project' rule can also declare a project id which will be associated
+# with the project module.
 #
 # There can also be 'standalone' projects. They are created by calling
-# 'initialize' on an arbitrary module, and not specifying location. After the
-# call, the module can call the 'project' rule, declare main targets and behave
-# as a regular project. However, since it's not associated with any location,
-# it's better to declare only prebuilt targets.
-#
-# The list of all loaded Jamfile is stored in variable .project-locations. It's
-# possible to obtain module name for a location using 'module-name' rule. The
-# standalone projects are not recorded, the only way to use them is by project
-# id.
+# 'initialize' on an arbitrary module and not specifying their location. After
+# the call, the module can call the 'project' rule, declare main targets and
+# behave as a regular project except that, since it's not associated with any
+# location, it should not declare targets that are not prebuilt.
+#
+# The list of all loaded Jamfile is stored in the .project-locations variable.
+# It's possible to obtain a module name for a location using the 'module-name'
+# rule. Standalone projects are not recorded and can only be referenced using
+# their project id.
 
 import "class" : new ;
 import errors ;
@@ -44,9 +44,9 @@
 import sequence ;
 
 
-# Loads the jamfile at the given location. After loading, project global file
-# and jamfiles needed by the requested one will be loaded recursively. If the
-# jamfile at that location is loaded already, does nothing. Returns the project
+# Loads the Jamfile at the given location. After loading, project global file
+# and Jamfiles needed by the requested one will be loaded recursively. If the
+# Jamfile at that location is loaded already, does nothing. Returns the project
 # module for the Jamfile.
 #
 rule load ( jamfile-location )
@@ -287,11 +287,11 @@
         jamfile-to-load = [ find-jamfile $(dir) ] ;
     }
 
- # The module of the jamfile.
+ # The module of the Jamfile.
     #
     local jamfile-module = [ module-name [ path.parent $(jamfile-to-load) ] ] ;
 
- # Initialize the jamfile module before loading.
+ # Initialize the Jamfile module before loading.
     #
     initialize $(jamfile-module) : [ path.parent $(jamfile-to-load) ]
         : $(jamfile-to-load:BS) ;
@@ -682,14 +682,14 @@
 }
 
 
-# Returns the project-attribute instance for the specified jamfile module.
+# Returns the project-attribute instance for the specified Jamfile module.
 rule attributes ( project )
 {
     return $($(project).attributes) ;
 }
 
 
-# Returns the value of the specified attribute in the specified jamfile module.
+# Returns the value of the specified attribute in the specified Jamfile module.
 rule attribute ( project attribute )
 {
     return [ $($(project).attributes).get $(attribute) ] ;

Modified: trunk/tools/build/v2/build/property.jam
==============================================================================
--- trunk/tools/build/v2/build/property.jam (original)
+++ trunk/tools/build/v2/build/property.jam 2008-01-05 19:53:09 EST (Sat, 05 Jan 2008)
@@ -582,13 +582,13 @@
     feature.compose <variant>debug : <define>_DEBUG <optimization>off ;
     feature.compose <variant>release : <define>NDEBUG <optimization>on ;
 
- validate <toolset>gcc <toolset>gcc-3.0.1 : $(test-space) ;
+ validate <toolset>gcc <toolset>gcc-3.0.1 : $(test-space) ;
 
- assert.true path-order $(test-space) debug <define>foo ;
+ assert.true path-order $(test-space) debug <define>foo ;
     assert.false path-order $(test-space) <define>foo debug ;
- assert.true path-order $(test-space) gcc debug ;
+ assert.true path-order $(test-space) gcc debug ;
     assert.false path-order $(test-space) debug gcc ;
- assert.true path-order $(test-space) <optimization>on <rtti>on ;
+ assert.true path-order $(test-space) <optimization>on <rtti>on ;
     assert.false path-order $(test-space) <rtti>on <optimization>on ;
 
     assert.result-equal <toolset>gcc <rtti>off <define>FOO

Modified: trunk/tools/build/v2/build/toolset.jam
==============================================================================
--- trunk/tools/build/v2/build/toolset.jam (original)
+++ trunk/tools/build/v2/build/toolset.jam 2008-01-05 19:53:09 EST (Sat, 05 Jan 2008)
@@ -1,46 +1,44 @@
-# Copyright 2003 Dave Abrahams
-# Copyright 2005 Rene Rivera
-# Copyright 2002, 2003, 2004, 2005, 2006 Vladimir Prus
-# Distributed under the Boost Software License, Version 1.0.
-# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
+# Copyright 2003 Dave Abrahams
+# Copyright 2005 Rene Rivera
+# Copyright 2002, 2003, 2004, 2005, 2006 Vladimir Prus
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
 
 # Support for toolset definition.
 
+import errors ;
 import feature ;
+import generators ;
 import numbers ;
-import errors : error ;
-import property ;
 import path ;
-import generators ;
-import set : difference ;
+import property ;
 import regex ;
 import sequence ;
+import set ;
 
 .flag-no = 1 ;
 
 .ignore-requirements = ;
 
-# This is used only for testing, to make sure
-# we don't get random extra elements in paths.
+# This is used only for testing, to make sure we don't get random extra elements
+# in paths.
 if --ignore-toolset-requirements in [ modules.peek : ARGV ]
 {
     .ignore-requirements = 1 ;
 }
 
-# Initializes an additional toolset-like module.
-# First load 'toolset-module' and then calls its 'init'
-# rule with trailing arguments
+
+# Initializes an additional toolset-like module. First load the 'toolset-module'
+# and then calls its 'init' rule with trailing arguments.
 rule using ( toolset-module : * )
 {
     import $(toolset-module) ;
     $(toolset-module).init $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ;
 }
 
-# Expands subfeatures in each property sets.
-# e.g
-# <toolset>gcc-3.2
-# will be converted to
-# <toolset>gcc/<toolset-version>3.2
+
+# Expands subfeatures in each property sets, e.g. '<toolset>gcc-3.2' will be
+# converted to '<toolset>gcc/<toolset-version>3.2'.
 local rule normalize-condition ( property-sets * )
 {
     local result ;
@@ -54,13 +52,10 @@
 }
 
 
-# Specifies if the 'flags' rule should do checking that
-# the invoking module is the same as module we're setting
-# flag for.
-# 'v' can be either 'checked' or 'unchecked'.
-# Subsequent call to 'pop-checking-for-flags-module'
-# will restore the behaviour that was in effect before
-# calling this rule.
+# Specifies if the 'flags' rule should check that the invoking module is the
+# same as the module we're setting the flag for. 'v' can be either 'checked' or
+# 'unchecked'. Subsequent call to 'pop-checking-for-flags-module' will restore
+# the setting that was in effect before calling this rule.
 rule push-checking-for-flags-module ( v )
 {
     .flags-module-checking = $(v) $(.flags-module-checking) ;
@@ -71,123 +66,117 @@
     .flags-module-checking = $(.flags-module-checking[2-]) ;
 }
 
+
 # Specifies the flags (variables) that must be set on targets under certain
 # conditions, described by arguments.
-rule flags ( rule-or-module # If contains dot, should be a rule name.
- # The flags will be applied when that rule is
- # used to set up build actions.
- #
- # If does not contain dot, should be a module name.
- # The flags will be applied for all rules in that
- # module.
- # If module for rule is different from the calling
- # module, an error is issued.
-
- variable-name # Variable that should be set on target
- condition * : # A condition when this flag should be applied.
- # Should be set of property sets. If one of
- # those property sets is contained in build
- # properties, the flag will be used.
- # Implied values are not allowed:
- # "<toolset>gcc" should be used, not just
- # "gcc". Subfeatures, like in "<toolset>gcc-3.2"
- # are allowed. If left empty, the flag will
- # always used.
- #
- # Propery sets may use value-less properties
- # ('<a>' vs. '<a>value') to match absent
- # properties. This allows to separately match
- #
- # <architecture>/<address-model>64
- # <architecture>ia64/<address-model>
- #
- # Where both features are optional. Without this
- # syntax we'd be forced to define "default" value.
-
-
- values * : # The value to add to variable. If <feature>
- # is specified, then the value of 'feature'
- # will be added.
- unchecked ? # If value 'unchecked' is passed, will not test
- # that flags are set for the calling module.
- : hack-hack ? # For
- # flags rule OPTIONS <cxx-abi> : -model ansi
- # Treak <cxx-abi> as condition
- # FIXME: ugly hack.
- )
+rule flags (
+ rule-or-module # If contains a dot, should be a rule name. The flags will
+ # be applied when that rule is used to set up build
+ # actions.
+ #
+ # If does not contain dot, should be a module name. The
+ # flag will be applied for all rules in that module. If
+ # module for rule is different from the calling module, an
+ # error is issued.
+
+ variable-name # Variable that should be set on target.
+ condition * : # A condition when this flag should be applied. Should be a
+ # set of property sets. If one of those property sets is
+ # contained in the build properties, the flag will be used.
+ # Implied values are not allowed: "<toolset>gcc" should be
+ # used, not just "gcc". Subfeatures, like in
+ # "<toolset>gcc-3.2" are allowed. If left empty, the flag
+ # will be used unconditionally.
+ #
+ # Propery sets may use value-less properties ('<a>' vs.
+ # '<a>value') to match absent properties. This allows to
+ # separately match:
+ #
+ # <architecture>/<address-model>64
+ # <architecture>ia64/<address-model>
+ #
+ # Where both features are optional. Without this syntax
+ # we'd be forced to define "default" values.
+
+ values * : # The value to add to variable. If <feature> is specified,
+ # then the value of 'feature' will be added.
+ unchecked ? # If value 'unchecked' is passed, will not test that flags
+ # are set for the calling module.
+ : hack-hack ? # For
+ # flags rule OPTIONS <cxx-abi> : -model ansi
+ # Treat <cxx-abi> as condition
+ # FIXME: ugly hack.
+)
 {
     local caller = [ CALLER_MODULE ] ;
     if ! [ MATCH ".*([.]).*" : $(rule-or-module) ]
        && [ MATCH "(Jamfile<.*)" : $(caller) ]
     {
- # Unqualified rule name, used inside Jamfile.
- # (most likely used with 'make' or 'notfile' rules.
- # This prevents setting flags on entire Jamfile module
- # (this will be considered as rule), but who cares?
+ # Unqualified rule name, used inside Jamfile. Most likely used with
+ # 'make' or 'notfile' rules. This prevents setting flags on the entire
+ # Jamfile module (this will be considered as rule), but who cares?
         # Probably, 'flags' rule should be split into 'flags' and
         # 'flags-on-module'.
         rule-or-module = $(caller).$(rule-or-module) ;
     }
     else
- {
+ {
         local module_ = [ MATCH "([^.]*).*" : $(rule-or-module) ] ;
- if $(unchecked) != unchecked
+ if $(unchecked) != unchecked
             && $(.flags-module-checking[1]) != unchecked
             && $(module_) != $(caller)
         {
             errors.error "Module $(caller) attempted to set flags for module $(module_)" ;
         }
     }
-
-
+
+
     if $(condition) && ! $(condition:G=) && ! $(hack-hack)
     {
- # We have condition in the form '<feature>', that is, without
- # value. That's a previous syntax:
- #
+ # We have condition in the form '<feature>', that is, without value.
+ # That's a previous syntax:
         # flags gcc.link RPATH <dll-path> ;
         # for compatibility, convert it to
- # flags gcc.link RPATH : <dll-path> ;
+ # flags gcc.link RPATH : <dll-path> ;
         values = $(condition) ;
         condition = ;
     }
-
+
     if $(condition)
     {
         property.validate-property-sets $(condition) ;
         condition = [ normalize-condition $(condition) ] ;
     }
-
+
     add-flag $(rule-or-module) : $(variable-name)
       : $(condition) : $(values) ;
 }
 
-# Adds new flag setting with the specified values
-# Does no checking
-local rule add-flag ( rule-or-module :
- variable-name : condition * : values * )
+
+# Adds a new flag setting with the specified values. Does no checking.
+local rule add-flag ( rule-or-module : variable-name : condition * : values * )
 {
     .$(rule-or-module).flags += $(.flag-no) ;
 
     # Store all flags for a module
- local module_ = [ MATCH "([^.]*).*" : $(rule-or-module) ] ;
+ local module_ = [ MATCH "([^.]*).*" : $(rule-or-module) ] ;
     .module-flags.$(module_) += $(.flag-no) ;
     # Store flag-no -> rule-or-module mapping
     .rule-or-module.$(.flag-no) = $(rule-or-module) ;
 
     .$(rule-or-module).variable.$(.flag-no) += $(variable-name) ;
     .$(rule-or-module).values.$(.flag-no) += $(values) ;
- .$(rule-or-module).condition.$(.flag-no) += $(condition) ;
-
+ .$(rule-or-module).condition.$(.flag-no) += $(condition) ;
+
     .flag-no = [ numbers.increment $(.flag-no) ] ;
 }
-
+
 
 # Returns the first element of 'property-sets' which is a subset of
 # 'properties', or an empty list if no such element exists.
 rule find-property-subset ( property-sets * : properties * )
 {
- # cut property values off
+ # Cut property values off.
     local prop-keys = $(properties:G) ;
 
     local result ;
@@ -195,20 +184,20 @@
     {
         if ! $(result)
         {
- # Handle value-less properties like '<architecture>' (compare with
+ # Handle value-less properties like '<architecture>' (compare with
             # '<architecture>x86').
 
             local set = [ feature.split $(s) ] ;
 
             # Find the set of features that
- # - have no property specified in required property set
- # - are omitted in build property set
+ # - have no property specified in required property set
+ # - are omitted in the build property set.
             local default-props ;
             for local i in $(set)
             {
- # If $(i) is a value-less property it should match default
- # value of an optional property. See the first line in the
- # example below:
+ # If $(i) is a value-less property it should match default value
+ # of an optional property. See the first line in the example
+ # below:
                 #
                 # property set properties result
                 # <a> <b>foo <b>foo match
@@ -230,6 +219,7 @@
     return $(result) ;
 }
 
+
 rule handle-flag-value ( value * : properties * )
 {
     local result ;
@@ -241,98 +231,95 @@
             local att = [ feature.attributes $(p:G) ] ;
             if dependency in $(att)
             {
- # the value of a dependency feature is a target
- # and must be actualized
+ # The value of a dependency feature is a target and needs to be
+ # actualized.
                 result += [ $(p:G=).actualize ] ;
- }
+ }
             else if path in $(att) || free in $(att)
             {
                 local values ;
- # Treat features with && in the value
- # specially -- each &&-separated element is considered
- # separate value. This is needed to handle searched
- # libraries, which must be in specific order.
+ # Treat features with && in the value specially -- each
+ # &&-separated element is considered a separate value. This is
+ # needed to handle searched libraries, which must be in a
+ # specific order.
                 if ! [ MATCH (&&) : $(p:G=) ]
                 {
                     values = $(p:G=) ;
                 }
- else
+ else
                 {
                     values = [ regex.split $(p:G=) "&&" ] ;
                 }
                 if path in $(att)
- {
- result += [ sequence.transform path.native : $(values) ] ;
+ {
+ result += [ sequence.transform path.native : $(values) ] ;
                 }
                 else
                 {
                     result += $(values) ;
- }
- }
- else
+ }
+ }
+ else
             {
                 result += $(p:G=) ;
             }
- }
+ }
     }
     else
     {
         result += $(value) ;
- }
+ }
     return $(result) ;
 }
 
-# Given a rule name and a property set, returns a list of interleaved
-# variables names and values which must be set on targets for that
-# rule/property-set combination.
+
+# Given a rule name and a property set, returns a list of interleaved variables
+# names and values which must be set on targets for that rule/property-set
+# combination.
 rule set-target-variables-aux ( rule-or-module : property-set )
 {
     local result ;
     properties = [ $(property-set).raw ] ;
- for local f in $(.$(rule-or-module).flags)
+ for local f in $(.$(rule-or-module).flags)
     {
         local variable = $(.$(rule-or-module).variable.$(f)) ;
         local condition = $(.$(rule-or-module).condition.$(f)) ;
         local values = $(.$(rule-or-module).values.$(f)) ;
-
-
+
         if ! $(condition) ||
- [ find-property-subset $(condition) : $(properties) ]
+ [ find-property-subset $(condition) : $(properties) ]
         {
             local processed ;
             for local v in $(values)
- {
- # The value might be <feature-name> so needs special
- # treatment.
- processed += [
- handle-flag-value $(v) : $(properties) ] ;
+ {
+ # The value might be <feature-name> so needs special treatment.
+ processed += [ handle-flag-value $(v) : $(properties) ] ;
             }
             for local r in $(processed)
- {
+ {
                 result += $(variable) $(r) ;
- }
+ }
         }
     }
-
- # strip away last dot separated part and recurse.
+
+ # Strip away last dot separated part and recurse.
     local next = [ MATCH ^(.+)\\.([^\\.])* : $(rule-or-module) ] ;
     if $(next)
     {
- result += [
- set-target-variables-aux $(next[1]) : $(property-set) ] ;
- }
- return $(result) ;
+ result += [ set-target-variables-aux $(next[1]) : $(property-set) ] ;
+ }
+ return $(result) ;
 }
 
 
 rule set-target-variables ( rule-or-module targets + : property-set )
-{
+{
     properties = [ $(property-set).raw ] ;
     local key = $(rule-or-module).$(property-set) ;
     local settings = $(.stv.$(key)) ;
     if ! $(settings)
     {
- settings = [
+ settings = [
           set-target-variables-aux $(rule-or-module) : $(property-set) ] ;
 
         if ! $(settings)
@@ -341,7 +328,7 @@
         }
         .stv.$(key) = $(settings) ;
     }
-
+
     if $(settings) != none
     {
         local var-name = ;
@@ -360,23 +347,24 @@
     }
 }
 
-# Make toolset 'toolset', defined in a module of the same name,
-# inherit from 'base'
-# 1. The 'init' rule from 'base' is imported into 'toolset' with full
-# name. Another 'init' is called, which forwards to the base one.
-# 2. All generators from 'base' are cloned. The ids are adjusted and
-# <toolset> property in requires is adjusted too
-# 3. All flags are inherited
+
+# Make toolset 'toolset', defined in a module of the same name, inherit from
+# 'base'.
+# 1. The 'init' rule from 'base' is imported into 'toolset' with full name.
+# Another 'init' is called, which forwards to the base one.
+# 2. All generators from 'base' are cloned. The ids are adjusted and <toolset>
+# property in requires is adjusted too.
+# 3. All flags are inherited.
 # 4. All rules are imported.
 rule inherit ( toolset : base )
 {
     import $(base) ;
-
     inherit-generators $(toolset) : $(base) ;
- inherit-flags $(toolset) : $(base) ;
- inherit-rules $(toolset) : $(base) ;
+ inherit-flags $(toolset) : $(base) ;
+ inherit-rules $(toolset) : $(base) ;
 }
 
+
 rule inherit-generators ( toolset properties * : base : generators-to-ignore * )
 {
     properties ?= <toolset>$(toolset) ;
@@ -384,15 +372,15 @@
     for local g in $(base-generators)
     {
         local id = [ $(g).id ] ;
-
+
         if ! $(id) in $(generators-to-ignore)
- {
+ {
             # Some generator names have multiple periods in their name, so
- # $(id:B=$(toolset)) doesn't generate the right new-id name.
- # e.g. if id = gcc.compile.c++, $(id:B=darwin) = darwin.c++,
- # which is not what we want. Manually parse the base and suffix
- # (if there's a better way to do this, I'd love to see it.)
- # See also register in module generators.
+ # $(id:B=$(toolset)) doesn't generate the right new-id name. E.g. if
+ # id = gcc.compile.c++, $(id:B=darwin) = darwin.c++, which is not
+ # what we want. Manually parse the base and suffix (if there's a
+ # better way to do this, I'd love to see it). See also register in
+ # module generators.
             local base = $(id) ;
             local suffix = "" ;
             while $(base:S)
@@ -403,27 +391,26 @@
             local new-id = $(toolset)$(suffix) ;
 
             generators.register [ $(g).clone $(new-id) : $(properties) ] ;
- }
- }
+ }
+ }
 }
 
-# Brings all flag definitions from 'base' toolset into
-# other toolset 'toolset'. Flag definitions which
-# condition make use of properties in 'prohibited-properties'
-# are ignored. Don't confuse property and feature, for
-# example <debug-symbols>on and <debug-symbols>off, so blocking
-# one of them does not block the other one.
+
+# Brings all flag definitions from the 'base' toolset into the 'toolset'
+# toolset. Flag definitions whose conditions make use of properties in
+# 'prohibited-properties' are ignored. Don't confuse property and feature, for
+# example <debug-symbols>on and <debug-symbols>off, so blocking one of them does
+# not block the other one.
 #
-# The flag conditions are not altered at all, so if condition
-# includes name, or version of base toolset, it won't ever match
-# the inheriting toolset. When such flag settings must be
-# inherited, define a rule in base toolset module and call it
-# as needed.
+# The flag conditions are not altered at all, so if a condition includes a name,
+# or version of a base toolset, it won't ever match the inheriting toolset. When
+# such flag settings must be inherited, define a rule in base toolset module and
+# call it as needed.
 rule inherit-flags ( toolset : base : prohibited-properties * )
 {
     for local f in $(.module-flags.$(base))
- {
- local rule-or-module = $(.rule-or-module.$(f)) ;
+ {
+ local rule-or-module = $(.rule-or-module.$(f)) ;
         if [ set.difference
                 $(.$(rule-or-module).condition.$(f)) :
                 $(prohibited-properties)
@@ -439,45 +426,45 @@
             {
                 new-rule-or-module = $(toolset) ;
             }
-
+
             add-flag
- $(new-rule-or-module)
- : $(.$(rule-or-module).variable.$(f))
- : $(.$(rule-or-module).condition.$(f))
- : $(.$(rule-or-module).values.$(f))
- ;
+ $(new-rule-or-module)
+ : $(.$(rule-or-module).variable.$(f))
+ : $(.$(rule-or-module).condition.$(f))
+ : $(.$(rule-or-module).values.$(f)) ;
         }
- }
+ }
 }
 
+
 rule inherit-rules ( toolset : base )
 {
- # It appears that "action" creates local rule...
+ # It appears that "action" creates a local rule...
     local base-generators = [ generators.generators-for-toolset $(base) ] ;
     local rules ;
     for local g in $(base-generators)
     {
         local id = [ MATCH "[^.]*\.(.*)" : [ $(g).id ] ] ;
         rules += $(id) ;
- }
+ }
     IMPORT $(base) : $(rules) : $(toolset) : $(rules) ;
     # Import the rules to the global scope
     IMPORT $(toolset) : $(rules) : : $(toolset).$(rules) ;
 }
 
-# Return the list of global 'toolset requirements'.
-# Those requirements will be automatically added to
-# the requirements of any main target.
+
+# Return the list of global 'toolset requirements'. Those requirements will be
+# automatically added to the requirements of any main target.
 rule requirements ( )
 {
     return $(.requirements) ;
 }
 
-# Adds elements to the list of global 'toolset requirements'.
-# The requirements will be automatically added to the requirements
-# for all main targets, as if they were specified literally.
-# For best results, all requirements added should be conditional or
-# indirect conditional.
+
+# Adds elements to the list of global 'toolset requirements'. The requirements
+# will be automatically added to the requirements for all main targets, as if
+# they were specified literally. For best results, all requirements added should
+# be conditional or indirect conditional.
 rule add-requirements ( requirements * )
 {
     if ! $(.ignore-requirements)
@@ -486,6 +473,7 @@
     }
 }
 
+
 local rule __test__ ( )
 {
     import assert ;
@@ -494,8 +482,8 @@
     assert.result : find-property-subset <a>0/<b>0/<c>9/<d>9/<e>5 <a>9 : $(p) ;
 
     local p-set = <a>/<b> <a>0/<b> <a>/<b>1 <a>0/<b>1 ;
- assert.result <a>/<b> : find-property-subset $(p-set) : ;
+ assert.result <a>/<b> : find-property-subset $(p-set) : ;
     assert.result <a>0/<b> : find-property-subset $(p-set) : <a>0 <c>2 ;
     assert.result <a>/<b>1 : find-property-subset $(p-set) : <b>1 <c>2 ;
- assert.result <a>0/<b>1 : find-property-subset $(p-set) : <a>0 <b>1 ;
+ assert.result <a>0/<b>1 : find-property-subset $(p-set) : <a>0 <b>1 ;
 }

Modified: trunk/tools/build/v2/test/BoostBuild.py
==============================================================================
--- trunk/tools/build/v2/test/BoostBuild.py (original)
+++ trunk/tools/build/v2/test/BoostBuild.py 2008-01-05 19:53:09 EST (Sat, 05 Jan 2008)
@@ -148,9 +148,9 @@
     Optional argument `work_dir` indicates an absolute directory, where the test
     will run be run.
     """
- def __init__(self, arguments="", executable = 'bjam', match =
- TestCmd.match_exact, boost_build_path = None,
- translate_suffixes = 1, pass_toolset = 1,
+ def __init__(self, arguments="", executable = 'bjam',
+ match = TestCmd.match_exact, boost_build_path = None,
+ translate_suffixes = True, pass_toolset = True,
                  workdir = '', **keywords):
 
         self.original_workdir = os.getcwd()
@@ -194,9 +194,9 @@
                 elif os.uname()[0] == "OSF1":
                     jam_build_dir = "bin.osf"
                 else:
- raise "Don't know directory where jam is build for this system: " + os.name + "/" + os.uname()[0]
+ raise "Don't know directory where Jam is built for this system: " + os.name + "/" + os.uname()[0]
             else:
- raise "Don't know directory where jam is build for this system: " + os.name
+ raise "Don't know directory where Jam is built for this system: " + os.name
 
             # Find where jam_src is located. Try for the debug version if it's
             # lying around.
@@ -380,9 +380,9 @@
             kw['program'] = []
             kw['program'] += self.program
             if extra_args:
- kw['program'] += extra_args.split(" ")
+ kw['program'] += extra_args.split(" ")
             if pass_toolset:
- kw['program'].append(self.toolset)
+ kw['program'].append("toolset=" + self.toolset)
             kw['chdir'] = subdir
             apply(TestCmd.TestCmd.run, [self], kw)
         except:
@@ -551,11 +551,9 @@
                     filesets.pop()
 
             if not filesets:
- annotation("reason",
- "File %s not touched as expected" % (name,))
+ annotation("failure", "File %s not touched as expected" % name)
                 self.fail_test(1)
 
-
     def ignore_touch(self, wildcard):
         self.ignore_elements(self.unexpected_difference.touched_files, wildcard)
 
@@ -621,12 +619,12 @@
                 (expected, content))
             self.fail_test(1)
 
- def expect_output_line(self, expected):
- self._expect_line(self.stdout(), expected)
+ def expect_output_line(self, line):
+ self._expect_line(self.stdout(), line)
 
- def expect_content_line(self, name, expected):
+ def expect_content_line(self, name, line):
         content = self._read_file(name)
- self._expect_line(content, expected)
+ self._expect_line(content, line)
 
     def _read_file(self, name, exact=0):
         name = self.adjust_names(name)[0]


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