summaryrefslogtreecommitdiff
path: root/test/Dir
diff options
context:
space:
mode:
authorManish Vachharajani <manishv@unbounded.systems>2017-03-22 16:28:28 -0600
committerManish Vachharajani <manishv@unbounded.systems>2017-03-22 16:28:28 -0600
commitf8ee269fb49678f88da820e00183ef4f9d5e5ddc (patch)
tree9e25ff4d6a4c9059798011508b02fc10533581a4 /test/Dir
parent192965c27b04e876904cffee60fb5edb3f1e92fb (diff)
downloadscons-f8ee269fb49678f88da820e00183ef4f9d5e5ddc.tar.gz
Push version to Python 2.7 as minimum required.
Diffstat (limited to 'test/Dir')
-rw-r--r--test/Dir/Dir.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/Dir/Dir.py b/test/Dir/Dir.py
index 2e8204c3..88763a4e 100644
--- a/test/Dir/Dir.py
+++ b/test/Dir/Dir.py
@@ -71,6 +71,31 @@ env.MD(target='sub2', source=['SConstruct'], OVERRIDE='foo')
test.run()
+#The following test creates a builder with only a directory target,
+#updates its source, and ensures that the directory target is
+#considered out of date and rebuilt.
+
+test.write('foo-contents.txt', """Hello, """)
+test.write('SConstruct', """\
+import os
+
+def mkdir_and_copy(target=None, source=None, env=None):
+ os.mkdir(str(target[0]))
+ os.copy(str(source[0]), str(target[0]))
+
+mac_builder = Builder(action=mkdir_and_copy)
+env = Environment()
+env.Append(BUILDERS = {'MAC': mac_builder}
+env.MAC(target='foo', src='foo-contents.txt')
+""")
+
+#Build foo
+test.not_up_to_date('foo')
+test.up_to)
+
+test.write('foo-contents.txt', """Hello, World!""")
+test.not_up_to_date('foo')
+
test.pass_test()
# Local Variables: