diff options
author | Steven Knight <knight@baldmt.com> | 2004-10-21 12:07:26 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2004-10-21 12:07:26 (GMT) |
commit | 4438a7d92b3f72bc79186f9a5e90330ee73e1772 (patch) | |
tree | 803f5bc5122b2a22d15f8375bab9361164487a6c /test/Mkdir.py | |
parent | df03c65239ee829c8e1a9a932721d75a5a785416 (diff) | |
download | SCons-4438a7d92b3f72bc79186f9a5e90330ee73e1772.zip SCons-4438a7d92b3f72bc79186f9a5e90330ee73e1772.tar.gz SCons-4438a7d92b3f72bc79186f9a5e90330ee73e1772.tar.bz2 |
Handle use of Mkdir() when the file exists.
Diffstat (limited to 'test/Mkdir.py')
-rw-r--r-- | test/Mkdir.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/Mkdir.py b/test/Mkdir.py index cdbcd4b..a198571 100644 --- a/test/Mkdir.py +++ b/test/Mkdir.py @@ -51,6 +51,11 @@ env.Command('f5.out', 'f5.in', [Mkdir("$DIR"), Cat]) env.Command('f6.out', 'f6.in', [Cat, Mkdir("Mkdir-$SOURCE"), Mkdir("$TARGET-Mkdir")]) +# Make sure that a user-defined Mkdir builder on a directory +# doesn't get executed twice if it has to get called to create +# directory for another target. +env.Command(Dir('hello'), None, [Mkdir('$TARGET')]) +env.Command('hello/world', None, [Touch('$TARGET')]) """) test.write('f2.in', "f2.in\n") @@ -66,7 +71,9 @@ cat(["f5.out"], ["f5.in"]) cat(["f6.out"], ["f6.in"]) Mkdir("Mkdir-f6.in") Mkdir("f6.out-Mkdir") -""") +Mkdir("hello") +Touch("%s") +""" % (os.path.join('hello', 'world'))) test.run(options = '-n', arguments = '.', stdout = expect) test.must_not_exist('d1') @@ -88,10 +95,13 @@ test.must_match('f5.out', "f5.in\n") test.must_exist('f6.out') test.must_exist('Mkdir-f6.in') test.must_exist('f6.out-Mkdir') +test.must_exist('hello') +test.must_exist('hello/world') test.write(['d1', 'file'], "d1/file\n") test.write(['d3', 'file'], "d3/file\n") test.write(['Mkdir-f6.in', 'file'], "Mkdir-f6.in/file\n") test.write(['f6.out-Mkdir', 'file'], "f6.out-Mkdir/file\n") +test.write(['hello', 'file'], "hello/file\n") test.pass_test() |