summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-08-10 19:05:50 -0400
committerMatthias Clasen <mclasen@redhat.com>2014-08-10 19:11:39 -0400
commit80a8257302f00b11613d635284c4d03ef71b430c (patch)
treebe33ae053e46bde0c61b93cf6f32373e262c6cd8
parent7f1d88f7401c50c1f7f3b3821cb4d493c198fd50 (diff)
downloadgtk+-80a8257302f00b11613d635284c4d03ef71b430c.tar.gz
Fix reftests for builddir != srcdir
Make gtk-reftest consult the REFTEST_MODULE_DIR environment variable to find out where to look for modules, and fix the libtool hack to construct the .libs subdirectory correctly.
-rw-r--r--testsuite/reftests/Makefile.am1
-rw-r--r--testsuite/reftests/gtk-reftest.c5
-rw-r--r--testsuite/reftests/reftest-module.c2
3 files changed, 6 insertions, 2 deletions
diff --git a/testsuite/reftests/Makefile.am b/testsuite/reftests/Makefile.am
index 2607ecc8c7..8501c34ab6 100644
--- a/testsuite/reftests/Makefile.am
+++ b/testsuite/reftests/Makefile.am
@@ -2,6 +2,7 @@ include $(top_srcdir)/Makefile.decl
NULL =
TESTS_ENVIRONMENT = \
+ REFTEST_MODULE_DIR=$(abs_builddir) \
GTK_IM_MODULE=gtk-im-context-simple \
GSETTINGS_BACKEND=memory \
G_ENABLE_DIAGNOSTIC=0
diff --git a/testsuite/reftests/gtk-reftest.c b/testsuite/reftests/gtk-reftest.c
index d4323346be..a9da81bd58 100644
--- a/testsuite/reftests/gtk-reftest.c
+++ b/testsuite/reftests/gtk-reftest.c
@@ -381,10 +381,12 @@ connect_signals (GtkBuilder *builder,
}
break;
case 2:
+ if (g_getenv ("REFTEST_MODULE_DIR"))
+ directory = g_getenv ("REFTEST_MODULE_DIR");
module = reftest_module_new (directory, split[0]);
if (module == NULL)
{
- g_error ("Could not load module '%s' when looking up '%s'", split[0], handler_name);
+ g_error ("Could not load module '%s' from '%s' when looking up '%s'", split[0], directory, handler_name);
return;
}
func = reftest_module_lookup (module, split[1]);
@@ -438,6 +440,7 @@ snapshot_ui_file (const char *ui_file)
gtk_builder_connect_signals_full (builder, connect_signals, directory);
window = builder_get_toplevel (builder);
g_object_unref (builder);
+ g_free (directory);
g_assert (window);
gtk_widget_show (window);
diff --git a/testsuite/reftests/reftest-module.c b/testsuite/reftests/reftest-module.c
index 536b34d0ec..78fd1833aa 100644
--- a/testsuite/reftests/reftest-module.c
+++ b/testsuite/reftests/reftest-module.c
@@ -99,7 +99,7 @@ reftest_module_new (const char *directory,
if (module == NULL)
{
/* libtool hack */
- char *libtool_dir = g_build_path (directory, ".libs", NULL);
+ char *libtool_dir = g_build_filename (directory, ".libs", NULL);
g_free (full_path);
full_path = g_module_build_path (libtool_dir, module_name);