summaryrefslogtreecommitdiffstats
path: root/QMTest/TestSCons.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2009-12-15 06:35:05 (GMT)
committerSteven Knight <knight@baldmt.com>2009-12-15 06:35:05 (GMT)
commit3771ce697111a708f23ca69c60ad4ca7bc1030e4 (patch)
treeca33cdc9e3374ef2ac6542edddec954568eb75ea /QMTest/TestSCons.py
parent297837e8a1f6abf3c888c340a80a40107ac93ce3 (diff)
downloadSCons-3771ce697111a708f23ca69c60ad4ca7bc1030e4.zip
SCons-3771ce697111a708f23ca69c60ad4ca7bc1030e4.tar.gz
SCons-3771ce697111a708f23ca69c60ad4ca7bc1030e4.tar.bz2
Add a TestSCons.option_not_yet_implemented() method and use it so
the tests of those options expect an exit status of 1.
Diffstat (limited to 'QMTest/TestSCons.py')
-rw-r--r--QMTest/TestSCons.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/QMTest/TestSCons.py b/QMTest/TestSCons.py
index f73de04..e698f4e 100644
--- a/QMTest/TestSCons.py
+++ b/QMTest/TestSCons.py
@@ -412,6 +412,25 @@ class TestSCons(TestCommon):
kw['match'] = self.match_re_dotall
apply(self.run, [], kw)
+ def option_not_yet_implemented(self, option, arguments=None, **kw):
+ """
+ Verifies expected behavior for options that are not yet implemented:
+ a warning message, and exit status 1.
+ """
+ msg = "Warning: the %s option is not yet implemented\n" % option
+ kw['stderr'] = msg
+ kw['status'] = 1
+ if arguments:
+ # If it's a long option and the argument string begins with '=',
+ # it's of the form --foo=bar and needs no separating space.
+ if option[:2] == '--' and arguments[0] == '=':
+ kw['arguments'] = option + arguments
+ else:
+ kw['arguments'] = option + ' ' + arguments
+ # TODO(1.5)
+ #return self.run(**kw)
+ return apply(self.run, (), kw)
+
def diff_substr(self, expect, actual, prelen=20, postlen=40):
i = 0
for x, y in zip(expect, actual):