Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75109 - in trunk/tools/build/v2: . build test
From: ghost_at_[hidden]
Date: 2011-10-25 04:05:08


Author: vladimir_prus
Date: 2011-10-25 04:05:06 EDT (Tue, 25 Oct 2011)
New Revision: 75109
URL: http://svn.boost.org/trac/boost/changeset/75109

Log:
Fix conditionals_multiple.py test in Boost.Build/Python.

Patch from Georgy Gritsenko.

Text files modified:
   trunk/tools/build/v2/build/feature.py | 4 +++-
   trunk/tools/build/v2/build/toolset.py | 4 +++-
   trunk/tools/build/v2/build_system.py | 6 +++++-
   trunk/tools/build/v2/test/conditionals_multiple.py | 15 +++++++++++++++
   4 files changed, 26 insertions(+), 3 deletions(-)

Modified: trunk/tools/build/v2/build/feature.py
==============================================================================
--- trunk/tools/build/v2/build/feature.py (original)
+++ trunk/tools/build/v2/build/feature.py 2011-10-25 04:05:06 EDT (Tue, 25 Oct 2011)
@@ -557,10 +557,12 @@
             result.extend(expand_composite(p))
     return result
 
-
+@bjam_signature((['feature'], ['properties', '*']))
 def get_values (feature, properties):
     """ Returns all values of the given feature specified by the given property set.
     """
+ if feature[0] != '<':
+ feature = '<' + feature + '>'
     result = []
     for p in properties:
         if get_grist (p) == feature:

Modified: trunk/tools/build/v2/build/toolset.py
==============================================================================
--- trunk/tools/build/v2/build/toolset.py (original)
+++ trunk/tools/build/v2/build/toolset.py 2011-10-25 04:05:06 EDT (Tue, 25 Oct 2011)
@@ -68,7 +68,9 @@
 reset ()
 
 # FIXME: --ignore-toolset-requirements
-# FIXME: using
+def using(toolset_module, *args):
+ loaded_toolset_module= get_manager().projects().load_module(toolset_module, [os.getcwd()]);
+ loaded_toolset_module.init(*args)
     
 # FIXME push-checking-for-flags-module ....
 # FIXME: investigate existing uses of 'hack-hack' parameter

Modified: trunk/tools/build/v2/build_system.py
==============================================================================
--- trunk/tools/build/v2/build_system.py (original)
+++ trunk/tools/build/v2/build_system.py 2011-10-25 04:05:06 EDT (Tue, 25 Oct 2011)
@@ -20,6 +20,7 @@
 import b2.build.build_request
 from b2.build.errors import ExceptionWithUserContext
 import b2.tools.common
+from b2.build.toolset import using
 
 import b2.build.project as project
 import b2.build.virtual_target as virtual_target
@@ -381,7 +382,10 @@
 
             if debug_config:
                 print "notice: [cmdline-cfg] toolset '%s' not previously configured; attempting to auto-configure now" % toolset_version
- toolset.using(toolset, version)
+ if version is not None:
+ using(toolset, version)
+ else:
+ using(toolset)
 
         else:
 

Modified: trunk/tools/build/v2/test/conditionals_multiple.py
==============================================================================
--- trunk/tools/build/v2/test/conditionals_multiple.py (original)
+++ trunk/tools/build/v2/test/conditionals_multiple.py 2011-10-25 04:05:06 EDT (Tue, 25 Oct 2011)
@@ -30,6 +30,13 @@
 rule init ( ) { }
 """)
 
+ t.write("testToolset.py", """
+from b2.build import feature
+feature.extend('toolset', ["testToolset"])
+def init ( ):
+ pass
+""")
+
     t.write("jamroot.jam", """
 import feature ;
 import notfile ;
@@ -135,6 +142,14 @@
 rule init ( version ? ) { }
 """ % {"toolset": toolset})
 
+ t.write( "testToolset.py", """
+from b2.build import feature
+feature.extend('toolset', ["testToolset"])
+feature.subfeature('toolset',"testToolset","version",['0','1'])
+def init ( version ):
+ pass
+ """)
+
     t.write("jamroot.jam", """
 import feature ;
 import notfile ;


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