diff options
| author | Steven Knight <knight@baldmt.com> | 2002-04-04 09:07:00 (GMT) |
|---|---|---|
| committer | Steven Knight <knight@baldmt.com> | 2002-04-04 09:07:00 (GMT) |
| commit | 6603cc0d6643e529da45fef6f85fcc1a0fc02ea4 (patch) | |
| tree | 4a27de7c3fd70e5af0f257ccc73aab38e343f156 /test | |
| parent | a7669bc6a02999a3375c7e732a27ded5f9bb9935 (diff) | |
| download | SCons-6603cc0d6643e529da45fef6f85fcc1a0fc02ea4.zip SCons-6603cc0d6643e529da45fef6f85fcc1a0fc02ea4.tar.gz SCons-6603cc0d6643e529da45fef6f85fcc1a0fc02ea4.tar.bz2 | |
Fix --debug=tree for directory targets (Anthony Roach)
Diffstat (limited to 'test')
| -rw-r--r-- | test/Scanner.py | 6 | ||||
| -rw-r--r-- | test/dependency-cycle.py | 8 | ||||
| -rw-r--r-- | test/option--debug.py | 37 |
3 files changed, 42 insertions, 9 deletions
diff --git a/test/Scanner.py b/test/Scanner.py index 1a02447..dbaa8b5 100644 --- a/test/Scanner.py +++ b/test/Scanner.py @@ -61,7 +61,7 @@ import re include_re = re.compile(r'^include\s+(\S+)$', re.M) -def kfile_scan(node, env, arg): +def kfile_scan(node, env, target, arg): contents = node.get_contents() includes = include_re.findall(contents) return includes @@ -77,7 +77,7 @@ env.Command('foo', 'foo.k', '%s build.py $SOURCES $TARGET') bar_in = File('bar.in') env.Command('bar', bar_in, '%s build.py $SOURCES $TARGET') -bar_in.scanner_set(kscan) +bar_in.source_scanner = kscan """ % (python, python)) test.write('foo.k', @@ -132,4 +132,6 @@ test.fail_test(test.read('foo') != "foo.k 1 line 1\nxxx 2\nyyy 2\nfoo.k 1 line 4 test.fail_test(test.read('bar') != "yyy 2\nbar.in 1 line 2\nbar.in 1 line 3\nzzz 2\n") +test.run(arguments = 'foo', stdout='scons: "foo" is up to date.\n') + test.pass_test() diff --git a/test/dependency-cycle.py b/test/dependency-cycle.py index 3be8da4..8116a1f 100644 --- a/test/dependency-cycle.py +++ b/test/dependency-cycle.py @@ -43,15 +43,17 @@ test.write('f1.c', r""" void f1(void) { - printf("f1.c\n"); -} + printf("f1.c\n"); +} """) -test.run(arguments = ".", stdout = "", stderr=r""" +test.run(arguments = ".", stderr=r""" SCons error: Dependency cycle: .*foo1.* -> .*foo3.* -> .*foo2.* -> .*foo1.* -> \. .* """, status=2) +test.fail_test(test.stdout() == "") + test.pass_test() diff --git a/test/option--debug.py b/test/option--debug.py index 35a3f06..42274c4 100644 --- a/test/option--debug.py +++ b/test/option--debug.py @@ -77,12 +77,12 @@ tree = """ +-%s +-foo%s | +-foo.c - | +-foo.h - | +-bar.h + | +-foo.h + | +-bar.h +-bar%s +-bar.c - +-bar.h - +-foo.h + +-bar.h + +-foo.h """ % (foo, obj,obj) test.fail_test(string.find(test.stdout(), tree) == -1) @@ -90,6 +90,35 @@ test.fail_test(string.find(test.stdout(), tree) == -1) test.run(arguments = "--debug=tree " + foo) test.fail_test(string.find(test.stdout(), tree) == -1) +tree = """scons: \".\" is up to date. + ++-. + +-SConstruct + +-bar.c + +-bar.h + +-bar%(obj)s + | +-bar.c + | +-bar.h + | +-foo.h + +-%(foo)s + | +-foo%(obj)s + | | +-foo.c + | | +-foo.h + | | +-bar.h + | +-bar%(obj)s + | +-bar.c + | +-bar.h + | +-foo.h + +-foo.c + +-foo.h + +-foo%(obj)s + +-foo.c + +-foo.h + +-bar.h +""" % globals() +test.run(arguments = "--debug=tree .") +test.fail_test(string.find(test.stdout(), tree) != 0) + test.run(arguments = "--debug=pdb", stdin = "n\ns\nq\n") test.fail_test(string.find(test.stdout(), "(Pdb)") == -1) test.fail_test(string.find(test.stdout(), "scons") == -1) |
