diff options
author | Steven Knight <knight@baldmt.com> | 2002-03-08 06:01:39 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2002-03-08 06:01:39 (GMT) |
commit | bd1384bd791e94dd5191f50d92850e857a987d08 (patch) | |
tree | 7349dc7549b054db7f64250233718c2bbc7cce03 /src/engine/SCons/ActionTests.py | |
parent | 232ea1169c24b803d0c90e3cdb277e356b2eb087 (diff) | |
download | SCons-bd1384bd791e94dd5191f50d92850e857a987d08.zip SCons-bd1384bd791e94dd5191f50d92850e857a987d08.tar.gz SCons-bd1384bd791e94dd5191f50d92850e857a987d08.tar.bz2 |
Changes to the CommandGenerator functionality. (Charles Crain)
Diffstat (limited to 'src/engine/SCons/ActionTests.py')
-rw-r--r-- | src/engine/SCons/ActionTests.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/engine/SCons/ActionTests.py b/src/engine/SCons/ActionTests.py index 461da6e..592fa82 100644 --- a/src/engine/SCons/ActionTests.py +++ b/src/engine/SCons/ActionTests.py @@ -156,14 +156,26 @@ class CommandGeneratorActionTestCase(unittest.TestCase): """Test executing a command generator Action """ - def f(dummy, self=self): + def f(dummy, env, self=self): self.dummy = dummy - return [[""]] + return [["$FOO"]] + def ch(cmd, args, env, self=self): + self.cmd.append(cmd) + self.args.append(args) a = SCons.Action.CommandGeneratorAction(f) self.dummy = 0 - a.execute(dummy=1) + old_hdl = SCons.Action.GetCommandHandler() + self.cmd = [] + self.args = [] + try: + SCons.Action.SetCommandHandler(ch) + a.execute(dummy=1, env={ 'FOO' : 'foo baz\nbar ack' }) + finally: + SCons.Action.SetCommandHandler(old_hdl) assert self.dummy == 1 + assert self.cmd == [ 'foo', 'bar'], self.cmd + assert self.args == [ [ 'foo', 'baz' ], [ 'bar', 'ack' ] ], self.args del self.dummy def test_get_contents(self): |