diff options
author | Steven Knight <knight@baldmt.com> | 2001-09-26 02:40:46 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2001-09-26 02:40:46 (GMT) |
commit | 7318c163cf3f9e5a3c17404ef8bec15454b9766b (patch) | |
tree | ca918682926b3917a9da3dcc90ea57efc6e1d3dc /test | |
parent | cf97a90442df5f8b835bb81aa5139e142baaf446 (diff) | |
download | SCons-7318c163cf3f9e5a3c17404ef8bec15454b9766b.zip SCons-7318c163cf3f9e5a3c17404ef8bec15454b9766b.tar.gz SCons-7318c163cf3f9e5a3c17404ef8bec15454b9766b.tar.bz2 |
Add support for SCONSFLAGS.
Diffstat (limited to 'test')
-rw-r--r-- | test/SCONSFLAGS.py | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/test/SCONSFLAGS.py b/test/SCONSFLAGS.py new file mode 100644 index 0000000..274ab47 --- /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() |