diff options
| author | Steven Knight <knight@baldmt.com> | 2005-01-23 03:05:05 (GMT) |
|---|---|---|
| committer | Steven Knight <knight@baldmt.com> | 2005-01-23 03:05:05 (GMT) |
| commit | 9b2dae34a2a0fd013b7849e4f8a8d7adb1bc136c (patch) | |
| tree | a3d67b02d8d2a64a38b697baafaede1d7004be79 /src/engine/SCons/Node/NodeTests.py | |
| parent | f7158d025b936cc3cf3f0579ef39df98dc74e8cb (diff) | |
| download | SCons-9b2dae34a2a0fd013b7849e4f8a8d7adb1bc136c.zip SCons-9b2dae34a2a0fd013b7849e4f8a8d7adb1bc136c.tar.gz SCons-9b2dae34a2a0fd013b7849e4f8a8d7adb1bc136c.tar.bz2 | |
Use WeakValueDicts in the Memoizer to cut down on memory use.
Diffstat (limited to 'src/engine/SCons/Node/NodeTests.py')
| -rw-r--r-- | src/engine/SCons/Node/NodeTests.py | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/engine/SCons/Node/NodeTests.py b/src/engine/SCons/Node/NodeTests.py index 4424e61..0637ceb 100644 --- a/src/engine/SCons/Node/NodeTests.py +++ b/src/engine/SCons/Node/NodeTests.py @@ -76,6 +76,12 @@ class MyAction(MyActionBase): self.order = built_order return 0 +class MyExecutor: + def get_build_scanner_path(self, scanner): + return 'executor would call %s' % scanner + def cleanup(self): + self.cleaned_up = 1 + class MyListAction(MyActionBase): def __init__(self, list): self.list = list @@ -316,9 +322,6 @@ class NodeTestCase(unittest.TestCase): def test_get_build_scanner_path(self): """Test the get_build_scanner_path() method""" n = SCons.Node.Node() - class MyExecutor: - def get_build_scanner_path(self, scanner): - return 'executor would call %s' % scanner x = MyExecutor() n.set_executor(x) p = n.get_build_scanner_path('fake_scanner') @@ -357,6 +360,14 @@ class NodeTestCase(unittest.TestCase): n.set_executor(1) assert n.executor == 1, n.executor + def test_executor_cleanup(self): + """Test letting the executor cleanup its cache""" + n = SCons.Node.Node() + x = MyExecutor() + n.set_executor(x) + n.executor_cleanup() + assert x.cleaned_up + def test_reset_executor(self): """Test the reset_executor() method""" n = SCons.Node.Node() @@ -631,6 +642,8 @@ class NodeTestCase(unittest.TestCase): def test_prepare(self): """Test preparing a node to be built + + By extension, this also tests the missing() method. """ node = SCons.Node.Node() @@ -1117,6 +1130,9 @@ class NodeTestCase(unittest.TestCase): n.implicit = 'testimplicit' n.waiting_parents = ['foo', 'bar'] + x = MyExecutor() + n.set_executor(x) + n.clear() assert not hasattr(n, 'binfo'), n.bsig @@ -1124,6 +1140,7 @@ class NodeTestCase(unittest.TestCase): assert n.found_includes == {}, n.found_includes assert n.implicit is None, n.implicit assert n.waiting_parents == [], n.waiting_parents + assert x.cleaned_up def test_get_subst_proxy(self): """Test the get_subst_proxy method.""" |
