diff options
author | Steven Knight <knight@baldmt.com> | 2003-02-21 14:55:50 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-02-21 14:55:50 (GMT) |
commit | dbe12389b6253c305749d8e2d4e1558477a15787 (patch) | |
tree | 01b3f95492320b80b57f4c86d23ffe629d290a58 /test/RCS.py | |
parent | 6496b8580990a6efadaeeaf65c25ee7d5964c7a1 (diff) | |
download | SCons-dbe12389b6253c305749d8e2d4e1558477a15787.zip SCons-dbe12389b6253c305749d8e2d4e1558477a15787.tar.gz SCons-dbe12389b6253c305749d8e2d4e1558477a15787.tar.bz2 |
Support fetching SConscript files from source code management systems.
Diffstat (limited to 'test/RCS.py')
-rw-r--r-- | test/RCS.py | 106 |
1 files changed, 94 insertions, 12 deletions
diff --git a/test/RCS.py b/test/RCS.py index 6c0e597..55e16f8 100644 --- a/test/RCS.py +++ b/test/RCS.py @@ -37,25 +37,46 @@ test = TestSCons.TestSCons() rcs = test.where_is('rcs') if not rcs: print "Could not find RCS, skipping test(s)." - test.no_result(1) + test.pass_test(1) ci = test.where_is('ci') if not ci: print "Could not find `ci' command, skipping test(s)." - test.no_result(1) + test.pass_test(1) # Test checkouts from local RCS files -test.subdir('work1') +test.subdir('work1', ['work1', 'sub']) for file in ['aaa.in', 'bbb.in', 'ccc.in']: test.write(['work1', file], "work1/%s\n" % file) args = "-f -t%s %s" % (file, file) test.run(chdir = 'work1', program = ci, arguments = args, stderr = None) +test.write(['work1', 'sub', 'SConscript'], """\ +Import("env") +env.Cat('ddd.out', 'ddd.in') +env.Cat('eee.out', 'eee.in') +env.Cat('fff.out', 'fff.in') +env.Cat('all', ['ddd.out', 'eee.out', 'fff.out']) +""") +args = "-f -tsub/SConscript sub/SConscript" +test.run(chdir = 'work1', program = ci, arguments = args, stderr = None) + +for file in ['ddd.in', 'eee.in', 'fff.in']: + test.write(['work1', 'sub', file], "work1/sub/%s\n" % file) + args = "-f -tsub/%s sub/%s" % (file, file) + test.run(chdir = 'work1', program = ci, arguments = args, stderr = None) + test.no_result(os.path.exists(test.workpath('work1', 'aaa.in'))) test.no_result(os.path.exists(test.workpath('work1', 'bbb.in'))) test.no_result(os.path.exists(test.workpath('work1', 'ccc.in'))) +test.no_result(os.path.exists(test.workpath('work1', 'sub', 'SConscript'))) + +test.no_result(os.path.exists(test.workpath('work1', 'sub', 'ddd.in'))) +test.no_result(os.path.exists(test.workpath('work1', 'sub', 'eee.in'))) +test.no_result(os.path.exists(test.workpath('work1', 'sub', 'fff.in'))) + test.write(['work1', 'SConstruct'], """ def cat(env, source, target): target = str(target[0]) @@ -70,41 +91,88 @@ env.Cat('bbb.out', 'bbb.in') env.Cat('ccc.out', 'ccc.in') env.Cat('all', ['aaa.out', 'bbb.out', 'ccc.out']) env.SourceCode('.', env.RCS()) +SConscript('sub/SConscript', "env") """) test.write(['work1', 'bbb.in'], "checked-out work1/bbb.in\n") +test.write(['work1', 'sub', 'eee.in'], "checked-out work1/sub/eee.in\n") + test.run(chdir = 'work1', arguments = '.', - stdout = test.wrap_stdout("""\ -co -p aaa.in,v > aaa.in + stdout = test.wrap_stdout(read_str = """\ +co sub/SConscript +""", + build_str = """\ +co aaa.in cat("aaa.out", "aaa.in") cat("bbb.out", "bbb.in") -co -p ccc.in,v > ccc.in +co ccc.in cat("ccc.out", "ccc.in") cat("all", ["aaa.out", "bbb.out", "ccc.out"]) +co sub/ddd.in +cat("sub/ddd.out", "sub/ddd.in") +cat("sub/eee.out", "sub/eee.in") +co sub/fff.in +cat("sub/fff.out", "sub/fff.in") +cat("sub/all", ["sub/ddd.out", "sub/eee.out", "sub/fff.out"]) """), stderr = """\ -aaa.in,v --> standard output +sub/SConscript,v --> sub/SConscript +revision 1.1 +done +aaa.in,v --> aaa.in +revision 1.1 +done +ccc.in,v --> ccc.in +revision 1.1 +done +sub/ddd.in,v --> sub/ddd.in revision 1.1 -ccc.in,v --> standard output +done +sub/fff.in,v --> sub/fff.in revision 1.1 +done """) test.fail_test(test.read(['work1', 'all']) != "work1/aaa.in\nchecked-out work1/bbb.in\nwork1/ccc.in\n") +test.fail_test(test.read(['work1', 'sub', 'all']) != "work1/sub/ddd.in\nchecked-out work1/sub/eee.in\nwork1/sub/fff.in\n") + # Test RCS checkouts from an RCS subdirectory. -test.subdir('work2', ['work2', 'RCS']) +test.subdir('work2', ['work2', 'RCS'], + ['work2', 'sub'], ['work2', 'sub', 'RCS']) for file in ['aaa.in', 'bbb.in', 'ccc.in']: test.write(['work2', file], "work2/%s\n" % file) args = "-f -t%s %s" % (file, file) test.run(chdir = 'work2', program = ci, arguments = args, stderr = None) +for file in ['ddd.in', 'eee.in', 'fff.in']: + test.write(['work2', 'sub', file], "work2/sub/%s\n" % file) + args = "-f -tsub/%s sub/%s" % (file, file) + test.run(chdir = 'work2', program = ci, arguments = args, stderr = None) + +test.write(['work2', 'sub', 'SConscript'], """\ +Import("env") +env.Cat('ddd.out', 'ddd.in') +env.Cat('eee.out', 'eee.in') +env.Cat('fff.out', 'fff.in') +env.Cat('all', ['ddd.out', 'eee.out', 'fff.out']) +""") +args = "-f -tsub/SConscript sub/SConscript" +test.run(chdir = 'work2', program = ci, arguments = args, stderr = None) + test.no_result(os.path.exists(test.workpath('work2', 'aaa.in'))) test.no_result(os.path.exists(test.workpath('work2', 'bbb.in'))) test.no_result(os.path.exists(test.workpath('work2', 'ccc.in'))) +test.no_result(os.path.exists(test.workpath('work2', 'sub', 'SConscript'))) + +test.no_result(os.path.exists(test.workpath('work2', 'sub', 'aaa.in'))) +test.no_result(os.path.exists(test.workpath('work2', 'sub', 'bbb.in'))) +test.no_result(os.path.exists(test.workpath('work2', 'sub', 'ccc.in'))) + test.write(['work2', 'SConstruct'], """ def cat(env, source, target): target = str(target[0]) @@ -120,21 +188,35 @@ env.Cat('bbb.out', 'bbb.in') env.Cat('ccc.out', 'ccc.in') env.Cat('all', ['aaa.out', 'bbb.out', 'ccc.out']) env.SourceCode('.', env.RCS()) +SConscript('sub/SConscript', "env") """) test.write(['work2', 'bbb.in'], "checked-out work2/bbb.in\n") +test.write(['work2', 'sub', 'eee.in'], "checked-out work2/sub/eee.in\n") + test.run(chdir = 'work2', arguments = '.', - stdout = test.wrap_stdout("""\ -co -q -p aaa.in,v > aaa.in + stdout = test.wrap_stdout(read_str = """\ +co -q sub/SConscript +""", + build_str = """\ +co -q aaa.in cat("aaa.out", "aaa.in") cat("bbb.out", "bbb.in") -co -q -p ccc.in,v > ccc.in +co -q ccc.in cat("ccc.out", "ccc.in") cat("all", ["aaa.out", "bbb.out", "ccc.out"]) +co -q sub/ddd.in +cat("sub/ddd.out", "sub/ddd.in") +cat("sub/eee.out", "sub/eee.in") +co -q sub/fff.in +cat("sub/fff.out", "sub/fff.in") +cat("sub/all", ["sub/ddd.out", "sub/eee.out", "sub/fff.out"]) """)) test.fail_test(test.read(['work2', 'all']) != "work2/aaa.in\nchecked-out work2/bbb.in\nwork2/ccc.in\n") +test.fail_test(test.read(['work2', 'sub', 'all']) != "work2/sub/ddd.in\nchecked-out work2/sub/eee.in\nwork2/sub/fff.in\n") + test.pass_test() |