summaryrefslogtreecommitdiffstats
path: root/test/pre-post-actions.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-12-03 04:16:16 (GMT)
committerSteven Knight <knight@baldmt.com>2004-12-03 04:16:16 (GMT)
commit2c53df0afd0836bb17b6214c290d30f8d2f80ffd (patch)
tree1a3d217ab9a9bb40fd0e61b8637c3e968e91cbf2 /test/pre-post-actions.py
parent149cdcf956e7da57173f114a5807f1492607e99a (diff)
downloadSCons-2c53df0afd0836bb17b6214c290d30f8d2f80ffd.zip
SCons-2c53df0afd0836bb17b6214c290d30f8d2f80ffd.tar.gz
SCons-2c53df0afd0836bb17b6214c290d30f8d2f80ffd.tar.bz2
Add a test to make sure we can Add{Pre,Post}Action() on Dir Nodes.
Diffstat (limited to 'test/pre-post-actions.py')
-rw-r--r--test/pre-post-actions.py25
1 files changed, 24 insertions, 1 deletions
diff --git a/test/pre-post-actions.py b/test/pre-post-actions.py
index d0e8084..860ae24 100644
--- a/test/pre-post-actions.py
+++ b/test/pre-post-actions.py
@@ -36,7 +36,7 @@ _exe = TestSCons._exe
test = TestSCons.TestSCons()
-test.subdir('work1', 'work2')
+test.subdir('work1', 'work2', 'work3')
@@ -146,4 +146,27 @@ test.must_match(['work2', 'file3.out'], "333\n")
+test.write(['work3', 'SConstruct'], """\
+def pre(target, source, env):
+ pass
+def post(target, source, env):
+ pass
+def build(target, source, env):
+ open(str(target[0]), 'wb').write('build()\\n')
+env = Environment()
+AddPreAction('dir', pre)
+AddPostAction('dir', post)
+env.Command('dir/file', [], build)
+""")
+
+test.run(chdir = 'work3', arguments = 'dir/file', stdout=test.wrap_stdout("""\
+pre(["dir"], [])
+post(["dir"], [])
+build(["dir/file"], [])
+"""))
+
+test.must_match(['work3', 'dir', 'file'], "build()\n")
+
+
+
test.pass_test()