From 6cc63f7ea09dcdd39de528f0822c59d34bebc85e Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Mon, 18 Feb 2013 09:49:41 +0100 Subject: Set plugin path to the built mock module --- test/test-mock.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'test/test-mock.c') diff --git a/test/test-mock.c b/test/test-mock.c index 85c1ba4..50997f2 100644 --- a/test/test-mock.c +++ b/test/test-mock.c @@ -8,14 +8,29 @@ typedef struct { UcaCamera *camera; } Fixture; +static gchar * +build_mock_plugin_path (void) +{ + gchar *cwd; + gchar *plugin_path; + + cwd = g_get_current_dir (); + plugin_path = g_build_filename (cwd, "plugins", "mock", NULL); + g_free (cwd); + return plugin_path; +} + static void fixture_setup (Fixture *fixture, gconstpointer data) { + gchar *plugin_path; GError *error = NULL; - fixture->manager = uca_plugin_manager_new (); - uca_plugin_manager_add_path (fixture->manager, "./src"); + plugin_path = build_mock_plugin_path (); + g_setenv ("UCA_CAMERA_PATH", plugin_path, TRUE); + g_free (plugin_path); + fixture->manager = uca_plugin_manager_new (); fixture->camera = uca_plugin_manager_get_camera (fixture->manager, "mock", &error); g_assert (error == NULL); g_assert (fixture->camera); -- cgit v1.2.3