summaryrefslogtreecommitdiff
path: root/test/TARGETS.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2005-08-13 20:44:44 +0000
committerSteven Knight <knight@baldmt.com>2005-08-13 20:44:44 +0000
commit3c4eea886bf6ed264df3e7a521e196eaf6478378 (patch)
tree545e613b2d7da496fda8f0b0a3642b5f2c86ae42 /test/TARGETS.py
parent0fd2b45330d0d7c3a5aa4aec4a8c0456f5c0ddb6 (diff)
downloadscons-3c4eea886bf6ed264df3e7a521e196eaf6478378.tar.gz
Allow modification of BUILD_TARGETS from with SConscript files. (Stanislav Baranov)
Diffstat (limited to 'test/TARGETS.py')
-rw-r--r--test/TARGETS.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/TARGETS.py b/test/TARGETS.py
index 5c73d81b..d2520d57 100644
--- a/test/TARGETS.py
+++ b/test/TARGETS.py
@@ -32,6 +32,8 @@ import TestSCons
test = TestSCons.TestSCons()
+
+
test.write('SConstruct', """
print COMMAND_LINE_TARGETS
print map(str, BUILD_TARGETS)
@@ -62,6 +64,8 @@ scons: Nothing to be done for `aaa'.
""")
test.run(arguments = 'bbb ccc=xyz -n aaa', stdout = expect)
+
+
test.write('SConstruct', """
env = Environment()
print map(str, DEFAULT_TARGETS)
@@ -106,4 +110,31 @@ expect = test.wrap_stdout(build_str = "scons: `.' is up to date.\n",
""")
test.run(arguments = '.', stdout = expect)
+
+
+test.write('SConstruct', """\
+print map(str, BUILD_TARGETS)
+SConscript('SConscript')
+print map(str, BUILD_TARGETS)
+""")
+
+test.write('SConscript', """\
+BUILD_TARGETS.append('sconscript_target')
+""")
+
+test.write('command_line_target', "command_line_target\n")
+test.write('sconscript_target', "sconscript_target\n")
+
+expect = test.wrap_stdout(read_str = """\
+['command_line_target']
+['command_line_target', 'sconscript_target']
+""",
+ build_str = """\
+scons: Nothing to be done for `command_line_target'.
+scons: Nothing to be done for `sconscript_target'.
+""")
+test.run(arguments = 'command_line_target', stdout = expect)
+
+
+
test.pass_test()