summaryrefslogtreecommitdiffstats
path: root/test/bad-variables.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2003-05-23 20:04:44 (GMT)
committerSteven Knight <knight@baldmt.com>2003-05-23 20:04:44 (GMT)
commit716938b2f60236c151de4e301a12c98a97969e35 (patch)
tree66e073eb7bad2f790adecac002294106c5e7189f /test/bad-variables.py
parent3cd0cc01eea31837d999e5a29a30a46d3b6c480a (diff)
downloadSCons-716938b2f60236c151de4e301a12c98a97969e35.zip
SCons-716938b2f60236c151de4e301a12c98a97969e35.tar.gz
SCons-716938b2f60236c151de4e301a12c98a97969e35.tar.bz2
Suppress illegal construction variables.
Diffstat (limited to 'test/bad-variables.py')
-rw-r--r--test/bad-variables.py60
1 files changed, 60 insertions, 0 deletions
diff --git a/test/bad-variables.py b/test/bad-variables.py
new file mode 100644
index 0000000..59fc184
--- /dev/null
+++ b/test/bad-variables.py
@@ -0,0 +1,60 @@
+#!/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__"
+
+"""
+Test that setting illegal construction variables fails in ways that are
+useful to the user.
+"""
+
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+test.write('SConstruct', """\
+env = Environment()
+env['foo-bar'] = 1
+""")
+
+test.run(arguments = '.', status = 2, stderr="""
+scons: *** Illegal construction variable `foo-bar'
+File "SConstruct", line 2, in ?
+""")
+
+test.write('SConstruct', """\
+SConscript('SConscript')
+""")
+
+test.write('SConscript', """\
+env = Environment()
+env['foo(bar)'] = 1
+""")
+
+test.run(arguments = '.', status = 2, stderr="""
+scons: *** Illegal construction variable `foo(bar)'
+File "SConscript", line 2, in ?
+""")
+
+test.pass_test()