app: find templaterc and controllerrc when testing the build.

This should fix these errors when running `ninja test` or `make check`:

> GIMP-Error: Failed to open file ?/builds/GNOME/gimp/_install/etc/gimp/2.99/templaterc?: open() failed: No such file or directory
> GIMP-Error: Failed to open file ?/builds/GNOME/gimp/_install/etc/gimp/2.99/controllerrc?: open() failed: No such file or directory
This commit is contained in:
Jehan 2021-10-23 01:57:30 +02:00
parent efaf9e099e
commit 72f8e63441
2 changed files with 24 additions and 2 deletions

View file

@ -57,7 +57,18 @@ gimp_templates_load (Gimp *gimp)
g_clear_error (&error);
g_object_unref (file);
file = gimp_sysconf_directory_file ("templaterc", NULL);
if (g_getenv ("GIMP_TESTING_ABS_TOP_SRCDIR"))
{
gchar *path;
path = g_build_filename (g_getenv ("GIMP_TESTING_ABS_TOP_SRCDIR"),
"etc", "templaterc", NULL);
file = g_file_new_for_path (path);
g_free (path);
}
else
{
file = gimp_sysconf_directory_file ("templaterc", NULL);
}
if (! gimp_config_deserialize_file (GIMP_CONFIG (gimp->templates),
file, NULL, &error))

View file

@ -158,7 +158,18 @@ gimp_controllers_restore (Gimp *gimp,
g_clear_error (&error);
g_object_unref (file);
file = gimp_sysconf_directory_file ("controllerrc", NULL);
if (g_getenv ("GIMP_TESTING_ABS_TOP_SRCDIR"))
{
gchar *path;
path = g_build_filename (g_getenv ("GIMP_TESTING_ABS_TOP_SRCDIR"),
"etc", "controllerrc", NULL);
file = g_file_new_for_path (path);
g_free (path);
}
else
{
file = gimp_sysconf_directory_file ("controllerrc", NULL);
}
if (! gimp_config_deserialize_file (GIMP_CONFIG (manager->controllers),
file, NULL, &error))