summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-12-29 21:04:56 (GMT)
committerSteven Knight <knight@baldmt.com>2004-12-29 21:04:56 (GMT)
commita2b119edf2fdd972c426f08f9898fb2efbe36646 (patch)
tree12b6722f049211b37574477e82ab5c49a0521052 /test
parent9113805b081ef58fdf56bd5b5a9be6afad0b7a41 (diff)
downloadSCons-a2b119edf2fdd972c426f08f9898fb2efbe36646.zip
SCons-a2b119edf2fdd972c426f08f9898fb2efbe36646.tar.gz
SCons-a2b119edf2fdd972c426f08f9898fb2efbe36646.tar.bz2
Add a Memoizer metaclass to collect the logic for caching values in one location. Convert by-hand caching to use of Memoizer. (Kevin Quick)
Diffstat (limited to 'test')
-rw-r--r--test/DirSource.py4
-rw-r--r--test/Repository/LIBPATH.py2
-rw-r--r--test/scan-once.py13
3 files changed, 13 insertions, 6 deletions
diff --git a/test/DirSource.py b/test/DirSource.py
index 5c0291e..84d8185 100644
--- a/test/DirSource.py
+++ b/test/DirSource.py
@@ -69,8 +69,8 @@ env_csig.TestDir(source='csig', target='csig.out')
""")
test.run(arguments=".", stderr=None)
-test.fail_test(test.read('bsig.out') != 'stuff\n')
-test.fail_test(test.read('csig.out') != 'stuff\n')
+test.must_match('bsig.out', 'stuff\n')
+test.must_match('csig.out', 'stuff\n')
test.up_to_date(arguments='bsig.out')
test.up_to_date(arguments='csig.out')
diff --git a/test/Repository/LIBPATH.py b/test/Repository/LIBPATH.py
index 96b198e..4b249e5 100644
--- a/test/Repository/LIBPATH.py
+++ b/test/Repository/LIBPATH.py
@@ -49,7 +49,7 @@ def write_LIBDIRFLAGS(env, target, source):
pre = env.subst('$LIBDIRPREFIX')
suf = env.subst('$LIBDIRSUFFIX')
f = open(str(target[0]), 'wb')
- for arg in string.split(env.subst('$_LIBDIRFLAGS')):
+ for arg in string.split(env.subst('$_LIBDIRFLAGS', target=target)):
if arg[:len(pre)] == pre:
arg = arg[len(pre):]
if arg[-len(suf):] == suf:
diff --git a/test/scan-once.py b/test/scan-once.py
index 7019e23..4436310 100644
--- a/test/scan-once.py
+++ b/test/scan-once.py
@@ -481,14 +481,21 @@ test.run(arguments = 'SLF',
# XXX Note that the generated .h files still get scanned twice,
# once before they're generated and once after. That's the
# next thing to fix here.
-test.fail_test(test.read("MyCScan.out", "rb") != """\
+
+# Note KWQ 01 Nov 2004: used to check for a one for all counts below;
+# this was indirectly a test that the caching method in use at the
+# time was working. With the introduction of Memoize-based caching,
+# the caching is performed right at the interface level, so the test
+# here cannot be run the same way; ergo real counts are used below.
+
+test.must_match("MyCScan.out", """\
libg_1.c: 1
libg_2.c: 1
libg_3.c: 1
-libg_gx.h: 1
+libg_gx.h: 3
libg_gy.h: 1
libg_gz.h: 1
-libg_w.h: 1
+libg_w.h: 3
""")
test.pass_test()