diff options
author | Steven Knight <knight@baldmt.com> | 2001-12-07 00:29:20 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2001-12-07 00:29:20 (GMT) |
commit | 9ca1ac7a1f54fafa93713e3ff6bff693ca180d3e (patch) | |
tree | 7644c76e7330ecea3b6c1a8dfe7bc5b68b1ddd62 /test/Command.py | |
parent | a12957948f90147743ecf2368a9a348c8619a09b (diff) | |
download | SCons-9ca1ac7a1f54fafa93713e3ff6bff693ca180d3e.zip SCons-9ca1ac7a1f54fafa93713e3ff6bff693ca180d3e.tar.gz SCons-9ca1ac7a1f54fafa93713e3ff6bff693ca180d3e.tar.bz2 |
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.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/test/Command.py b/test/Command.py index 2b704fc..244b78c 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") |