* some better error reporting in test cases

This commit is contained in:
djcb
2012-05-30 17:25:49 +02:00
parent 41e73efd38
commit d50b920e33
4 changed files with 37 additions and 12 deletions

View File

@ -35,14 +35,22 @@ static gchar*
fill_database (void)
{
gchar *cmdline, *tmpdir;
GError *err;
tmpdir = test_mu_common_get_random_tmpdir();
cmdline = g_strdup_printf ("%s index --muhome=%s --maildir=%s"
" --quiet",
MU_PROGRAM, tmpdir, MU_TESTMAILDIR);
g_assert (g_spawn_command_line_sync (cmdline, NULL, NULL,
NULL, NULL));
err = NULL;
if (!g_spawn_command_line_sync (cmdline, NULL, NULL,
NULL, &err)) {
g_printerr ("Error: %s\n", err ? err->message : "?");
g_clear_error (&err);
g_assert (0);
}
g_clear_error (&err);
g_free (cmdline);
return tmpdir;