summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Toso <me@victortoso.com>2018-08-29 12:30:02 +0200
committerVictor Toso <me@victortoso.com>2018-08-30 09:15:11 +0200
commit1cbe1e25203af53cafbecd965bcb96b024a6a92f (patch)
treee1ab97d6888eef3bf61d9eb951e80cf3a60e81cf
parent29b11bb1586f8f3722e27ec5e1cfbf8c43134d3a (diff)
downloadgrilo-1cbe1e25203af53cafbecd965bcb96b024a6a92f.tar.gz
tests: skip test if no plugin is installed
Registry tests around loaded GrlSources might fail if no plugin is installed. This can be guaranteed by continuous integration and would be better than creating dummy plugins to be loaded/unloaded. Signed-off-by: Victor Toso <victortoso@gnome.org>
-rw-r--r--tests/registry.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/registry.c b/tests/registry.c
index 4edabfe..d1ed02f 100644
--- a/tests/registry.c
+++ b/tests/registry.c
@@ -41,6 +41,7 @@ registry_load_error_handler (const gchar *log_domain,
CHECK_MESSAGE ("Grilo", "Configuration not provided") ||
CHECK_MESSAGE ("Grilo", "Missing configuration") ||
CHECK_MESSAGE ("Grilo", "Could not open plugin directory") ||
+ CHECK_MESSAGE ("Grilo", "Error opening directory") ||
CHECK_MESSAGE ("Grilo", "Could not read XML file")) {
return FALSE;
}
@@ -81,9 +82,13 @@ static void
registry_load (RegistryFixture *fixture, gconstpointer data)
{
gboolean res;
+ GError *err = NULL;
- res = grl_registry_load_all_plugins (fixture->registry, TRUE, NULL);
- g_assert_cmpint (res, ==, TRUE);
+ res = grl_registry_load_all_plugins (fixture->registry, TRUE, &err);
+ if (!res) {
+ g_assert_error (err, GRL_CORE_ERROR, GRL_CORE_ERROR_LOAD_PLUGIN_FAILED);
+ g_test_skip ("No sources loaded, skipping test");
+ }
}
static void
@@ -96,6 +101,10 @@ registry_unregister (RegistryFixture *fixture, gconstpointer data)
g_test_bug ("627207");
sources = grl_registry_get_sources (fixture->registry, FALSE);
+ if (sources == NULL) {
+ g_test_skip ("No sources loaded, skipping test");
+ return;
+ }
for (sources_iter = sources, i = 0; sources_iter;
sources_iter = g_list_next (sources_iter), i++) {