()
| 240 | # internal unit testing system but may be used freely in other places as well. |
| 241 | # |
| 242 | def load_configuration_files(): |
| 243 | |
| 244 | # Flag indicating that site configuration should not be loaded. |
| 245 | ignore_site_config = "--ignore-site-config" in sys.argv |
| 246 | |
| 247 | initialize_config_module("test-config") |
| 248 | test_config = None |
| 249 | for a in sys.argv: |
| 250 | m = re.match("--test-config=(.*)$", a) |
| 251 | if m: |
| 252 | test_config = b2.util.unquote(m.group(1)) |
| 253 | break |
| 254 | |
| 255 | if test_config: |
| 256 | where = load_config("test-config", os.path.basename(test_config), [os.path.dirname(test_config)]) |
| 257 | if where: |
| 258 | if debug_config: |
| 259 | print "notice: Regular site and user configuration files will" |
| 260 | print "notice: be ignored due to the test configuration being loaded." |
| 261 | |
| 262 | user_path = [os.path.expanduser("~")] + bjam.variable("BOOST_BUILD_PATH") |
| 263 | site_path = ["/etc"] + user_path |
| 264 | if os.name in ["nt"]: |
| 265 | site_path = [os.getenv("SystemRoot")] + user_path |
| 266 | |
| 267 | if debug_config and not test_config and ignore_site_config: |
| 268 | print "notice: Site configuration files will be ignored due to the" |
| 269 | print "notice: --ignore-site-config command-line option." |
| 270 | |
| 271 | initialize_config_module("site-config") |
| 272 | if not test_config and not ignore_site_config: |
| 273 | load_config('site-config', 'site-config.jam', site_path) |
| 274 | |
| 275 | initialize_config_module('user-config') |
| 276 | if not test_config: |
| 277 | |
| 278 | # Here, user_config has value of None if nothing is explicitly |
| 279 | # specified, and value of '' if user explicitly does not want |
| 280 | # to load any user config. |
| 281 | user_config = None |
| 282 | for a in sys.argv: |
| 283 | m = re.match("--user-config=(.*)$", a) |
| 284 | if m: |
| 285 | user_config = m.group(1) |
| 286 | break |
| 287 | |
| 288 | if user_config is None: |
| 289 | user_config = os.getenv("BOOST_BUILD_USER_CONFIG") |
| 290 | |
| 291 | # Special handling for the case when the OS does not strip the quotes |
| 292 | # around the file name, as is the case when using Cygwin bash. |
| 293 | user_config = b2.util.unquote(user_config) |
| 294 | explicitly_requested = user_config |
| 295 | |
| 296 | if user_config is None: |
| 297 | user_config = "user-config.jam" |
| 298 | |
| 299 | if user_config: |
no test coverage detected