tests: common: add API to check if spa lib is installed

Allows to skip tests if specific spa lib is not installed
This commit is contained in:
Julian Bouzas 2021-07-16 11:49:35 -04:00
parent ece8f7a78d
commit eb8f9a1a83

View file

@ -158,3 +158,15 @@ test_ensure_object_manager_is_installed (WpObjectManager * om, WpCore * core,
g_main_loop_run (loop);
g_signal_handler_disconnect (om, id);
}
static G_GNUC_UNUSED gboolean
test_is_spa_lib_installed (WpBaseTestFixture *f, const gchar *factory_name) {
struct spa_handle *handle;
handle = pw_context_load_spa_handle (f->server.context, factory_name, NULL);
if (!handle)
return FALSE;
pw_unload_spa_handle (handle);
return TRUE;
}