summaryrefslogtreecommitdiff
path: root/test/Command.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2001-12-07 00:29:20 +0000
committerSteven Knight <knight@baldmt.com>2001-12-07 00:29:20 +0000
commit9ca1ac7a1f54fafa93713e3ff6bff693ca180d3e (patch)
tree7644c76e7330ecea3b6c1a8dfe7bc5b68b1ddd62 /test/Command.py
parenta12957948f90147743ecf2368a9a348c8619a09b (diff)
downloadscons-9ca1ac7a1f54fafa93713e3ff6bff693ca180d3e.tar.gz
Fix problems with Python callable objects as Builder actions, the associated test, and handling errors returned by a builder.
Diffstat (limited to 'test/Command.py')
-rw-r--r--test/Command.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/Command.py b/test/Command.py
index 2b704fc1..244b78cb 100644
--- a/test/Command.py
+++ b/test/Command.py
@@ -40,16 +40,22 @@ file.close()
""")
test.write('SConstruct', """
+def buildIt(env, target, source):
+ contents = open(source[0], 'rb').read()
+ file = open(target, 'wb')
+ file.write(contents)
+ file.close()
+ return 0
+
env = Environment()
env.Command(target = 'f1.out', source = 'f1.in',
- action = r'%s build.py $TARGET $SOURCES')
+ action = buildIt)
env.Command(target = 'f2.out', source = 'f2.in',
action = r'%s' + " build.py temp2 $SOURCES\\n" + r'%s' + " build.py $TARGET temp2")
env.Command(target = 'f3.out', source = 'f3.in',
action = [r'%s build.py temp3 $SOURCES',
r'%s build.py $TARGET temp3'])
-# Eventually, add ability to do execute Python code.
-""" % (python, python, python, python, python))
+""" % (python, python, python, python))
test.write('f1.in', "f1.in\n")