Boost logo

Boost-Commit :

From: jurko.gospodnetic_at_[hidden]
Date: 2008-01-06 01:50:56


Author: jurko
Date: 2008-01-06 01:50:56 EST (Sun, 06 Jan 2008)
New Revision: 42509
URL: http://svn.boost.org/trac/boost/changeset/42509

Log:
Added a --test-config command-line option for specifying where the test configuration file should be loaded from instead of always being looked up in Boost Build's test folder. This allows non-test builds to not use test config when it exists on the system and different tests to use different test configurations when needed.
Text files modified:
   trunk/tools/build/v2/build-system.jam | 11 ++++++-----
   trunk/tools/build/v2/test/BoostBuild.py | 12 ++++++++++--
   2 files changed, 16 insertions(+), 7 deletions(-)

Modified: trunk/tools/build/v2/build-system.jam
==============================================================================
--- trunk/tools/build/v2/build-system.jam (original)
+++ trunk/tools/build/v2/build-system.jam 2008-01-06 01:50:56 EST (Sun, 06 Jan 2008)
@@ -238,10 +238,11 @@
 # Loads all the configuration files used by Boost Build in the following order:
 #
 # -- test-config --
-# Loaded if the specified test-config.jam file is found under the path pointed
-# to by the BOOST_BUILD_PATH environment variable. It is ok for this file not to
-# exist even if specified. If this configuration file is loaded, regular site
-# and user configuration files will not be.
+# Loaded only if specified on the command-line using the --test-config
+# command-line parameter. It is ok for this file not to exist even if specified.
+# If this configuration file is loaded, regular site and user configuration
+# files will not be. If a relative path is specified, file is searched for in
+# the current folder.
 #
 # -- site-config --
 # Always named site-config.jam. Will only be found if located on the system
@@ -270,7 +271,7 @@
     }
 
     initialize-config-module test-config ;
- local test-config = [ GLOB [ os.environ BOOST_BUILD_PATH ] : test-config.jam ] ;
+ local test-config = [ MATCH ^--test-config=(.*)$ : $(.argv) ] ;
     if $(test-config)
     {
         local where =

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-06 01:50:56 EST (Sun, 06 Jan 2008)
@@ -151,7 +151,7 @@
     def __init__(self, arguments="", executable = 'bjam',
                  match = TestCmd.match_exact, boost_build_path = None,
                  translate_suffixes = True, pass_toolset = True,
- workdir = '', **keywords):
+ use_test_config = True, workdir = '', **keywords):
 
         self.original_workdir = os.getcwd()
         if workdir != '' and not os.path.isabs(workdir):
@@ -159,6 +159,7 @@
 
         self.last_build_time = 0
         self.translate_suffixes = translate_suffixes
+ self.use_test_config = use_test_config
 
         self.toolset = get_toolset()
         self.pass_toolset = pass_toolset
@@ -360,7 +361,7 @@
     #
     def run_build_system(
         self, extra_args='', subdir='', stdout = None, stderr = '', status = 0,
- match = None, pass_toolset = None, **kw):
+ match = None, pass_toolset = None, use_test_config = None, **kw):
 
         if os.path.isabs(subdir):
             if stderr:
@@ -376,6 +377,9 @@
         if pass_toolset is None:
             pass_toolset = self.pass_toolset
 
+ if use_test_config is None:
+ use_test_config = self.use_test_config
+
         try:
             kw['program'] = []
             kw['program'] += self.program
@@ -383,6 +387,10 @@
                 kw['program'] += extra_args.split(" ")
             if pass_toolset:
                 kw['program'].append("toolset=" + self.toolset)
+ if use_test_config:
+ kw['program'].append("--test-config=\""
+ + os.path.join(self.original_workdir, "test-config.jam")
+ + "\"")
             kw['chdir'] = subdir
             apply(TestCmd.TestCmd.run, [self], kw)
         except:


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