summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-07-16 22:55:27 (GMT)
committerSteven Knight <knight@baldmt.com>2002-07-16 22:55:27 (GMT)
commit1c2adf628d15657cee31f82525493bd9ab84b369 (patch)
tree5f8877208fd295b8d46f402059f0137c4bfc9854
parentb607b3cb0d0b047ef5a18f58dd49fc9b179a549e (diff)
downloadSCons-1c2adf628d15657cee31f82525493bd9ab84b369.zip
SCons-1c2adf628d15657cee31f82525493bd9ab84b369.tar.gz
SCons-1c2adf628d15657cee31f82525493bd9ab84b369.tar.bz2
Add a separate options argument for running SCons via the test infrastructure.
-rw-r--r--etc/TestSCons.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/etc/TestSCons.py b/etc/TestSCons.py
index 92001c3..1caef4f 100644
--- a/etc/TestSCons.py
+++ b/etc/TestSCons.py
@@ -90,7 +90,8 @@ class TestSCons(TestCmd.TestCmd):
apply(TestCmd.TestCmd.__init__, [self], kw)
os.chdir(self.workdir)
- def run(self, stdout = None, stderr = '', status = 0, **kw):
+ def run(self, options = None, arguments = None,
+ stdout = None, stderr = '', status = 0, **kw):
"""Runs SCons.
This is the same as the base TestCmd.run() method, with
@@ -110,6 +111,9 @@ class TestSCons(TestCmd.TestCmd):
By default, this does not test standard output (stdout = None),
and expects that error output is empty (stderr = "").
"""
+ if options:
+ arguments = options + " " + arguments
+ kw['arguments'] = arguments
try:
apply(TestCmd.TestCmd.run, [self], kw)
except:
@@ -147,10 +151,12 @@ class TestSCons(TestCmd.TestCmd):
print self.stderr()
raise TestFailed
- def up_to_date(self, arguments = None, **kw):
- kw['arguments'] = arguments
+ def up_to_date(self, options = None, arguments = None, **kw):
s = ""
for arg in string.split(arguments):
s = s + 'scons: "%s" is up to date.\n' % arg
+ if options:
+ arguments = options + " " + arguments
+ kw['arguments'] = arguments
kw['stdout'] = s
apply(self.run, [], kw)