D-Bus testing: fixed error reporting

On Debian Testing with Python 2.7 the nightly report did not properly
report failed tests. That's because now python-unit writes error
reports with the failed function on the error line, instead of using
the doc string.  The change is useful (because doc strings are not
necessarily enough to identify the test, which SyncEvolution had to
work around by imposing a specific format of the doc strings), but the
change broke output parsing. Now both old and new output is matched.
This commit is contained in:
Patrick Ohly 2011-11-18 15:09:11 +00:00
parent cbfaad66a4
commit 2df5a2896a
1 changed files with 7 additions and 1 deletions

View File

@ -310,11 +310,17 @@ def step2(resultdir, result, servers, indents, srcdir, shellprefix, backenddir):
#======================================================================
# FAIL: TestDBusServer.testGetConfigsTemplates - Server.GetConfigsTemplates()
# ---------------------------------------------------------------------
#
# More recent Python 2.7 produces:
# FAIL: testSyncSecondSession (__main__.TestSessionAPIsReal)
# first build list of all tests, assuming that they pass
dbustests = {}
test_start = re.compile(r'''^Test(?P<cl>.*)\.test(?P<func>[^ ]*)''')
# FAIL/ERROR + description of test (old Python)
test_fail = re.compile(r'''(?P<type>FAIL|ERROR): Test(?P<cl>.*)\.test(?P<func>[^ ]*)''')
# FAIL/ERROR + function name of test (Python 2.7)
test_fail_27 = re.compile(r'''(?P<type>FAIL|ERROR): test(?P<func>[^ ]*) \(.*\.(?:Test(?P<cl>.*))\)''')
logfile = None
sepcount = 0
for line in open(rserver + "/output.txt"):
@ -322,7 +328,7 @@ def step2(resultdir, result, servers, indents, srcdir, shellprefix, backenddir):
if m:
is_okay = True
else:
m = test_fail.search(line)
m = test_fail.search(line) or test_fail_27.search(line)
is_okay = False
if m:
# create log file