diff options
author | Steven Knight <knight@baldmt.com> | 2003-06-28 05:09:59 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-06-28 05:09:59 (GMT) |
commit | 6b7492bf09a6c2e49b2077cbf966915bb7eba77d (patch) | |
tree | 72d79c175b4206ccde612c95b67e7955c412959f /test | |
parent | 3757529b5b73fc69eff8a0709482198d45ed33c5 (diff) | |
download | SCons-6b7492bf09a6c2e49b2077cbf966915bb7eba77d.zip SCons-6b7492bf09a6c2e49b2077cbf966915bb7eba77d.tar.gz SCons-6b7492bf09a6c2e49b2077cbf966915bb7eba77d.tar.bz2 |
Fix -U, -D and -d with explicit targets that start with ../.
[Updating a change that was previously not synchronized to CVS.]
Diffstat (limited to 'test')
-rw-r--r-- | test/option--D.py | 38 | ||||
-rw-r--r-- | test/option--U.py | 31 | ||||
-rw-r--r-- | test/option-u.py | 36 |
3 files changed, 104 insertions, 1 deletions
diff --git a/test/option--D.py b/test/option--D.py index 0bc295c..d1a118e 100644 --- a/test/option--D.py +++ b/test/option--D.py @@ -83,7 +83,43 @@ test.run(arguments = '-D bar', chdir = 'sub1') test.fail_test(os.path.exists(test.workpath('sub1', 'foo.out'))) test.fail_test(not os.path.exists(test.workpath('sub2', 'bar.out'))) +# Make sure explicit targets beginning with ../ get built. +test.subdir('sub6', ['sub6', 'dir']) + +test.write(['sub6', 'SConstruct'], """\ +def cat(env, source, target): + target = str(target[0]) + source = map(str, source) + f = open(target, "wb") + for src in source: + f.write(open(src, "rb").read()) + f.close() +env = Environment(BUILDERS={'Cat':Builder(action=cat)}) +env.Cat('f1.out', 'f1.in') +f2 = env.Cat('f2.out', 'f2.in') +Default(f2) +SConscript('dir/SConscript', "env") +""") +test.write(['sub6', 'f1.in'], "f1.in\n") +test.write(['sub6', 'f2.in'], "f2.in\n") -test.pass_test() +test.write(['sub6', 'dir', 'SConscript'], """\ +Import("env") +f3 = env.Cat('f3.out', 'f3.in') +env.Cat('f4.out', 'f4.in') +Default(f3) +""") + +test.write(['sub6', 'dir', 'f3.in'], "f3.in\n") +test.write(['sub6', 'dir', 'f4.in'], "f4.in\n") +test.run(chdir = 'sub6/dir', arguments = '-D ../f1.out') + +test.fail_test(not os.path.exists(test.workpath('sub6', 'f1.out'))) +test.fail_test(os.path.exists(test.workpath('sub6', 'f2.out'))) +test.fail_test(os.path.exists(test.workpath('sub6', 'dir', 'f3.out'))) +test.fail_test(os.path.exists(test.workpath('sub6', 'dir', 'f4.out'))) + + +test.pass_test() diff --git a/test/option--U.py b/test/option--U.py index f5a7b74..4fb77a3 100644 --- a/test/option--U.py +++ b/test/option--U.py @@ -164,4 +164,35 @@ test.run(arguments = '-U', status=2, stderr="""\ scons: *** Do not know how to make target `not_a_target.in'. Stop. """) +# Make sure explicit targets beginning with ../ get built. +test.subdir('sub6', ['sub6', 'dir']) + +test.write(['sub6', 'SConstruct'], """\ +def cat(env, source, target): + target = str(target[0]) + source = map(str, source) + f = open(target, "wb") + for src in source: + f.write(open(src, "rb").read()) + f.close() +env = Environment(BUILDERS={'Cat':Builder(action=cat)}) +env.Cat('foo.out', 'foo.in') +SConscript('dir/SConscript', "env") +""") + +test.write(['sub6', 'foo.in'], "foo.in\n") + +test.write(['sub6', 'dir', 'SConscript'], """\ +Import("env") +bar = env.Cat('bar.out', 'bar.in') +Default(bar) +""") + +test.write(['sub6', 'dir', 'bar.in'], "bar.in\n") + +test.run(chdir = 'sub6/dir', arguments = '-U ../foo.out') + +test.fail_test(not os.path.exists(test.workpath('sub6', 'foo.out'))) +test.fail_test(os.path.exists(test.workpath('sub6', 'dir', 'bar.out'))) + test.pass_test() diff --git a/test/option-u.py b/test/option-u.py index 2b2ad4f..82583d4 100644 --- a/test/option-u.py +++ b/test/option-u.py @@ -136,4 +136,40 @@ test.fail_test(os.path.exists(test.workpath('sub4', 'dir', 'f4b.out'))) test.fail_test(test.read(['build', 'f4a.out']) != "sub4/f4a.in") test.fail_test(test.read(['build', 'dir', 'f4b.out']) != "sub4/dir/f4b.in") +# Make sure explicit targets beginning with ../ get built. +test.subdir('sub6', ['sub6', 'dir']) + +test.write(['sub6', 'SConstruct'], """\ +def cat(env, source, target): + target = str(target[0]) + source = map(str, source) + f = open(target, "wb") + for src in source: + f.write(open(src, "rb").read()) + f.close() +env = Environment(BUILDERS={'Cat':Builder(action=cat)}) +env.Cat('f1.out', 'f1.in') +env.Cat('f2.out', 'f2.in') +SConscript('dir/SConscript', "env") +""") + +test.write(['sub6', 'f1.in'], "f1.in\n") +test.write(['sub6', 'f2.in'], "f2.in\n") + +test.write(['sub6', 'dir', 'SConscript'], """\ +Import("env") +env.Cat('f3.out', 'f3.in') +env.Cat('f4.out', 'f4.in') +""") + +test.write(['sub6', 'dir', 'f3.in'], "f3.in\n") +test.write(['sub6', 'dir', 'f4.in'], "f4.in\n") + +test.run(chdir = 'sub6/dir', arguments = '-u ../f2.out') + +test.fail_test(os.path.exists(test.workpath('sub6', 'f1.out'))) +test.fail_test(not os.path.exists(test.workpath('sub6', 'f2.out'))) +test.fail_test(os.path.exists(test.workpath('sub6', 'dir', 'f3.out'))) +test.fail_test(os.path.exists(test.workpath('sub6', 'dir', 'f4.out'))) + test.pass_test() |