summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/TaskmasterTests.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/TaskmasterTests.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/TaskmasterTests.py')
-rw-r--r--src/engine/SCons/TaskmasterTests.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/engine/SCons/TaskmasterTests.py b/src/engine/SCons/TaskmasterTests.py
index 63190a5..d20b805 100644
--- a/src/engine/SCons/TaskmasterTests.py
+++ b/src/engine/SCons/TaskmasterTests.py
@@ -53,6 +53,7 @@ class Node:
self.side_effect = 0
self.side_effects = []
self.alttargets = []
+ self.postprocessed = None
for kid in kids:
kid.parents.append(self)
@@ -137,6 +138,9 @@ class Node:
def __str__(self):
return self.name
+ def postprocess(self):
+ self.postprocessed = 1
+
class OtherError(Exception):
pass
@@ -791,6 +795,33 @@ class TaskmasterTestCase(unittest.TestCase):
else:
assert 0, "did not catch expected exception"
+ def test_postprocess(self):
+ """Test postprocessing targets to give them a chance to clean up
+
+ """
+ n1 = Node("n1")
+ tm = SCons.Taskmaster.Taskmaster([n1])
+
+ t = tm.next_task()
+ assert not n1.postprocessed
+ t.postprocess()
+ assert n1.postprocessed
+
+ n2 = Node("n2")
+ n3 = Node("n3")
+ tm = SCons.Taskmaster.Taskmaster([n2, n3])
+
+ assert not n2.postprocessed
+ assert not n3.postprocessed
+ t = tm.next_task()
+ t.postprocess()
+ assert n2.postprocessed
+ assert not n3.postprocessed
+ t = tm.next_task()
+ t.postprocess()
+ assert n2.postprocessed
+ assert n3.postprocessed
+
if __name__ == "__main__":