validate: Print the report when aborting because of an issue

Letting a chance to the user to know what bug he faced!
This commit is contained in:
Thibault Saunier 2014-07-26 08:27:55 +02:00
parent 5c50219fae
commit d682bd29a9
3 changed files with 14 additions and 6 deletions

View file

@ -341,7 +341,7 @@ gst_validate_report_area_get_name (GstValidateReportArea area)
} }
} }
void gboolean
gst_validate_report_check_abort (GstValidateReport * report) gst_validate_report_check_abort (GstValidateReport * report)
{ {
if ((report->level <= GST_VALIDATE_REPORT_LEVEL_ISSUE && if ((report->level <= GST_VALIDATE_REPORT_LEVEL_ISSUE &&
@ -350,9 +350,11 @@ gst_validate_report_check_abort (GstValidateReport * report)
_gst_validate_flags & GST_VALIDATE_FATAL_WARNINGS) || _gst_validate_flags & GST_VALIDATE_FATAL_WARNINGS) ||
(report->level <= GST_VALIDATE_REPORT_LEVEL_CRITICAL && (report->level <= GST_VALIDATE_REPORT_LEVEL_CRITICAL &&
_gst_validate_flags & GST_VALIDATE_FATAL_CRITICALS)) { _gst_validate_flags & GST_VALIDATE_FATAL_CRITICALS)) {
g_error ("Fatal report received: %" GST_VALIDATE_ERROR_REPORT_PRINT_FORMAT,
GST_VALIDATE_REPORT_PRINT_ARGS (report)); return TRUE;
} }
return FALSE;
} }
GstValidateIssueId GstValidateIssueId

View file

@ -195,7 +195,7 @@ GstValidateReport *gst_validate_report_ref (GstValidateReport * report);
GstValidateIssueId gst_validate_report_get_issue_id (GstValidateReport * report); GstValidateIssueId gst_validate_report_get_issue_id (GstValidateReport * report);
void gst_validate_report_check_abort (GstValidateReport * report); gboolean gst_validate_report_check_abort (GstValidateReport * report);
void gst_validate_report_printf (GstValidateReport * report); void gst_validate_report_printf (GstValidateReport * report);
const gchar * gst_validate_report_level_get_name (GstValidateReportLevel level); const gchar * gst_validate_report_level_get_name (GstValidateReportLevel level);

View file

@ -150,14 +150,20 @@ gst_validate_report_valist (GstValidateReporter * reporter,
g_free (combo); g_free (combo);
#endif #endif
gst_validate_report_check_abort (report);
if (priv->runner) { if (priv->runner) {
gst_validate_runner_add_report (priv->runner, report); gst_validate_runner_add_report (priv->runner, report);
} else { } else {
gst_validate_report_unref (report); gst_validate_report_unref (report);
} }
if (gst_validate_report_check_abort (report)) {
if (priv->runner)
gst_validate_runner_printf (priv->runner);
g_error ("Fatal report received: %" GST_VALIDATE_ERROR_REPORT_PRINT_FORMAT,
GST_VALIDATE_REPORT_PRINT_ARGS (report));
}
g_free (message); g_free (message);
} }