summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2010-06-15 17:53:27 (GMT)
committerSteven Knight <knight@baldmt.com>2010-06-15 17:53:27 (GMT)
commit6f237a0d0607e6a684e8c4a9a5d19d661e9487e2 (patch)
treeba438f3b4b6ca3aeb5358e83904a7a7713e4b027 /test
parent894e7eb8ee6f062f076bec3b33d13d19c475faaa (diff)
downloadSCons-6f237a0d0607e6a684e8c4a9a5d19d661e9487e2.zip
SCons-6f237a0d0607e6a684e8c4a9a5d19d661e9487e2.tar.gz
SCons-6f237a0d0607e6a684e8c4a9a5d19d661e9487e2.tar.bz2
Issue 2647: In Executor.Null.get_all_children(), really return all of
the children, including the explicit dependencies, not just the sources.
Diffstat (limited to 'test')
-rw-r--r--test/Depends/Depends.py (renamed from test/Depends.py)25
-rw-r--r--test/Depends/no-Builder.py66
-rw-r--r--test/Scanner/generated.py11
3 files changed, 84 insertions, 18 deletions
diff --git a/test/Depends.py b/test/Depends/Depends.py
index e3819c5..6804fd0 100644
--- a/test/Depends.py
+++ b/test/Depends/Depends.py
@@ -24,6 +24,10 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+"""
+Verifies basic execution of the Depends() function.
+"""
+
import os.path
import TestSCons
@@ -36,10 +40,11 @@ test.subdir('subdir', 'sub2')
test.write('build.py', r"""
import sys
-contents = open(sys.argv[2], 'rb').read() + open(sys.argv[3], 'rb').read()
-file = open(sys.argv[1], 'wb')
-file.write(contents)
-file.close()
+fp = open(sys.argv[1], 'wb')
+for fname in sys.argv[2:]:
+ fp.write(open(fname, 'rb').read())
+fp.close()
+sys.exit(0)
""")
SUBDIR_foo_dep = os.path.join('$SUBDIR', 'foo.dep')
@@ -136,18 +141,6 @@ test.must_match('f5.out', "f5.in\nsubdir/foo.dep 3\n")
test.must_match(['sub2', 'f6.out'], "f6.in 3\nsubdir/bar.dep 3\n")
#
-test.write('SConstruct', """\
-env = Environment()
-file1 = File('file1')
-file2 = File('file2')
-env.Depends(file1, [[file2, 'file3']])
-""")
-
-test.write('file2', "file2\n")
-test.write('file3', "file3\n")
-
-test.up_to_date(arguments = '.')
-
test.pass_test()
# Local Variables:
diff --git a/test/Depends/no-Builder.py b/test/Depends/no-Builder.py
new file mode 100644
index 0000000..2d49756
--- /dev/null
+++ b/test/Depends/no-Builder.py
@@ -0,0 +1,66 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Verifies the Depends() function when used with Nodes that have no Builder.
+"""
+
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+#
+test.write('SConstruct', """\
+env = Environment()
+file1 = File('file1')
+file2 = File('file2')
+env.Depends(file1, [[file2, 'file3']])
+# Verify that a "hidden" file created by another action causes the
+# action to run when an explicit Dependency is specified.
+# See tigris.org issue 2647.
+env.Depends('hidden', 'file4.out')
+env.Command('file4.out', 'file4.in',
+ [Copy('$TARGET', '$SOURCE'), Touch('hidden')])
+""")
+
+test.write('file2', "file2\n")
+test.write('file3', "file3\n")
+test.write('file4.in', "file4.in\n")
+
+test.run(arguments = 'hidden')
+
+test.must_exist('hidden')
+test.must_match('file4.out', "file4.in\n")
+
+test.up_to_date(arguments = '.')
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/test/Scanner/generated.py b/test/Scanner/generated.py
index 8b08732..845111c 100644
--- a/test/Scanner/generated.py
+++ b/test/Scanner/generated.py
@@ -415,14 +415,21 @@ int g_3()
test.run(stderr=TestSCons.noisy_ar,
match=TestSCons.match_re_dotall)
+# Note that the generated .h files still get scanned twice,
+# but that's really once each as a child of libg_1.o and libg_2.o.
+#
+# TODO(sgk): can the duplication be eliminated safely? Batch build
+# support "eliminated" the duplication before in a way that broke a
+# use case that ended up in test/Depends/no-Builder.py (issue 2647).
+
test.must_match("MyCScan.out", """\
libg_1.c: 1
libg_2.c: 1
libg_3.c: 1
-libg_gx.h: 1
+libg_gx.h: 2
libg_gy.h: 1
libg_gz.h: 1
-libg_w.h: 1
+libg_w.h: 2
""")
test.pass_test()