summaryrefslogtreecommitdiff
path: root/src/engine/SCons/MemoizeTests.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/SCons/MemoizeTests.py')
-rw-r--r--src/engine/SCons/MemoizeTests.py20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/engine/SCons/MemoizeTests.py b/src/engine/SCons/MemoizeTests.py
index 883b505..778162a 100644
--- a/src/engine/SCons/MemoizeTests.py
+++ b/src/engine/SCons/MemoizeTests.py
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/MemoizeTests.py rel_2.3.5:3347:d31d5a4e74b6 2015/07/31 14:36:10 bdbaddog"
+__revision__ = "src/engine/SCons/MemoizeTests.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
import sys
import unittest
@@ -30,22 +30,18 @@ import TestUnit
import SCons.Memoize
-
+# Enable memoization counting
+SCons.Memoize.EnableMemoization()
class FakeObject(object):
- __metaclass__ = SCons.Memoize.Memoized_Metaclass
-
- memoizer_counters = []
-
def __init__(self):
self._memo = {}
def _dict_key(self, argument):
return argument
- memoizer_counters.append(SCons.Memoize.CountDict('dict', _dict_key))
-
+ @SCons.Memoize.CountDictCall(_dict_key)
def dict(self, argument):
memo_key = argument
@@ -66,8 +62,7 @@ class FakeObject(object):
return result
- memoizer_counters.append(SCons.Memoize.CountValue('value'))
-
+ @SCons.Memoize.CountMethodCall
def value(self):
try:
@@ -82,10 +77,7 @@ class FakeObject(object):
return result
def get_memoizer_counter(self, name):
- for mc in self.memoizer_counters:
- if mc.method_name == name:
- return mc
- return None
+ return SCons.Memoize.CounterList.get(self.__class__.__name__+'.'+name, None)
class Returner(object):
def __init__(self, result):