From ad87337fb5651056c11c419bb68786cbf604e99b Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 25 Oct 2011 08:05:06 +0000 Subject: [PATCH] Fix conditionals_multiple.py test in Boost.Build/Python. Patch from Georgy Gritsenko. [SVN r75109] --- v2/build/feature.py | 4 +++- v2/build/toolset.py | 4 +++- v2/build_system.py | 6 +++++- v2/test/conditionals_multiple.py | 15 +++++++++++++++ 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/v2/build/feature.py b/v2/build/feature.py index 315a18e94..289aca14c 100644 --- a/v2/build/feature.py +++ b/v2/build/feature.py @@ -557,10 +557,12 @@ def expand_composite(property): 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: diff --git a/v2/build/toolset.py b/v2/build/toolset.py index b42679878..d7b121a2a 100644 --- a/v2/build/toolset.py +++ b/v2/build/toolset.py @@ -68,7 +68,9 @@ def reset (): 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 diff --git a/v2/build_system.py b/v2/build_system.py index 55d8b806c..55cf2d66e 100644 --- a/v2/build_system.py +++ b/v2/build_system.py @@ -20,6 +20,7 @@ from b2.util.sequence import unique 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 @@ def process_explicit_toolset_requests(): 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: diff --git a/v2/test/conditionals_multiple.py b/v2/test/conditionals_multiple.py index 20b6b47f7..cc8a3518b 100755 --- a/v2/test/conditionals_multiple.py +++ b/v2/test/conditionals_multiple.py @@ -30,6 +30,13 @@ feature.extend toolset : testToolset ; 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 @@ feature.subfeature toolset %(toolset)s : version : 0 1 ; 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 ;