summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/EnvironmentTests.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2005-01-10 13:45:00 (GMT)
committerSteven Knight <knight@baldmt.com>2005-01-10 13:45:00 (GMT)
commit519037f42eb7c90c5fb1f7d2e2b41ccee5fdba86 (patch)
tree44bc33674ae55485c128e0a59a050cbda7a52973 /src/engine/SCons/EnvironmentTests.py
parent69e3c442cdfb846cbcba7702d500e237b66be71e (diff)
downloadSCons-519037f42eb7c90c5fb1f7d2e2b41ccee5fdba86.zip
SCons-519037f42eb7c90c5fb1f7d2e2b41ccee5fdba86.tar.gz
SCons-519037f42eb7c90c5fb1f7d2e2b41ccee5fdba86.tar.bz2
Eliminate Executor's creation and use of a build_dict and a subst_dict, which were creating a separate OverrideEnvironment for every target and foiling the Memoizer's attempts at speeding up things.
Diffstat (limited to 'src/engine/SCons/EnvironmentTests.py')
-rw-r--r--src/engine/SCons/EnvironmentTests.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py
index ad5a9b2..44dc814 100644
--- a/src/engine/SCons/EnvironmentTests.py
+++ b/src/engine/SCons/EnvironmentTests.py
@@ -484,6 +484,14 @@ class SubstitutionTestCase(unittest.TestCase):
def get(self):
return self.val + '-proxy'
+ class MyNode:
+ def __init__(self, val):
+ self.val = val
+ def get_subst_proxy(self):
+ return self
+ def __str__(self):
+ return self.val
+
class MyObj:
pass
@@ -495,6 +503,12 @@ class SubstitutionTestCase(unittest.TestCase):
r = env.subst_path(['$FOO', 'xxx', '$BAR'])
assert r == ['foo', 'xxx', 'bar'], r
+ r = env.subst_path(['$FOO', '$TARGET', '$BAR'])
+ assert r == ['foo', '', 'bar'], r
+
+ r = env.subst_path(['$FOO', '$TARGET', '$BAR'], target=MyNode('yyy'))
+ assert map(str, r) == ['foo', 'yyy', 'bar'], r
+
n = MyObj()
r = env.subst_path(['$PROXY', MyProxy('my2'), n])