summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/ExecutorTests.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-02-09 06:59:46 (GMT)
committerSteven Knight <knight@baldmt.com>2004-02-09 06:59:46 (GMT)
commite83632fa336430dcfb76881d9130169bf27420f7 (patch)
tree2179fb29cac6cb7112e1b9b423e6a42ebb6fdd8f /src/engine/SCons/ExecutorTests.py
parent6cd1a4e5447a832a89d738b9cd545a2a9bc57f33 (diff)
downloadSCons-e83632fa336430dcfb76881d9130169bf27420f7.zip
SCons-e83632fa336430dcfb76881d9130169bf27420f7.tar.gz
SCons-e83632fa336430dcfb76881d9130169bf27420f7.tar.bz2
Save memory by allowing Nodes to clean up their Executor's build environments after they've been built.
Diffstat (limited to 'src/engine/SCons/ExecutorTests.py')
-rw-r--r--src/engine/SCons/ExecutorTests.py25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/engine/SCons/ExecutorTests.py b/src/engine/SCons/ExecutorTests.py
index 2a79e2d..2cdc0e2 100644
--- a/src/engine/SCons/ExecutorTests.py
+++ b/src/engine/SCons/ExecutorTests.py
@@ -90,7 +90,8 @@ class ExecutorTestCase(unittest.TestCase):
't',
['s1', 's2'])
be = x.get_build_env()
- assert be == {'O':'o2', 'X':'xxx'}, be
+ assert be['O'] == 'o2', be['O']
+ assert be['X'] == 'xxx', be['X']
env = MyEnvironment(Y='yyy')
x = SCons.Executor.Executor(MyBuilder(env, {'O':'ob3'}),
@@ -99,14 +100,16 @@ class ExecutorTestCase(unittest.TestCase):
't',
's')
be = x.get_build_env()
- assert be == {'O':'oo3', 'Y':'yyy'}, be
+ assert be['O'] == 'oo3', be['O']
+ assert be['Y'] == 'yyy', be['Y']
x = SCons.Executor.Executor(MyBuilder(env, {'O':'ob3'}),
None,
{},
't',
's')
be = x.get_build_env()
- assert be == {'O':'ob3', 'Y':'yyy'}, be
+ assert be['O'] == 'ob3', be['O']
+ assert be['Y'] == 'yyy', be['Y']
def test_get_action_list(self):
"""Test fetching and generating an action list"""
@@ -131,10 +134,24 @@ class ExecutorTestCase(unittest.TestCase):
a.append(action)
assert target == ['t1', 't2'], target
assert source == ['s1', 's2'], source
- assert env == {'CALL':'call'}, env
+ assert env['CALL'] == 'call', env['CALL']
x(MyNode(['pre'], ['post']), func)
assert actions == ['pre', 'action1', 'action2', 'post'], actions
+ def test_cleanup(self):
+ """Test cleaning up an Executor"""
+ x = SCons.Executor.Executor('b', 'e', 'o', 't', ['s1', 's2'])
+
+ x.cleanup()
+
+ x.build_env = 'eee'
+ be = x.get_build_env()
+ assert be == 'eee', be
+
+ x.cleanup()
+
+ assert not hasattr(x, 'build_env')
+
def test_add_sources(self):
"""Test adding sources to an Executor"""
x = SCons.Executor.Executor('b', 'e', 'o', 't', ['s1', 's2'])