summaryrefslogtreecommitdiffstats
path: root/test/actions.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2001-12-07 00:29:20 (GMT)
committerSteven Knight <knight@baldmt.com>2001-12-07 00:29:20 (GMT)
commit9ca1ac7a1f54fafa93713e3ff6bff693ca180d3e (patch)
tree7644c76e7330ecea3b6c1a8dfe7bc5b68b1ddd62 /test/actions.py
parenta12957948f90147743ecf2368a9a348c8619a09b (diff)
downloadSCons-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/actions.py')
-rw-r--r--test/actions.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/test/actions.py b/test/actions.py
index cee067e..9ba689b 100644
--- a/test/actions.py
+++ b/test/actions.py
@@ -68,16 +68,17 @@ test.up_to_date(arguments = '.')
test.write('SConstruct', """
import os
-import SCons.Util
-def func(**kw):
- cmd = SCons.Util.scons_subst(r'%s build.py $TARGET 3 $SOURCES', kw, {})
+import string
+def func(env, target, source):
+ cmd = r'%s build.py %%s 3 %%s' %% (target, string.join(source, ' '))
+ print cmd
return os.system(cmd)
B = Builder(name = 'B', action = func)
env = Environment(BUILDERS = [B])
env.B(target = 'foo.out', source = 'foo.in')
""" % python)
-test.run(arguments = '.')
+test.run(arguments = '.', stderr = None)
test.fail_test(test.read('foo.out') != "3\nfoo.in\n")
@@ -85,16 +86,15 @@ test.up_to_date(arguments = '.')
test.write('SConstruct', """
import os
-import SCons.Util
class bld:
def __init__(self):
- self.cmd = r'%s build.py $TARGET 4 $SOURCES'
- def __call__(self, **kw):
- cmd = SCons.Util.scons_subst(self.cmd, kw, {})
+ self.cmd = r'%s build.py %%s 4 %%s'
+ def __call__(self, env, target, source):
+ cmd = self.get_contents(env, target, source)
+ print cmd
return os.system(cmd)
- def get_contents(self, **kw):
- cmd = SCons.Util.scons_subst(self.cmd, kw, {})
- return cmd
+ def get_contents(self, env, target, source):
+ return self.cmd %% (target, string.join(source, ' '))
B = Builder(name = 'B', action = bld())
env = Environment(BUILDERS = [B])
env.B(target = 'foo.out', source = 'foo.in')