summaryrefslogtreecommitdiff
path: root/test/Default.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-01-11 15:03:46 +0000
committerSteven Knight <knight@baldmt.com>2002-01-11 15:03:46 +0000
commite6c4e9ae3fc9edc60981f15ece898645747ba82c (patch)
treec36fa5eac0d3d576e2ad42b4fb6d2f861373f353 /test/Default.py
parentdd40d81aa957e6c4724c648bf74390280849e944 (diff)
downloadscons-e6c4e9ae3fc9edc60981f15ece898645747ba82c.tar.gz
Fix using a directory as Default().
Diffstat (limited to 'test/Default.py')
-rw-r--r--test/Default.py37
1 files changed, 32 insertions, 5 deletions
diff --git a/test/Default.py b/test/Default.py
index 5685c3d1..1d868292 100644
--- a/test/Default.py
+++ b/test/Default.py
@@ -99,30 +99,57 @@ test.fail_test(test.read(test.workpath('four', 'bar.out')) != "four/bar.in\n")
-test.subdir('subdir')
+test.subdir('sub1')
test.write('SConstruct', """
B = Builder(name = 'B', action = r'%s build.py $TARGET $SOURCES')
env = Environment(BUILDERS = [B])
env.B(target = 'xxx.out', source = 'xxx.in')
-SConscript('subdir/SConscript')
+SConscript('sub1/SConscript')
""" % python)
test.write('xxx.in', "xxx.in\n")
-test.write(['subdir', 'SConscript'], """
+test.write(['sub1', 'SConscript'], """
B = Builder(name = 'B', action = r'%s build.py $TARGET $SOURCES')
env = Environment(BUILDERS = [B])
env.B(target = 'xxx.out', source = 'xxx.in')
Default('xxx.out')
""" % python)
-test.write(['subdir', 'xxx.in'], "subdir/xxx.in\n")
+test.write(['sub1', 'xxx.in'], "sub1/xxx.in\n")
test.run() # no arguments, use the Default
test.fail_test(os.path.exists(test.workpath('xxx.out')))
-test.fail_test(test.read(test.workpath('subdir', 'xxx.out')) != "subdir/xxx.in\n")
+test.fail_test(test.read(test.workpath('sub1', 'xxx.out')) != "sub1/xxx.in\n")
+
+
+
+test.subdir('sub2')
+
+test.write('SConstruct', """
+Default('sub2')
+B = Builder(name = 'B', action = r'%s build.py $TARGET $SOURCES')
+env = Environment(BUILDERS = [B])
+env.B(target = 'xxx.out', source = 'xxx.in')
+SConscript('sub2/SConscript')
+""" % python)
+
+test.write('xxx.in', "xxx.in\n")
+
+test.write(['sub2', 'SConscript'], """
+B = Builder(name = 'B', action = r'%s build.py $TARGET $SOURCES')
+env = Environment(BUILDERS = [B])
+env.B(target = 'xxx.out', source = 'xxx.in')
+""" % python)
+
+test.write(['sub2', 'xxx.in'], "sub2/xxx.in\n")
+
+test.run() # no arguments, use the Default
+
+test.fail_test(os.path.exists(test.workpath('xxx.out')))
+test.fail_test(test.read(test.workpath('sub2', 'xxx.out')) != "sub2/xxx.in\n")