[aravis] build: make distcheck pass.



commit 9b09d23cc19100795994adfa2922b8e258e42f2a
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Fri May 7 17:30:01 2010 +0200

    build: make distcheck pass.

 src/arvfakecamera.c   |   14 +++++++++++++-
 src/arvfakecamera.h   |    1 +
 src/tests/Makefile.am |    5 ++++-
 src/tests/fake.c      |    2 ++
 4 files changed, 20 insertions(+), 2 deletions(-)
---
diff --git a/src/arvfakecamera.c b/src/arvfakecamera.c
index ca04bf5..a3bccf2 100644
--- a/src/arvfakecamera.c
+++ b/src/arvfakecamera.c
@@ -35,6 +35,8 @@ struct _ArvFakeCameraPrivate {
 	size_t genicam_data_size;
 };
 
+static const char *arv_fake_camera_genicam_filename = NULL;
+
 /* ArvFakeCamera implementation */
 
 gboolean
@@ -90,6 +92,12 @@ arv_fake_camera_write_register (ArvFakeCamera *camera, guint32 address, guint32
 	return arv_fake_camera_write_memory (camera, address, sizeof (value), &value);
 }
 
+void
+arv_set_fake_camera_genicam_filename (const char *filename)
+{
+	arv_fake_camera_genicam_filename = filename;
+}
+
 const char *
 arv_get_fake_camera_genicam_data (size_t *size)
 {
@@ -101,7 +109,11 @@ arv_get_fake_camera_genicam_data (size_t *size)
 	if (genicam_file == NULL ) {
 		char *filename;
 
-		filename = g_build_filename (ARAVIS_DATA_DIR, "arv-fake-camera.xml", NULL);
+		if (arv_fake_camera_genicam_filename == NULL)
+			filename = g_build_filename (ARAVIS_DATA_DIR, "arv-fake-camera.xml", NULL);
+		else
+			filename = g_strdup (arv_fake_camera_genicam_filename);
+
 		genicam_file = g_mapped_file_new (filename, FALSE, NULL);
 
 		if (genicam_file != NULL) {
diff --git a/src/arvfakecamera.h b/src/arvfakecamera.h
index eca355f..cc324e3 100644
--- a/src/arvfakecamera.h
+++ b/src/arvfakecamera.h
@@ -69,6 +69,7 @@ gboolean	arv_fake_camera_write_memory	(ArvFakeCamera *camera, guint32 address, g
 gboolean 	arv_fake_camera_read_register	(ArvFakeCamera *camera, guint32 address, guint32 *value);
 gboolean	arv_fake_camera_write_register 	(ArvFakeCamera *camera, guint32 address, guint32 value);
 
+void 			arv_set_fake_camera_genicam_filename 	(const char *filename);
 const char *		arv_get_fake_camera_genicam_data	(size_t *size);
 
 G_END_DECLS
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
index 45d8541..b140869 100644
--- a/src/tests/Makefile.am
+++ b/src/tests/Makefile.am
@@ -4,7 +4,9 @@ INCLUDES = -g -I$(top_srcdir)/src/ $(ARAVIS_CFLAGS)
 
 noinst_PROGRAMS = $(TEST_PROGS)
 
-TEST_PROGS        += evaluator genicam fake
+TEST_PROGS += evaluator genicam fake
+
+EXTRA_DIST += genicam.xml
 
 evaluator_SOURCES = evaluator.c
 evaluator_LDADD = $(ARAVIS_LIBS) $(top_builddir)/src/libaravis.la
@@ -14,5 +16,6 @@ genicam_CFLAGS = -DGENICAM_FILENAME="\"$(srcdir)/genicam.xml\""
 genicam_LDADD = $(ARAVIS_LIBS) $(top_builddir)/src/libaravis.la
 
 fake_SOURCES = fake.c
+fake_CFLAGS = -DGENICAM_FILENAME="\"$(srcdir)/../arv-fake-camera.xml\""
 fake_LDADD = $(ARAVIS_LIBS) $(top_builddir)/src/libaravis.la
 
diff --git a/src/tests/fake.c b/src/tests/fake.c
index 8ec68be..daf1a22 100644
--- a/src/tests/fake.c
+++ b/src/tests/fake.c
@@ -67,6 +67,8 @@ main (int argc, char *argv[])
 
 	g_type_init ();
 
+	arv_set_fake_camera_genicam_filename (GENICAM_FILENAME);
+
 	g_test_add_func ("/fake/load-fake-camera-genicam", load_fake_camera_genicam_test);
 	g_test_add_func ("/fake/fake-device", fake_device_test);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]