diff options
author | Steven Knight <knight@baldmt.com> | 2005-01-13 18:28:05 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2005-01-13 18:28:05 (GMT) |
commit | 7f820e64f11a4f047685713c163ca5fee35e676c (patch) | |
tree | 8f74c1bb75c09751e673438c0d2d5cad9bbb8607 /test/option | |
parent | 14dce368b0856c2dbaf7ccd7b10934ea7bcef46b (diff) | |
download | SCons-7f820e64f11a4f047685713c163ca5fee35e676c.zip SCons-7f820e64f11a4f047685713c163ca5fee35e676c.tar.gz SCons-7f820e64f11a4f047685713c163ca5fee35e676c.tar.bz2 |
Fix --debug=memoizer so it actually prints some stats on Python 2.x.
Diffstat (limited to 'test/option')
-rw-r--r-- | test/option/debug-memoizer.py | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/test/option/debug-memoizer.py b/test/option/debug-memoizer.py index 2b79c11..4249ca6 100644 --- a/test/option/debug-memoizer.py +++ b/test/option/debug-memoizer.py @@ -28,6 +28,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Test calling the --debug=memoizer option. """ +import os import string import TestSCons @@ -43,11 +44,46 @@ env.Cat('file.out', 'file.in') test.write('file.in', "file.in\n") -test.run(arguments = '--debug=memoizer') +# The banner, and a list of representative method names that we expect +# to show up in the output. Of course, this depends on keeping those +# names in the implementation, so if we change them, we'll have to +# change this test... +expect = [ + "Memoizer (memory cache) hits and misses", + "Dir.exists()", + "Executor.get_contents()", + "File._save_str()", + "SConsEnvironment.get_calculator()", +] -expect = "Memoizer (memory cache) hits and misses" -test.fail_test(string.find(test.stdout(), expect) == -1) +test.run(arguments = '--debug=memoizer') +stdout = test.stdout() +missing = filter(lambda e, s=stdout: string.find(s, e) == -1, expect) +if missing: + print "Missing the following strings in the command line --debug=memoizer output:" + print " " + string.join(missing, "\n ") + print "STDOUT ============" + print stdout + test.fail_test(1) test.must_match('file.out', "file.in\n") + + +test.unlink("file.out") + +os.environ['SCONSFLAGS'] = '--debug=memoizer' + +test.run() +stdout = test.stdout() +missing = filter(lambda e, s=stdout: string.find(s, e) == -1, expect) +if missing: + print "Missing the following strings in the SCONSFLAGS=--debug=memoizer output:" + print " " + string.join(missing, "\n ") + print "STDOUT ============" + print stdout + test.fail_test(1) + + + test.pass_test() |