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.
This commit is contained in:
Matthias Clasen 2014-08-10 19:05:50 -04:00
parent 7f1d88f740
commit 80a8257302
3 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -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);

View File

@ -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);