summaryrefslogtreecommitdiff
path: root/src/engine/SCons/EnvironmentTests.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2001-10-02 20:01:35 +0000
committerSteven Knight <knight@baldmt.com>2001-10-02 20:01:35 +0000
commitc38b764a8c7e91d48c79a4918fd55d5305a3fffc (patch)
treef9032a75fdaca058cad91c0823a7d6c9e06ce1be /src/engine/SCons/EnvironmentTests.py
parentf987fbf31938ce3009b89f1f62f880cdc2a511f4 (diff)
downloadscons-c38b764a8c7e91d48c79a4918fd55d5305a3fffc.tar.gz
Add the Command() method.
Diffstat (limited to 'src/engine/SCons/EnvironmentTests.py')
-rw-r--r--src/engine/SCons/EnvironmentTests.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py
index c503fe23..a60e5584 100644
--- a/src/engine/SCons/EnvironmentTests.py
+++ b/src/engine/SCons/EnvironmentTests.py
@@ -145,6 +145,23 @@ class EnvironmentTestCase(unittest.TestCase):
assert d.__class__.__name__ == 'File'
assert d.path == 'Environment.py'
+ def test_Command(self):
+ """Test the Command() method."""
+ env = Environment()
+ t = env.Command(target='foo.out', source=['foo1.in', 'foo2.in'],
+ action='buildfoo %(target)s %(source)s')
+ assert t.derived
+ assert t.builder.action.__class__.__name__ == 'CommandAction'
+ assert t.builder.action.command == 'buildfoo %(target)s %(source)s'
+ assert 'foo1.in' in map(lambda x: x.path, t.sources)
+ assert 'foo2.in' in map(lambda x: x.path, t.sources)
+
+ def testFunc(ENV, target, source):
+ assert target == 'foo.out'
+ assert source == 'foo1.in foo2.in' or source == 'foo2.in foo1.in'
+ env.Command(target='foo.out', source=['foo1.in','foo2.in'],
+ action=testFunc)
+
def test_subst(self):
"""Test substituting construction variables within strings