summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-02-13 10:56:26 -0500
committerMatthias Clasen <mclasen@redhat.com>2020-02-13 10:56:26 -0500
commitcdee2ac17319a6e693c40bf6df33260e0657cf92 (patch)
tree2253071cfa5e4f8c946b65efb8a04dd413a7b0d7
parenta66ed7c461b233e725f881ceca725301aa644efa (diff)
downloadgtk+-cdee2ac17319a6e693c40bf6df33260e0657cf92.tar.gz
testsuite: Handle icontheme test better
Skip just the failing tests in release builds.
-rw-r--r--testsuite/gtk/icontheme.c16
-rw-r--r--testsuite/gtk/meson.build8
2 files changed, 16 insertions, 8 deletions
diff --git a/testsuite/gtk/icontheme.c b/testsuite/gtk/icontheme.c
index 85c120d68b..3948828b93 100644
--- a/testsuite/gtk/icontheme.c
+++ b/testsuite/gtk/icontheme.c
@@ -183,6 +183,11 @@ assert_lookup_order (const char *icon_name,
GtkIconPaintable *info;
GList *l;
+/* this hack is only usable in debug builds */
+#ifndef G_ENABLE_DEBUG
+ g_assert_not_reached ();
+#endif
+
debug_flags = gtk_get_debug_flags ();
gtk_set_debug_flags (debug_flags | GTK_DEBUG_ICONTHEME);
g_log_set_writer_func (log_writer, NULL, NULL);
@@ -224,6 +229,15 @@ assert_lookup_order (const char *icon_name,
gtk_set_debug_flags (debug_flags);
}
+#ifdef G_ENABLE_DEBUG
+#define require_debug()
+#else
+#define require_debug() \
+ g_test_skip ("requires G_ENABLE_DEBUG"); \
+ return;
+#endif
+
+
static void
test_basics (void)
{
@@ -234,6 +248,8 @@ test_basics (void)
static void
test_lookup_order (void)
{
+ require_debug ();
+
assert_lookup_order ("foo-bar-baz", 16, GTK_TEXT_DIR_NONE, 0, TRUE,
"foo-bar-baz",
"foo-bar",
diff --git a/testsuite/gtk/meson.build b/testsuite/gtk/meson.build
index 02aeb6fa44..333f4347cb 100644
--- a/testsuite/gtk/meson.build
+++ b/testsuite/gtk/meson.build
@@ -74,11 +74,6 @@ tests = [
xfail = [
]
-# Tests that are expected to fail on non-debug builds
-xfail_nodebug = [
- 'icontheme', # Overrides debugging messages
-]
-
is_debug = get_option('buildtype').startswith('debug')
test_cargs = []
@@ -102,9 +97,6 @@ foreach t : tests
install_dir: testexecdir)
expect_fail = xfail.contains(test_name)
- if not is_debug
- expect_fail = xfail_nodebug.contains(test_name)
- endif
test(test_name, test_exe,
args: [ '--tap', '-k' ],