[gobject-introspection] Fix tests to look in correct directory for typelibs



commit e4b6098e55307f602c179f37d59fbc6d0d965267
Author: Colin Walters <walters verbum org>
Date:   Tue Nov 16 09:46:00 2010 -0500

    Fix tests to look in correct directory for typelibs
    
    With nonrecursive they're in $(top_builddir) now

 tests/offsets/Makefile.am       |    2 +-
 tests/repository/Makefile.am    |    2 +-
 tests/repository/gitestrepo.c   |    5 -----
 tests/repository/gitestthrows.c |    5 -----
 tests/warn/warningtester.py     |    4 ++--
 5 files changed, 4 insertions(+), 14 deletions(-)
---
diff --git a/tests/offsets/Makefile.am b/tests/offsets/Makefile.am
index 60d37b3..4f03830 100644
--- a/tests/offsets/Makefile.am
+++ b/tests/offsets/Makefile.am
@@ -48,7 +48,7 @@ CLEANFILES += gitestoffsets.c
 ############################################################
 
 check-local: Offsets-1.0.typelib
-	GI_TYPELIB_PATH=:$(top_builddir)/gir ./gitestoffsets$(EXEEXT) offsets.compiled offsets.introspected
+	GI_TYPELIB_PATH=:$(top_builddir) ./gitestoffsets$(EXEEXT) offsets.compiled offsets.introspected
 	diff -u offsets.compiled offsets.introspected
 
 CLEANFILES += offsets.compiled offsets.introspected
diff --git a/tests/repository/Makefile.am b/tests/repository/Makefile.am
index b7ed21c..a4557a9 100644
--- a/tests/repository/Makefile.am
+++ b/tests/repository/Makefile.am
@@ -13,5 +13,5 @@ gitestthrows_CPPFLAGS = $(GIREPO_CFLAGS) -I$(top_srcdir)/girepository
 gitestthrows_LDADD = $(top_builddir)/libgirepository-1.0.la $(GIREPO_LIBS)
 
 TESTS = gitestrepo gitestthrows
-TESTS_ENVIRONMENT=env top_builddir="$(top_builddir)" \
+TESTS_ENVIRONMENT=env GI_TYPELIB_PATH=$(top_builddir) \
    XDG_DATA_DIRS="$(top_srcdir)/gir:$(XDG_DATA_DIRS)" $(DEBUG)
diff --git a/tests/repository/gitestrepo.c b/tests/repository/gitestrepo.c
index eba655f..316ee3d 100644
--- a/tests/repository/gitestrepo.c
+++ b/tests/repository/gitestrepo.c
@@ -43,16 +43,11 @@ main(int argc, char **argv)
   GIBaseInfo *info;
   GIBaseInfo *siginfo;
   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);
   if (!ret)
     g_error ("%s", error->message);
diff --git a/tests/repository/gitestthrows.c b/tests/repository/gitestthrows.c
index d29eceb..cce0684 100644
--- a/tests/repository/gitestthrows.c
+++ b/tests/repository/gitestthrows.c
@@ -11,7 +11,6 @@ main(int argc, char **argv)
   GIRepository *repo;
   GITypelib *ret;
   GIBaseInfo *info;
-  char *girdir;
   GIArgument in_arg[1];
   GIArgument ret_arg;
   GError *error;
@@ -21,10 +20,6 @@ main(int argc, char **argv)
 
   repo = g_irepository_get_default ();
 
-  girdir = g_build_filename (g_getenv ("top_builddir"), "gir", NULL);
-  g_irepository_prepend_search_path (girdir);
-  g_free (girdir);
-
   error = NULL;
   ret = g_irepository_require (repo, "GLib", NULL, 0, &error);
   g_assert (ret != NULL);
diff --git a/tests/warn/warningtester.py b/tests/warn/warningtester.py
index f8f5565..bd1a4ad 100644
--- a/tests/warn/warningtester.py
+++ b/tests/warn/warningtester.py
@@ -20,8 +20,8 @@ from giscanner.scannermain import process_packages
 currentdir = os.path.dirname(os.path.abspath(sys.argv[0]))
 current_name = os.path.basename(currentdir)
 path = os.path.abspath(os.path.join(currentdir, '..', ''))
+top_srcdir = os.environ['UNINSTALLED_INTROSPECTION_SRCDIR']
 top_builddir = os.environ['TOP_BUILDDIR']
-girpath = os.path.join(top_builddir, 'gir')
 
 class Options:
     def __init__(self):
@@ -76,7 +76,7 @@ def check(args):
                                output=output)
     logger.enable_warnings(True)
     transformer = Transformer(namespace)
-    transformer.set_include_paths([girpath])
+    transformer.set_include_paths([os.path.join(top_srcdir, 'gir'), top_builddir])
     transformer.register_include(Include.from_string("GObject-2.0"))
 
     ss = SourceScanner()



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