mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 11:26:16 +01:00
gtester-report: cope with binaries with no test cases
It's possible that a given binary may conditionally decided not to run any test cases (e.g. since they are all slow but -m=quick is currently in use) In this case the xml may contain <testbinary> nodes with no <testcase> children. This was resulting in a divide by zero when calculating the green → red color interpolation. https://bugzilla.gnome.org/show_bug.cgi?id=617914
This commit is contained in:
parent
7ca2e00054
commit
03b5db4477
@ -268,6 +268,7 @@ class ReportWriter (TreeProcess):
|
|||||||
erlink = 'href="javascript:toggle_display (\'ResultTable\', \'tr\', \'b%u_\', \'failed\')"' % self.bcounter
|
erlink = 'href="javascript:toggle_display (\'ResultTable\', \'tr\', \'b%u_\', \'failed\')"' % self.bcounter
|
||||||
if binary.success_cases:
|
if binary.success_cases:
|
||||||
oklink = 'href="javascript:toggle_display (\'ResultTable\', \'tr\', \'b%u_\', \'success\')"' % self.bcounter
|
oklink = 'href="javascript:toggle_display (\'ResultTable\', \'tr\', \'b%u_\', \'success\')"' % self.bcounter
|
||||||
|
if real_cases != 0:
|
||||||
self.oprint ('<a %s>ER</a>\n' % erlink)
|
self.oprint ('<a %s>ER</a>\n' % erlink)
|
||||||
self.oprint ('<a %s>OK</a>\n' % oklink)
|
self.oprint ('<a %s>OK</a>\n' % oklink)
|
||||||
self.oprint ('</td>\n')
|
self.oprint ('</td>\n')
|
||||||
@ -278,6 +279,10 @@ class ReportWriter (TreeProcess):
|
|||||||
}.get (int (perc), 'bgcolor="yellow"')
|
}.get (int (perc), 'bgcolor="yellow"')
|
||||||
self.oprint ('<td align="right" %s>%.2f%%</td>\n' % (pcolor, perc))
|
self.oprint ('<td align="right" %s>%.2f%%</td>\n' % (pcolor, perc))
|
||||||
self.oprint ('</tr>\n')
|
self.oprint ('</tr>\n')
|
||||||
|
else:
|
||||||
|
self.oprint ('Empty\n')
|
||||||
|
self.oprint ('</td>\n')
|
||||||
|
self.oprint ('</tr>\n')
|
||||||
for tc in binary.testcases:
|
for tc in binary.testcases:
|
||||||
self.handle_testcase (tc, binary)
|
self.handle_testcase (tc, binary)
|
||||||
def handle_totals (self):
|
def handle_totals (self):
|
||||||
|
Loading…
Reference in New Issue
Block a user