summaryrefslogtreecommitdiff
path: root/test/SCONSFLAGS.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2001-09-26 02:40:46 +0000
committerSteven Knight <knight@baldmt.com>2001-09-26 02:40:46 +0000
commit7318c163cf3f9e5a3c17404ef8bec15454b9766b (patch)
treeca918682926b3917a9da3dcc90ea57efc6e1d3dc /test/SCONSFLAGS.py
parentcf97a90442df5f8b835bb81aa5139e142baaf446 (diff)
downloadscons-7318c163cf3f9e5a3c17404ef8bec15454b9766b.tar.gz
Add support for SCONSFLAGS.
Diffstat (limited to 'test/SCONSFLAGS.py')
-rw-r--r--test/SCONSFLAGS.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/SCONSFLAGS.py b/test/SCONSFLAGS.py
new file mode 100644
index 00000000..274ab47a
--- /dev/null
+++ b/test/SCONSFLAGS.py
@@ -0,0 +1,41 @@
+#!/usr/bin/env python
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+import os
+import string
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+wpath = test.workpath()
+
+test.write('SConstruct', r"""
+Help("Help text.\n")
+""")
+
+expect = "Help text.\n\nUse scons -H for help about command-line options.\n"
+
+os.environ['SCONSFLAGS'] = ''
+
+test.run(arguments = '-h', stdout = expect)
+
+os.environ['SCONSFLAGS'] = '-h'
+
+test.run(stdout = expect)
+
+test.run(arguments = "-H")
+
+test.fail_test(string.find(test.stdout(), 'Help text.') >= 0)
+test.fail_test(string.find(test.stdout(), '-H, --help-options') == -1)
+
+os.environ['SCONSFLAGS'] = '-Z'
+
+test.run(arguments = "-H", stderr = r"""
+SCons warning: SCONSFLAGS option -Z not recognized
+File "[^"]*", line \d+, in \S+
+""")
+
+test.fail_test(string.find(test.stdout(), '-H, --help-options') == -1)
+
+test.pass_test()