summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/EnvironmentTests.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2003-09-10 13:19:03 (GMT)
committerSteven Knight <knight@baldmt.com>2003-09-10 13:19:03 (GMT)
commite181e48bb62502b88107536c2e8dbd5886bf17fd (patch)
treee835fcf4a2cf7f45f7af2386a58e1104c6ecc710 /src/engine/SCons/EnvironmentTests.py
parente10b74a59f1830769ba4c7e65a846228812ae2fa (diff)
downloadSCons-e181e48bb62502b88107536c2e8dbd5886bf17fd.zip
SCons-e181e48bb62502b88107536c2e8dbd5886bf17fd.tar.gz
SCons-e181e48bb62502b88107536c2e8dbd5886bf17fd.tar.bz2
Make a Clean() environment method. Add global functions for AlwaysBuild(), Command(), Depends(), Ignore(), Install(), InstallAs(), Precious(), SideEffect() and SourceCode().
Diffstat (limited to 'src/engine/SCons/EnvironmentTests.py')
-rw-r--r--src/engine/SCons/EnvironmentTests.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py
index db05351..1dc47e2 100644
--- a/src/engine/SCons/EnvironmentTests.py
+++ b/src/engine/SCons/EnvironmentTests.py
@@ -1051,6 +1051,32 @@ class EnvironmentTestCase(unittest.TestCase):
assert t[4].path == 'bbb'
assert t[4].always_build
+ def test_Clean(self):
+ """Test the Clean() method"""
+ env = Environment(FOO = 'fff', BAR = 'bbb')
+
+ CT = SCons.Environment.CleanTargets
+
+ foo = env.arg2nodes('foo')[0]
+ fff = env.arg2nodes('fff')[0]
+
+ t = env.Clean('foo', 'aaa')
+ l = map(str, CT[foo])
+ assert l == ['aaa'], l
+
+ t = env.Clean(foo, ['$BAR', 'ccc'])
+ l = map(str, CT[foo])
+ assert l == ['aaa', 'bbb', 'ccc'], l
+
+ eee = env.arg2nodes('eee')[0]
+
+ t = env.Clean('$FOO', 'ddd')
+ l = map(str, CT[fff])
+ assert l == ['ddd'], l
+ t = env.Clean(fff, [eee, 'fff'])
+ l = map(str, CT[fff])
+ assert l == ['ddd', 'eee', 'fff'], l
+
def test_Command(self):
"""Test the Command() method."""
env = Environment()