G_MESSAGES_DEBUG breaks test cases
Submitted by Martyn Russell
Link to original bug (#675383)
Description
In tracker we have a number of test cases which we're now seeing break because G_MESSAGES_DEBUG is not set and using the glib test API then fails because g_debug() calls don't make it to stdout.
This feels like a bug in glib not $project to fix.
Do we expect ALL applications to set this environment variable before testing (or in each test case)?
My scenario is quite straight forward:
if (g_test_trap_fork (0, 0)) {
request = tracker_dbus_request_begin ("tracker-dbus-test.c",
"Test request (%s))",
"--TestNewOK--");
exit (0);
}
g_test_trap_assert_passed ();
g_test_trap_assert_stdout ("*TestNewOK*")
It just so happens the tracker_dbus_request_begin() call uses g_debug().
Shouldn't the g_test_*() API set this environment variable?
I notice the tests for glib itself add the environment variable in code, are all projects expected to follow this approach?
Version: 2.30.x