summaryrefslogtreecommitdiffstats
path: root/test/test-mock.c
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2013-02-18 09:49:41 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2013-02-18 09:49:41 +0100
commit6cc63f7ea09dcdd39de528f0822c59d34bebc85e (patch)
treea36db6a5e0e67d8694e43eb1197b2c0da87315f8 /test/test-mock.c
parentc7f50c550fea47b7b089fec9cd6120a328a0349f (diff)
downloaduca-6cc63f7ea09dcdd39de528f0822c59d34bebc85e.tar.gz
uca-6cc63f7ea09dcdd39de528f0822c59d34bebc85e.tar.bz2
uca-6cc63f7ea09dcdd39de528f0822c59d34bebc85e.tar.xz
uca-6cc63f7ea09dcdd39de528f0822c59d34bebc85e.zip
Set plugin path to the built mock module
Diffstat (limited to 'test/test-mock.c')
-rw-r--r--test/test-mock.c19
1 files changed, 17 insertions, 2 deletions
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);