Running gtester-report on gtester output raises KeyError
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GLib |
Fix Released
|
Medium
|
|||
glib2.0 (Ubuntu) |
Triaged
|
Low
|
Unassigned |
Bug Description
I'm trying to set up some unit tests on a bunch of C code I'm writing, and decided to use GLib's testing framework.
Running the tests using "gtester test-executable -o output.xml" runs okay, but running gtester-report to generate a html report raises an error. The output is:
...
At the beginning, it outputs valid html, until the beginning of the <body> tag:
...
<body>
<h2>GTester Unit Test Report</h2>
Traceback (most recent call last):
File "/usr/bin/
main()
File "/usr/bin/
HTMLReportW
File "/usr/bin/
self.
File "/usr/bin/
self.oprint ('<h3>Package: %(package)s, version: %(version)s</h3>\n' % self.info)
KeyError: 'package'
Changed in glib: | |
importance: | Unknown → Medium |
status: | Unknown → New |
Changed in glib2.0 (Ubuntu): | |
importance: | Undecided → Low |
status: | Confirmed → Triaged |
Changed in glib: | |
status: | New → Confirmed |
Changed in glib: | |
status: | Confirmed → Fix Released |
Thanks for the bug report. I found an upstream bug here: https:/ /bugzilla. gnome.org/ show_bug. cgi?id= 668035 and I submitted a simple patch to fix it.
You can workaround the issue by manually adding:
<info> PACKAGENAME< /package> VERSION< /version> REVISION< /revision>
<package>
<version>
<revision>
</info>
to the generated xml. It seems that is exactly what glib does, to collect multiple reports together. (See Makefile.decl in the glib source)