summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <thibault.saunier@collabora.com>2012-10-13 17:36:35 -0300
committerThibault Saunier <thibault.saunier@collabora.com>2012-10-13 17:37:46 -0300
commit1e460a3bc01f8cb33d71edf6056968ecab4208b3 (patch)
treeb39978e8cdbc2f991431e36840cd3705d0efee49
parentd13df120e35bb6132838d12aa210ed9829c2e2be (diff)
insanitytest: Add an insanity_test_report macro
This should be used only for reporting
-rw-r--r--lib/insanity/insanitytest.c6
-rw-r--r--lib/insanity/insanitytest.h2
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/insanity/insanitytest.c b/lib/insanity/insanitytest.c
index 082b6ae..4c99c66 100644
--- a/lib/insanity/insanitytest.c
+++ b/lib/insanity/insanitytest.c
@@ -1734,7 +1734,7 @@ insanity_report_failed_tests (InsanityTest * test, gboolean verbose)
while (g_hash_table_iter_next (&i, &label, &value)) {
gboolean success = (value != NULL);
if (verbose)
- insanity_test_printf (test, "%s: %s\n", (const char *) label,
+ insanity_test_report (test, "%s: %s\n", (const char *) label,
success ? "PASS" : "FAIL");
if (!success)
failed++;
@@ -1746,13 +1746,13 @@ insanity_report_failed_tests (InsanityTest * test, gboolean verbose)
if (!g_hash_table_lookup_extended (test->priv->checklist_results, label,
NULL, NULL)) {
if (verbose)
- insanity_test_printf (test, "%s: SKIP\n", (const char *) label);
+ insanity_test_report (test, "%s: SKIP\n", (const char *) label);
++failed;
}
}
if (verbose)
- insanity_test_printf (test, "%u/%u failed tests\n", failed,
+ insanity_test_report (test, "%u/%u failed tests\n", failed,
g_hash_table_size (test->priv->test_checklist));
return failed;
diff --git a/lib/insanity/insanitytest.h b/lib/insanity/insanitytest.h
index cdd2996..d706ff2 100644
--- a/lib/insanity/insanitytest.h
+++ b/lib/insanity/insanitytest.h
@@ -116,6 +116,8 @@ void insanity_test_log (InsanityTest *test, const char *category, InsanityLogLev
insanity_test_log(test, category, loglevel, __FILE__, __LINE__, format, ##args)
#define insanity_test_printf(test,format,args...) \
INSANITY_LOG(test, "default", INSANITY_LOG_LEVEL_DEBUG, format, ##args)
+#define insanity_test_report(test,format,args...) \
+ INSANITY_LOG(test, "report", INSANITY_LOG_LEVEL_INFO, format, ##args)
gboolean insanity_test_run(InsanityTest *test, int *argc, char ***argv);