(name)
| 278 | |
| 279 | |
| 280 | def _getExternalEnv(name): |
| 281 | toolsetName = "__myDummyToolset__" |
| 282 | |
| 283 | t = BoostBuild.Tester(["toolset=%s" % toolsetName], pass_toolset=False, |
| 284 | use_test_config=False) |
| 285 | try: |
| 286 | # Prepare a dummy toolset so we do not get errors in case the default |
| 287 | # one is not found. |
| 288 | t.write(toolsetName + ".jam", """\ |
| 289 | import feature ; |
| 290 | feature.extend toolset : %s ; |
| 291 | rule init ( ) { } |
| 292 | """ % toolsetName) |
| 293 | |
| 294 | # Python version of the same dummy toolset. |
| 295 | t.write(toolsetName + ".py", """\ |
| 296 | from b2.build import feature |
| 297 | feature.extend('toolset', ['%s']) |
| 298 | def init(): pass |
| 299 | """ % toolsetName) |
| 300 | |
| 301 | t.write("jamroot.jam", """\ |
| 302 | import os ; |
| 303 | local names = [ MATCH ^---var-name---=(.*) : [ modules.peek : ARGV ] ] ; |
| 304 | for x in $(names) |
| 305 | { |
| 306 | value = [ os.environ $(x) ] ; |
| 307 | ECHO "###" $(x): '$(value)' "###" ; |
| 308 | } |
| 309 | """) |
| 310 | |
| 311 | t.run_build_system(["---var-name---=%s" % name]) |
| 312 | m = re.search("^### %s: '(.*)' ###$" % name, t.stdout(), re.MULTILINE) |
| 313 | if m: |
| 314 | return m.group(1) |
| 315 | finally: |
| 316 | t.cleanup() |
| 317 | |
| 318 | |
| 319 | ############################################################################### |
no test coverage detected