diff options
author | Steven Knight <knight@baldmt.com> | 2004-09-27 21:23:04 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2004-09-27 21:23:04 (GMT) |
commit | 23113a29aa006beb04c9675fc0f7a02564ac5a80 (patch) | |
tree | f43576c3c7ddce67d169ed799471c6d385b5cbba /src/engine/SCons/ExecutorTests.py | |
parent | 3b0b62cb7fa049ae5d87268f4d2e6a8832166d9e (diff) | |
download | SCons-23113a29aa006beb04c9675fc0f7a02564ac5a80.zip SCons-23113a29aa006beb04c9675fc0f7a02564ac5a80.tar.gz SCons-23113a29aa006beb04c9675fc0f7a02564ac5a80.tar.bz2 |
Add support for changing directory when executing Actions (the to the target directory by default).
Diffstat (limited to 'src/engine/SCons/ExecutorTests.py')
-rw-r--r-- | src/engine/SCons/ExecutorTests.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/engine/SCons/ExecutorTests.py b/src/engine/SCons/ExecutorTests.py index cfa2dcd..e259012 100644 --- a/src/engine/SCons/ExecutorTests.py +++ b/src/engine/SCons/ExecutorTests.py @@ -46,8 +46,9 @@ class MyEnvironment: class MyAction: def __init__(self, actions=['action1', 'action2']): self.actions = actions - def get_actions(self): - return self.actions + def __call__(self, target, source, env, errfunc, **kw): + for action in self.actions: + action(target, source, env, errfunc) def strfunction(self, target, source, env): return string.join(['STRFUNCTION'] + self.actions + target + source) def genstring(self, target, source, env): @@ -120,15 +121,15 @@ class ExecutorTestCase(unittest.TestCase): def test_get_action_list(self): """Test fetching and generating an action list""" x = SCons.Executor.Executor('b', 'e', 'o', 't', 's') - x.action_list = ['aaa'] al = x.get_action_list(MyNode([], [])) - assert al == ['aaa'], al + assert al == ['b'], al al = x.get_action_list(MyNode(['PRE'], ['POST'])) - assert al == ['PRE', 'aaa', 'POST'], al + assert al == ['PRE', 'b', 'POST'], al - x = SCons.Executor.Executor(MyAction(), None, {}, 't', 's') + a = MyAction() + x = SCons.Executor.Executor(a, None, {}, 't', 's') al = x.get_action_list(MyNode(['pre'], ['post'])) - assert al == ['pre', 'action1', 'action2', 'post'], al + assert al == ['pre', a, 'post'], al def test__call__(self): """Test calling an Executor""" |