gtester-report ignores messages output by the tests via g_test_message()
Submitted by Eugene Shatokhin
Link to original bug (#592419)
Description
Created attachment 141218 A patch to fix the described problem
It seems that gtester-report includes only messages from g_assert()-like functions in the test output but ignores the messages the test has output via g_test_message(). Meanwhile, both types of messages can be present in the xml file generated by gtester.
That is, if a test fails, gtester-report looks for its output only in
<error>
...</error>
sections of that xml file but not in <message>
...</message>
.
That can result in test reports like just the following:
ERROR:test_glib_arrays.c:9835:test_5_2: assertion failed: (new_size ==
old_size + n)
The test may have output some more messages that could help the developer understand in which circumstances the failure occured and what exactly failed. Like this:
Test target(s): g_array_set_size
The length of the array is 2, but it should be 3.
The following requirement failed:
g_array_set_size() sets the size of the array, expanding it if necessary.
ERROR:test_glib_arrays.c:9835:test_5_2: assertion failed: (new_size ==
old_size + n)
The first four lines of this report are output by the test via g_test_message() before calling g_assert(new_size == old_size + n).
I suppose, it it clearer from the second report what happened in the test than from the first one.
The attached patch fixes this issue in gtester-report.
Attachment 141218, "A patch to fix the described problem":
gtester-report-20090819.patch