[glib: 1/9] g_test_run: Introduce a clean up path once test suite ran
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 1/9] g_test_run: Introduce a clean up path once test suite ran
- Date: Mon, 26 Jul 2021 10:06:08 +0000 (UTC)
commit 0786031804ca369ed64fe6413c2cdabc14eed404
Author: GOUJON Évan <goujon evan gmail com>
Date: Fri Jul 23 22:05:52 2021 +0200
g_test_run: Introduce a clean up path once test suite ran
glib/gtestutils.c | 29 ++++++++++++++++++++++++-----
1 file changed, 24 insertions(+), 5 deletions(-)
---
diff --git a/glib/gtestutils.c b/glib/gtestutils.c
index 2c3ea24a8..8ae746c73 100644
--- a/glib/gtestutils.c
+++ b/glib/gtestutils.c
@@ -2178,8 +2178,15 @@ g_test_get_root (void)
int
g_test_run (void)
{
- if (g_test_run_suite (g_test_get_root()) != 0)
- return 1;
+ int ret;
+ GTestSuite *suite;
+
+ suite = g_test_get_root ();
+ if (g_test_run_suite (suite) != 0)
+ {
+ ret = 1;
+ goto out;
+ }
/* Clean up the temporary directory. */
if (test_isolate_dirs_tmpdir != NULL)
@@ -2192,12 +2199,24 @@ g_test_run (void)
/* 77 is special to Automake's default driver, but not Automake's TAP driver
* or Perl's prove(1) TAP driver. */
if (test_tap_log)
- return 0;
+ {
+ ret = 0;
+ goto out;
+ }
if (test_run_count > 0 && test_run_count == test_skipped_count)
- return 77;
+ {
+ ret = 77;
+ goto out;
+ }
else
- return 0;
+ {
+ ret = 0;
+ goto out;
+ }
+
+out:
+ return ret;
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]