summaryrefslogtreecommitdiffstats
path: root/test/option--U.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-04-24 16:11:40 (GMT)
committerSteven Knight <knight@baldmt.com>2002-04-24 16:11:40 (GMT)
commit755fe44095622d2ed2ac7a469686286212ea6f3c (patch)
tree33bd1ba591a86b54fdee7477d0e941a9a9c3727b /test/option--U.py
parent7eddfeb87f28c4cf8ba6839efdad8b366214ec01 (diff)
downloadSCons-755fe44095622d2ed2ac7a469686286212ea6f3c.zip
SCons-755fe44095622d2ed2ac7a469686286212ea6f3c.tar.gz
SCons-755fe44095622d2ed2ac7a469686286212ea6f3c.tar.bz2
Make Alias work with -U, -u, and -D (Anthony Roach)
Diffstat (limited to 'test/option--U.py')
-rw-r--r--test/option--U.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/test/option--U.py b/test/option--U.py
index 128e6c1..7f3e3f2 100644
--- a/test/option--U.py
+++ b/test/option--U.py
@@ -44,8 +44,9 @@ file.close()
""")
test.write('SConstruct', """
+import SCons.Defaults
B = Builder(name='B', action='%s build.py $TARGET $SOURCES')
-env = Environment(BUILDERS = [B])
+env = Environment(BUILDERS = [B, SCons.Defaults.Alias])
Default(env.B(target = 'sub1/foo.out', source = 'sub1/foo.in'))
Export('env')
SConscript('sub2/SConscript')
@@ -57,7 +58,9 @@ Default(env.B(target = 'sub2/xxx.out', source = 'xxx.in'))
test.write(['sub2', 'SConscript'], """
Import('env')
-Default(env.B(target = 'bar.out', source = 'bar.in'))
+bar = env.B(target = 'bar.out', source = 'bar.in')
+Default(bar)
+env.Alias('bar', bar)
Default(env.B(target = '../bar.out', source = 'bar.in'))
""")
@@ -106,5 +109,17 @@ test.fail_test(not os.path.exists(test.workpath('sub3', 'baz.out')))
test.fail_test(os.path.exists(test.workpath('bar.out')))
test.fail_test(not os.path.exists(test.workpath('sub2/xxx.out')))
+test.unlink(['sub1', 'foo.out'])
+test.unlink(['sub3', 'baz.out'])
+test.unlink(['sub2', 'xxx.out'])
+
+test.run(chdir = 'sub3', arguments='-U bar')
+test.fail_test(os.path.exists(test.workpath('sub1', 'foo.out')))
+test.fail_test(not os.path.exists(test.workpath('sub2', 'bar.out')))
+test.fail_test(not os.path.exists(test.workpath('sub2b', 'bar.out')))
+test.fail_test(os.path.exists(test.workpath('sub3', 'baz.out')))
+test.fail_test(os.path.exists(test.workpath('bar.out')))
+test.fail_test(os.path.exists(test.workpath('sub2/xxx.out')))
+
test.pass_test()