diff options
author | Steven Knight <knight@baldmt.com> | 2004-01-29 06:57:54 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2004-01-29 06:57:54 (GMT) |
commit | f6b6fd1cf86a5441a1a48d2a6d1b028e80ed4846 (patch) | |
tree | 904de3f7b723e87d7f4be938bf43532301084470 /test | |
parent | b9da200e528ab51373bdd2e5fad06f57d4a268c4 (diff) | |
download | SCons-f6b6fd1cf86a5441a1a48d2a6d1b028e80ed4846.zip SCons-f6b6fd1cf86a5441a1a48d2a6d1b028e80ed4846.tar.gz SCons-f6b6fd1cf86a5441a1a48d2a6d1b028e80ed4846.tar.bz2 |
Fetch implicit dependencies from SCCS/RCS.
Diffstat (limited to 'test')
-rw-r--r-- | test/RCS.py | 46 | ||||
-rw-r--r-- | test/SCCS.py | 47 |
2 files changed, 93 insertions, 0 deletions
diff --git a/test/RCS.py b/test/RCS.py index 7be0080..93a985e 100644 --- a/test/RCS.py +++ b/test/RCS.py @@ -49,6 +49,8 @@ def is_writable(file): mode = os.stat(file)[stat.ST_MODE] return mode & stat.S_IWUSR + + # Test explicit checkouts from local RCS files. test.subdir('work1', ['work1', 'sub']) @@ -137,6 +139,8 @@ test.fail_test(is_writable(test.workpath('work1', 'ccc.in'))) test.fail_test(is_writable(test.workpath('work1', 'sub', 'ddd.in'))) test.fail_test(is_writable(test.workpath('work1', 'sub', 'fff.in'))) + + # Test transparent RCS checkouts from an RCS subdirectory. test.subdir('work2', ['work2', 'RCS'], ['work2', 'sub'], ['work2', 'sub', 'RCS']) @@ -241,5 +245,47 @@ test.fail_test(not is_writable(test.workpath('work2', 'ccc.in'))) test.fail_test(not is_writable(test.workpath('work2', 'sub', 'ddd.in'))) test.fail_test(not is_writable(test.workpath('work2', 'sub', 'fff.in'))) + + +# Test transparent RCS checkouts of implicit dependencies. +test.subdir('work3', ['work3', 'RCS']) + +test.write(['work3', 'foo.c'], """\ +#include "foo.h" +int +main(int argc, char *argv[]) { + printf(STR); + printf("work3/foo.c\\n"); +} +""") +test.run(chdir = 'work3', + program = ci, + arguments = "-f -tfoo.c foo.c", + stderr = None) + +test.write(['work3', 'foo.h'], """\ +#define STR "work3/foo.h\\n" +""") +test.run(chdir = 'work3', + program = ci, + arguments = "-f -tfoo.h foo.h", + stderr = None) + +test.write(['work3', 'SConstruct'], """ +env = Environment() +env.Program('foo.c') +""") + +test.run(chdir='work3', stderr="""\ +RCS/foo.c,v --> foo.c +revision 1.1 +done +RCS/foo.h,v --> foo.h +revision 1.1 +done +""") + + + # test.pass_test() diff --git a/test/SCCS.py b/test/SCCS.py index 3194f4f..b98e9a7 100644 --- a/test/SCCS.py +++ b/test/SCCS.py @@ -44,6 +44,8 @@ def is_writable(file): mode = os.stat(file)[stat.ST_MODE] return mode & stat.S_IWUSR + + # Test explicit checkouts from local SCCS files. test.subdir('work1', ['work1', 'sub']) @@ -130,6 +132,8 @@ test.fail_test(not is_writable(test.workpath('work1', 'ccc.in'))) test.fail_test(not is_writable(test.workpath('work1', 'sub', 'ddd.in'))) test.fail_test(not is_writable(test.workpath('work1', 'sub', 'fff.in'))) + + # Test transparent checkouts from SCCS files in an SCCS subdirectory. test.subdir('work2', ['work2', 'SCCS'], ['work2', 'sub'], ['work2', 'sub', 'SCCS']) @@ -215,4 +219,47 @@ test.fail_test(is_writable(test.workpath('work2', 'ccc.in'))) test.fail_test(is_writable(test.workpath('work2', 'sub', 'ddd.in'))) test.fail_test(is_writable(test.workpath('work2', 'sub', 'fff.in'))) + + + +# Test transparent SCCS checkouts of implicit dependencies. +test.subdir('work3', ['work3', 'SCCS']) + +test.write(['work3', 'foo.c'], """\ +#include "foo.h" +int +main(int argc, char *argv[]) { + printf(STR); + printf("work3/foo.c\\n"); +} +""") +test.run(chdir = 'work3', + program = sccs, + arguments = "create foo.c", + stderr = None) +test.unlink(['work3', 'foo.c']) +test.unlink(['work3', ',foo.c']) + +test.write(['work3', 'foo.h'], """\ +#define STR "work3/foo.h\\n" +""") +test.run(chdir = 'work3', + program = sccs, + arguments = "create foo.h", + stderr = None) +test.unlink(['work3', 'foo.h']) +test.unlink(['work3', ',foo.h']) + +test.write(['work3', 'SConstruct'], """ +env = Environment() +env.Program('foo.c') +""") + +test.run(chdir='work3', stderr = """\ +foo.c 1.1: 6 lines +foo.h 1.1: 1 lines +""") + + + test.pass_test() |