summaryrefslogtreecommitdiffstats
path: root/QMTest
diff options
context:
space:
mode:
authorGary Oberbrunner <garyo@oberbrunner.com>2013-03-17 00:43:54 (GMT)
committerGary Oberbrunner <garyo@oberbrunner.com>2013-03-17 00:43:54 (GMT)
commite8f1182787dc7f1187759224830815a85a5e3446 (patch)
tree59b29967d98fea2403c729c0aa31e98d2c39d227 /QMTest
parent1d3de8cda278418e624c7c808e12ab069d514c69 (diff)
parentede4ee9b3306ca546c2f04bcabff9f970ed1cb9a (diff)
downloadSCons-e8f1182787dc7f1187759224830815a85a5e3446.zip
SCons-e8f1182787dc7f1187759224830815a85a5e3446.tar.gz
SCons-e8f1182787dc7f1187759224830815a85a5e3446.tar.bz2
Merged in carandraug/scons (pull request #67).
Added test for CheckContext custom result types. Also allow test.must_match() to take a match type.
Diffstat (limited to 'QMTest')
-rw-r--r--QMTest/TestCommon.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/QMTest/TestCommon.py b/QMTest/TestCommon.py
index 6d47149..6eeda5e 100644
--- a/QMTest/TestCommon.py
+++ b/QMTest/TestCommon.py
@@ -460,15 +460,17 @@ class TestCommon(TestCmd):
print "Missing one of: `%s'" % "', `".join(missing)
self.fail_test(missing)
- def must_match(self, file, expect, mode = 'rb'):
+ def must_match(self, file, expect, mode = 'rb', match=None):
"""Matches the contents of the specified file (first argument)
against the expected contents (second argument). The expected
contents are a list of lines or a string which will be split
on newlines.
"""
file_contents = self.read(file, mode)
+ if not match:
+ match = self.match
try:
- self.fail_test(not self.match(file_contents, expect))
+ self.fail_test(not match(file_contents, expect))
except KeyboardInterrupt:
raise
except: