diff options
author | Steven Knight <knight@baldmt.com> | 2004-02-09 06:59:46 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2004-02-09 06:59:46 (GMT) |
commit | 653ac5db394d13a48068d170b6a294c32768235f (patch) | |
tree | 2179fb29cac6cb7112e1b9b423e6a42ebb6fdd8f /src/engine/SCons/JobTests.py | |
parent | beb70fd5da65eb66b2b91df6ed487e4e927b5273 (diff) | |
download | SCons-653ac5db394d13a48068d170b6a294c32768235f.zip SCons-653ac5db394d13a48068d170b6a294c32768235f.tar.gz SCons-653ac5db394d13a48068d170b6a294c32768235f.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/JobTests.py')
-rw-r--r-- | src/engine/SCons/JobTests.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/engine/SCons/JobTests.py b/src/engine/SCons/JobTests.py index 1b0128b..48caa16 100644 --- a/src/engine/SCons/JobTests.py +++ b/src/engine/SCons/JobTests.py @@ -100,6 +100,9 @@ class Task: self.taskmaster.test_case.failUnless(self.was_prepared, "the task wasn't prepared") + def postprocess(self): + self.taskmaster.num_postprocessed = self.taskmaster.num_postprocessed + 1 + class ExceptionTask: """A dummy task class for testing purposes.""" @@ -130,6 +133,9 @@ class ExceptionTask: self.taskmaster.test_case.failUnless(self.was_prepared, "the task wasn't prepared") + def postprocess(self): + self.taskmaster.num_postprocessed = self.taskmaster.num_postprocessed + 1 + class Taskmaster: """A dummy taskmaster class for testing the job classes.""" @@ -142,6 +148,7 @@ class Taskmaster: self.num_iterated = 0 self.num_executed = 0 self.num_failed = 0 + self.num_postprocessed = 0 self.Task = Task # 'guard' guards 'task_begin_list' and 'task_end_list' try: @@ -170,6 +177,9 @@ class Taskmaster: def all_tasks_are_iterated(self): return self.num_iterated == self.num_tasks + def all_tasks_are_postprocessed(self): + return self.num_postprocessed == self.num_tasks + def is_blocked(self): if self.stop or self.all_tasks_are_executed(): return 0 @@ -206,6 +216,8 @@ class ParallelTestCase(unittest.TestCase): "all the tests were not executed") self.failUnless(taskmaster.all_tasks_are_iterated(), "all the tests were not iterated over") + self.failUnless(taskmaster.all_tasks_are_postprocessed(), + "all the tests were not postprocessed") self.failIf(taskmaster.num_failed, "some task(s) failed to execute") @@ -223,6 +235,8 @@ class SerialTestCase(unittest.TestCase): "all the tests were not executed") self.failUnless(taskmaster.all_tasks_are_iterated(), "all the tests were not iterated over") + self.failUnless(taskmaster.all_tasks_are_postprocessed(), + "all the tests were not postprocessed") self.failIf(taskmaster.num_failed, "some task(s) failed to execute") @@ -245,6 +259,8 @@ class NoParallelTestCase(unittest.TestCase): "all the tests were not executed") self.failUnless(taskmaster.all_tasks_are_iterated(), "all the tests were not iterated over") + self.failUnless(taskmaster.all_tasks_are_postprocessed(), + "all the tests were not postprocessed") self.failIf(taskmaster.num_failed, "some task(s) failed to execute") finally: @@ -265,6 +281,8 @@ class SerialExceptionTestCase(unittest.TestCase): "exactly one task should have been iterated") self.failUnless(taskmaster.num_failed == 1, "exactly one task should have failed") + self.failUnless(taskmaster.num_postprocessed == 1, + "exactly one task should have been postprocessed") class ParallelExceptionTestCase(unittest.TestCase): def runTest(self): @@ -280,6 +298,8 @@ class ParallelExceptionTestCase(unittest.TestCase): "one or more task should have been iterated") self.failUnless(taskmaster.num_failed >= 1, "one or more tasks should have failed") + self.failUnless(taskmaster.num_postprocessed >= 1, + "one or more tasks should have been postprocessed") def suite(): |