summaryrefslogtreecommitdiff
path: root/QMTest
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-02-25 20:41:16 -0800
committerWilliam Deegan <bill@baddogconsulting.com>2017-02-25 20:41:16 -0800
commit9bd3e384cac631adf93668cdd660e54f1e6b9715 (patch)
treed74ef0b6080fde033207ca7e48f7e4f86ca6fb94 /QMTest
parentd1affbfc97364e9913b4cca27fd0b7f114965d00 (diff)
downloadscons-9bd3e384cac631adf93668cdd660e54f1e6b9715.tar.gz
Added ability for must_match to pass message to be output if it fails
Diffstat (limited to 'QMTest')
-rw-r--r--QMTest/TestCommon.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/QMTest/TestCommon.py b/QMTest/TestCommon.py
index 9093cc99..cd9e990f 100644
--- a/QMTest/TestCommon.py
+++ b/QMTest/TestCommon.py
@@ -469,7 +469,7 @@ class TestCommon(TestCmd):
print("Missing one of: `%s'" % "', `".join(missing))
self.fail_test(missing)
- def must_match(self, file, expect, mode = 'rb', match=None):
+ def must_match(self, file, expect, mode = 'rb', match=None, message=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
@@ -479,7 +479,7 @@ class TestCommon(TestCmd):
if not match:
match = self.match
try:
- self.fail_test(not match(to_str(file_contents), to_str(expect)))
+ self.fail_test(not match(to_str(file_contents), to_str(expect)), message=message)
except KeyboardInterrupt:
raise
except: