summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2013-03-04 07:30:31 -0800
committerPatrick Ohly <patrick.ohly@intel.com>2013-03-04 07:36:22 -0800
commit748618d6e39c3bce5f8f697a90cd35ffe3c14206 (patch)
tree5294099669e7d2c186ba753f436621b53008d076
parent87177c71c96ff137ec5dc2e71803390b810881a6 (diff)
PIM testing: ignore valgrind ERROR when checking output
Complaining about "ERROR SUMMARY" when using valgrind is a false positive. Ignore that text by making it lower case before searching. Other attempts based on regex matching somehow failed (UTF-8 encoding error?!).
-rwxr-xr-xsrc/dbus/server/pim/testpim.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/dbus/server/pim/testpim.py b/src/dbus/server/pim/testpim.py
index 1060b20d..3201269c 100755
--- a/src/dbus/server/pim/testpim.py
+++ b/src/dbus/server/pim/testpim.py
@@ -479,9 +479,18 @@ END:VCARD(\r|\n)*''',
# [ERROR] The string supplied did not seem to be a phone number.
# to stdout until we reduced the log level.
#
+ # ==4039== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 185 from 175)
+ # as printed by valgrind is okay, so don't match that.
+ #
# We check both D-Bus messages (which did not contain that
# text, but some other error messages) and the servers stdout.
- self.runTestDBusCheck = lambda test, log: test.assertNotIn('ERROR', log)
+ def unicodeLog(test, log):
+ open('/tmp/out', 'wb').write(log)
+ print re.match(r'ERROR(?! SUMMARY:)', log)
+ # Using assertNotRegexMatches with a negative lookahead led to unicode errors?!
+ # Therefore stick to plain text checks and avoid false matches against valgind's
+ # 'ERROR SUMMARY' by replacing that first.
+ self.runTestDBusCheck = lambda test, log: test.assertNotIn('ERROR', log.replace('ERROR SUMMARY:', 'error summary:'))
self.runTestOutputCheck = self.runTestDBusCheck
# Runtime varies a lot when using valgrind, because