summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/EnvironmentTests.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2010-06-15 21:04:47 (GMT)
committerSteven Knight <knight@baldmt.com>2010-06-15 21:04:47 (GMT)
commitfabff06e1ff1863ded70136f0797814a676a86d4 (patch)
treec13f47a573efee1038ead7d21149454a70b0dc52 /src/engine/SCons/EnvironmentTests.py
parent1e73529341eb9559a7ded9e2bb327182f7748305 (diff)
downloadSCons-fabff06e1ff1863ded70136f0797814a676a86d4.zip
SCons-fabff06e1ff1863ded70136f0797814a676a86d4.tar.gz
SCons-fabff06e1ff1863ded70136f0797814a676a86d4.tar.bz2
Issue 2390: Support appending to $*FLAGS values (CLVar instances) in a
copied construction environment without also affecting the value in the original construction environment. (Matt Hughes)
Diffstat (limited to 'src/engine/SCons/EnvironmentTests.py')
-rw-r--r--src/engine/SCons/EnvironmentTests.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py
index ec69607..7feb76d 100644
--- a/src/engine/SCons/EnvironmentTests.py
+++ b/src/engine/SCons/EnvironmentTests.py
@@ -1806,6 +1806,20 @@ def exists(env):
env2.Append(FLAGS = 'flag3 flag4')
x = env2.get('FLAGS')
assert x == ['flag1', 'flag2', 'flag3', 'flag4'], x
+ x = env1.get('FLAGS')
+ assert x == ['flag1', 'flag2'], x
+
+ # Ensure that appending directly to a copied CLVar
+ # doesn't modify the original.
+ env1 = self.TestEnvironment(FLAGS = CLVar('flag1 flag2'))
+ x = env1.get('FLAGS')
+ assert x == ['flag1', 'flag2'], x
+ env2 = env1.Clone()
+ env2['FLAGS'] += ['flag3', 'flag4']
+ x = env2.get('FLAGS')
+ assert x == ['flag1', 'flag2', 'flag3', 'flag4'], x
+ x = env1.get('FLAGS')
+ assert x == ['flag1', 'flag2'], x
# Test that the environment stores the toolpath and
# re-uses it for copies.