summaryrefslogtreecommitdiffstats
path: root/test/Clone-compatibility.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2006-11-04 05:31:24 (GMT)
committerSteven Knight <knight@baldmt.com>2006-11-04 05:31:24 (GMT)
commitc36a10f28f1c38541757cbbe96d67cd87a2096e7 (patch)
tree6631963b4e4521d9a9a643edc1269409083e4651 /test/Clone-compatibility.py
parent6fcc7d78858a5ca068e3deea183d35295b7dd88e (diff)
downloadSCons-c36a10f28f1c38541757cbbe96d67cd87a2096e7.zip
SCons-c36a10f28f1c38541757cbbe96d67cd87a2096e7.tar.gz
SCons-c36a10f28f1c38541757cbbe96d67cd87a2096e7.tar.bz2
Merged revisions 1667-1674 via svnmerge from
http://scons.tigris.org/svn/scons/branches/core ........ r1672 | stevenknight | 2006-11-03 23:11:52 -0600 (Fri, 03 Nov 2006) | 1 line 0.96.D480 - Don't use UNIX logic to detect an executable qmtest.py on Windows. ........ r1673 | stevenknight | 2006-11-03 23:18:59 -0600 (Fri, 03 Nov 2006) | 1 line 0.96.D481 - Remove the print statement from the previous checkin. ........ r1674 | stevenknight | 2006-11-03 23:25:43 -0600 (Fri, 03 Nov 2006) | 1 line 0.96.D482 - Create a env.Clone() method and encourage its use in favor of env.Copy(). ........
Diffstat (limited to 'test/Clone-compatibility.py')
-rw-r--r--test/Clone-compatibility.py57
1 files changed, 57 insertions, 0 deletions
diff --git a/test/Clone-compatibility.py b/test/Clone-compatibility.py
new file mode 100644
index 0000000..53719e9
--- /dev/null
+++ b/test/Clone-compatibility.py
@@ -0,0 +1,57 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Verify that a specific snippet of backwards-compatibility code works.
+
+"""
+
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+test.write('SConstruct', """
+
+# When the 0.96.93 release introduced the env.Clone() we advertised this
+# code as the correct pattern for maintaining the backwards compatibility
+# of SConstruct files to earlier release of SCons. Going forward, make
+# sure it still works (or at least doesn't blow up).
+import SCons.Environment
+try:
+ SCons.Environment.Environment.Clone
+except AttributeError:
+ SCons.Environment.Environment.Clone = SCons.Environment.Environment.Copy
+
+env1 = Environment(X = 1)
+env2 = env1.Clone(X = 2)
+
+print env1['X']
+print env2['X']
+""")
+
+test.run(arguments = '-q -Q', stdout = "1\n2\n")
+
+test.pass_test()