[gnome-desktop-testing] Emit ONE_TEST_FAILED_MSGID when we catch a non-test failure
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-desktop-testing] Emit ONE_TEST_FAILED_MSGID when we catch a non-test failure
- Date: Thu, 30 May 2013 00:14:58 +0000 (UTC)
commit 74c1f1c21a8f44f5d31283671035f0993e392915
Author: Colin Walters <walters verbum org>
Date: Wed May 29 20:14:07 2013 -0400
Emit ONE_TEST_FAILED_MSGID when we catch a non-test failure
Such as a missing Type=; this will ensure the gnome-ostree
integrationtest terminates. Also clean up the exit handling a bit.
src/gnome-desktop-testing-runner.c | 21 ++++++++++++---------
1 files changed, 12 insertions(+), 9 deletions(-)
---
diff --git a/src/gnome-desktop-testing-runner.c b/src/gnome-desktop-testing-runner.c
index bec3f50..0393f57 100755
--- a/src/gnome-desktop-testing-runner.c
+++ b/src/gnome-desktop-testing-runner.c
@@ -132,7 +132,7 @@ load_test (GFile *prefix_root,
else
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "Unknown test type '%s'", test->type);
+ "Unknown test type '%s'", type_key);
goto out;
}
@@ -529,6 +529,14 @@ main (int argc, char **argv)
ret = TRUE;
out:
+ if (!ret)
+ {
+ g_assert (local_error);
+ /* Reusing ONE_TEST_FAILED_MSGID is not quite right, but whatever */
+ gs_log_structured_print_id_v (ONE_TEST_FAILED_MSGID,
+ "Caught exception during testing: %s", local_error->message);
+ g_clear_error (&local_error);
+ }
if (!opt_list)
{
n_passed = n_skipped = n_failed = 0;
@@ -551,17 +559,12 @@ main (int argc, char **argv)
}
}
gs_log_structured_print_id_v (TESTS_COMPLETE_MSGID,
- "SUMMARY: total: %u passed: %d skipped: %d failed: %d",
+ "SUMMARY%s: total: %u passed: %d skipped: %d failed: %d",
+ ret ? "" : " (incomplete)",
total_tests, n_passed, n_skipped, n_failed);
}
g_clear_pointer (&app->tests, g_ptr_array_unref);
if (!ret)
- {
- g_assert (local_error);
- g_printerr ("Caught exception during testing: %s\n", local_error->message);
- g_clear_error (&local_error);
- return 1;
- }
-
+ return 1;
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]