diff options
author | Colin Walters <walters@src.gnome.org> | 2008-10-14 18:22:19 +0000 |
---|---|---|
committer | Colin Walters <walters@src.gnome.org> | 2008-10-14 18:22:19 +0000 |
commit | 654b5ec1be0ebe6d5ff31b971907ffb4be04ba0b (patch) | |
tree | 4ce97410333abef40fee584e6e598083b64c3ba9 /tests/repository | |
parent | e7234221024c2674752955d2bab22a271c68139b (diff) | |
download | gobject-introspection-654b5ec1be0ebe6d5ff31b971907ffb4be04ba0b.tar.gz |
Prepend search path for $(top_builddir)/gir dir
svn path=/trunk/; revision=705
Diffstat (limited to 'tests/repository')
-rw-r--r-- | tests/repository/Makefile.am | 4 | ||||
-rw-r--r-- | tests/repository/gitestrepo.c | 9 |
2 files changed, 10 insertions, 3 deletions
diff --git a/tests/repository/Makefile.am b/tests/repository/Makefile.am index 8ec55c58..7a1478f1 100644 --- a/tests/repository/Makefile.am +++ b/tests/repository/Makefile.am @@ -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 diff --git a/tests/repository/gitestrepo.c b/tests/repository/gitestrepo.c index 324df26e..2b92e19b 100644 --- a/tests/repository/gitestrepo.c +++ b/tests/repository/gitestrepo.c @@ -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); } |