diff options
author | Matthias Vogelgesang <matthias.vogelgesang@gmail.com> | 2013-02-18 09:49:41 +0100 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@gmail.com> | 2013-02-18 09:49:41 +0100 |
commit | 6cc63f7ea09dcdd39de528f0822c59d34bebc85e (patch) | |
tree | a36db6a5e0e67d8694e43eb1197b2c0da87315f8 /test/test-mock.c | |
parent | c7f50c550fea47b7b089fec9cd6120a328a0349f (diff) | |
download | libuca-6cc63f7ea09dcdd39de528f0822c59d34bebc85e.tar.gz libuca-6cc63f7ea09dcdd39de528f0822c59d34bebc85e.tar.bz2 libuca-6cc63f7ea09dcdd39de528f0822c59d34bebc85e.tar.xz libuca-6cc63f7ea09dcdd39de528f0822c59d34bebc85e.zip |
Set plugin path to the built mock module
Diffstat (limited to 'test/test-mock.c')
-rw-r--r-- | test/test-mock.c | 19 |
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); |