summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/ActionTests.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-12-29 16:26:58 (GMT)
committerSteven Knight <knight@baldmt.com>2004-12-29 16:26:58 (GMT)
commit9113805b081ef58fdf56bd5b5a9be6afad0b7a41 (patch)
treeb5a11d8944eca035fdedf45dcb8de3af4108245a /src/engine/SCons/ActionTests.py
parent36e665069d121ee715f4fba0c304fb9afe00583f (diff)
downloadSCons-9113805b081ef58fdf56bd5b5a9be6afad0b7a41.zip
SCons-9113805b081ef58fdf56bd5b5a9be6afad0b7a41.tar.gz
SCons-9113805b081ef58fdf56bd5b5a9be6afad0b7a41.tar.bz2
Enhance OverrideEnvironment, and rename the base class to an enhanced and maybe-even-useful SubstitutionEnvironment, to eliminate copying of construction environment variables.
Diffstat (limited to 'src/engine/SCons/ActionTests.py')
-rw-r--r--src/engine/SCons/ActionTests.py29
1 files changed, 6 insertions, 23 deletions
diff --git a/src/engine/SCons/ActionTests.py b/src/engine/SCons/ActionTests.py
index 705daff..4c1d521 100644
--- a/src/engine/SCons/ActionTests.py
+++ b/src/engine/SCons/ActionTests.py
@@ -128,11 +128,11 @@ class Environment:
for k, v in kw.items():
self.d[k] = v
# Just use the underlying scons_subst*() utility methods.
- def subst(self, strSubst, raw=0, target=[], source=[], dict=None):
- return SCons.Util.scons_subst(strSubst, self, raw, target, source, dict)
+ def subst(self, strSubst, raw=0, target=[], source=[]):
+ return SCons.Util.scons_subst(strSubst, self, raw, target, source, self.d)
subst_target_source = subst
- def subst_list(self, strSubst, raw=0, target=[], source=[], dict=None):
- return SCons.Util.scons_subst_list(strSubst, self, raw, target, source, dict)
+ def subst_list(self, strSubst, raw=0, target=[], source=[]):
+ return SCons.Util.scons_subst_list(strSubst, self, raw, target, source, self.d)
def __getitem__(self, item):
return self.d[item]
def __setitem__(self, item, value):
@@ -1088,7 +1088,7 @@ class CommandActionTestCase(unittest.TestCase):
# Make sure that CommandActions use an Environment's
# subst_target_source() method for substitution.
class SpecialEnvironment(Environment):
- def subst_target_source(self, strSubst, raw=0, target=[], source=[], dict=None):
+ def subst_target_source(self, strSubst, raw=0, target=[], source=[]):
return 'subst_target_source: ' + strSubst
c = a.get_contents(target=DummyNode('ttt'), source = DummyNode('sss'),
@@ -1112,14 +1112,10 @@ class CommandActionTestCase(unittest.TestCase):
a = SCons.Action.CommandAction(["$TARGET"])
c = a.get_contents(target=t, source=s, env=env)
assert c == "t1", c
- c = a.get_contents(target=t, source=s, env=env, dict={})
- assert c == "", c
a = SCons.Action.CommandAction(["$TARGETS"])
c = a.get_contents(target=t, source=s, env=env)
assert c == "t1 t2 t3 t4 t5 t6", c
- c = a.get_contents(target=t, source=s, env=env, dict={})
- assert c == "", c
a = SCons.Action.CommandAction(["${TARGETS[2]}"])
c = a.get_contents(target=t, source=s, env=env)
@@ -1132,14 +1128,10 @@ class CommandActionTestCase(unittest.TestCase):
a = SCons.Action.CommandAction(["$SOURCE"])
c = a.get_contents(target=t, source=s, env=env)
assert c == "s1", c
- c = a.get_contents(target=t, source=s, env=env, dict={})
- assert c == "", c
a = SCons.Action.CommandAction(["$SOURCES"])
c = a.get_contents(target=t, source=s, env=env)
assert c == "s1 s2 s3 s4 s5 s6", c
- c = a.get_contents(target=t, source=s, env=env, dict={})
- assert c == "", c
a = SCons.Action.CommandAction(["${SOURCES[2]}"])
c = a.get_contents(target=t, source=s, env=env)
@@ -1253,8 +1245,6 @@ class CommandGeneratorActionTestCase(unittest.TestCase):
a = SCons.Action.CommandGeneratorAction(f)
c = a.get_contents(target=[], source=[], env=env)
assert c == "guux FFF BBB test", c
- c = a.get_contents(target=[], source=[], env=env, dict={})
- assert c == "guux FFF BBB test", c
class FunctionActionTestCase(unittest.TestCase):
@@ -1381,8 +1371,6 @@ class FunctionActionTestCase(unittest.TestCase):
c = a.get_contents(target=[], source=[], env=Environment())
assert c in matches, repr(c)
- c = a.get_contents(target=[], source=[], env=Environment(), dict={})
- assert c in matches, repr(c)
a = SCons.Action.FunctionAction(GlobalFunc, varlist=['XYZ'])
@@ -1394,7 +1382,7 @@ class FunctionActionTestCase(unittest.TestCase):
assert c in matches_foo, repr(c)
class Foo:
- def get_contents(self, target, source, env, dict=None):
+ def get_contents(self, target, source, env):
return 'xyzzy'
a = SCons.Action.FunctionAction(Foo())
c = a.get_contents(target=[], source=[], env=Environment())
@@ -1481,9 +1469,6 @@ class ListActionTestCase(unittest.TestCase):
c = a.get_contents(target=[], source=[], env=Environment(s = self))
assert self.foo==1, self.foo
assert c == "xyz", c
- c = a.get_contents(target=[], source=[], env=Environment(s = self), dict={})
- assert self.foo==1, self.foo
- assert c == "xyz", c
class LazyActionTestCase(unittest.TestCase):
def test___init__(self):
@@ -1533,8 +1518,6 @@ class LazyActionTestCase(unittest.TestCase):
env = Environment(FOO = [["This", "is", "a", "test"]])
c = a.get_contents(target=[], source=[], env=env)
assert c == "This is a test", c
- c = a.get_contents(target=[], source=[], env=env, dict={})
- assert c == "This is a test", c
class ActionCallerTestCase(unittest.TestCase):
def test___init__(self):