summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-01-17 17:48:45 +0100
committerThomas Haller <thaller@redhat.com>2022-01-21 12:08:00 +0100
commitee3e2e0bb688c27ee11f702a2457a0ce285961e5 (patch)
treeb3f44a27c2c3f13490acef7df0d9df1c06739193
parenteda2c5ac483844c802144478714324ee67789c2c (diff)
glib-aux/tests: add nmtst_test_skip_slow() helper
-rw-r--r--src/libnm-glib-aux/nm-test-utils.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libnm-glib-aux/nm-test-utils.h b/src/libnm-glib-aux/nm-test-utils.h
index 6cf5a777d7..caf43d5f48 100644
--- a/src/libnm-glib-aux/nm-test-utils.h
+++ b/src/libnm-glib-aux/nm-test-utils.h
@@ -709,6 +709,17 @@ nmtst_test_quick(void)
return __nmtst_internal.test_quick;
}
+static inline gboolean
+nmtst_test_skip_slow(void)
+{
+ if (!nmtst_test_quick())
+ return FALSE;
+
+ g_print("Skipping test: don't run long running test %s (NMTST_DEBUG=slow)\n", g_get_prgname());
+ g_test_skip("Skip long running test");
+ return TRUE;
+}
+
#if GLIB_CHECK_VERSION(2, 34, 0)
#undef g_test_expect_message
#define g_test_expect_message(...) \