Prepend search path for $(top_builddir)/gir dir
authorColin Walters <walters@src.gnome.org>
Tue, 14 Oct 2008 18:22:19 +0000 (18:22 +0000)
committerColin Walters <walters@src.gnome.org>
Tue, 14 Oct 2008 18:22:19 +0000 (18:22 +0000)
svn path=/trunk/; revision=705

ChangeLog
tests/repository/Makefile.am
tests/repository/gitestrepo.c

index 941467b..5fa4fdb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-10-14  Colin Walters  <walters@verbum.org>
+
+       * tests/repository/Makefile.am: Reenable repo test.
+       * tests/repository/gitestrepo.c: Prepend search
+       path for $(top_builddir)/gir dir so that we don't
+       require installation for "make check" to pass.
+
 2008-10-13  Jürg Billeter  <j@bitron.ch>
 
        * giscanner/glibtransformer.py:
index 8ec55c5..7a1478f 100644 (file)
@@ -8,5 +8,5 @@ gitestrepo_SOURCES = $(srcdir)/gitestrepo.c
 gitestrepo_CPPFLAGS = $(GIREPO_CFLAGS) -I$(top_srcdir)/girepository
 gitestrepo_LDADD = $(GIREPO_LIBS) $(top_builddir)/girepository/libgirepository.la
 
-TESTS = #gitestrepo
-TESTS_ENVIRONMENT=env XDG_DATA_DIRS=$(top_builddir)/gir
+TESTS = gitestrepo
+TESTS_ENVIRONMENT=env top_builddir="$(top_builddir)"
\ No newline at end of file
index 324df26..2b92e19 100644 (file)
@@ -4,7 +4,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 
-int 
+int
 main(int argc, char **argv)
 {
   GIRepository *repo;
@@ -12,11 +12,16 @@ main(int argc, char **argv)
   GError *error = NULL;
   GIBaseInfo *info;
   GType gtype;
+  char *girdir;
 
   g_type_init ();
 
   repo = g_irepository_get_default ();
 
+  girdir = g_build_filename (g_getenv ("top_builddir"), "gir", NULL);
+  g_irepository_prepend_search_path (girdir);
+  g_free (girdir);
+
   ret = g_irepository_require (repo, "Gio", NULL, 0, &error);
   g_assert (ret);
   g_assert (error == NULL);
@@ -31,5 +36,7 @@ main(int argc, char **argv)
   info = g_irepository_find_by_gtype (repo, g_type_from_name ("GCancellable"));
   g_assert (info != NULL);
 
+  g_print ("Successfully found GCancellable\n");
+
   exit(0);
 }