Commit f73092bb authored by Martin Nordholts's avatar Martin Nordholts

app/tests: Add gimp_init_for_gui_testing_with_rc()

parent 0a20d9bd
......@@ -82,17 +82,9 @@ gimp_init_for_testing (void)
#ifndef GIMP_CONSOLE_COMPILATION
/**
* gimp_init_for_gui_testing:
* @use_cpu_accel:
*
* Initializes a #Gimp instance for use in test cases that rely on GUI
* code to be initialized.
*
* Returns: The #Gimp instance.
**/
Gimp *
gimp_init_for_gui_testing (gboolean show_gui)
static Gimp *
gimp_init_for_gui_testing_internal (gboolean show_gui,
const gchar *gimprc)
{
GimpSessionInfoClass *klass;
Gimp *gimp;
......@@ -111,7 +103,7 @@ gimp_init_for_gui_testing (gboolean show_gui)
FALSE, TRUE, TRUE, FALSE);
gimp_set_show_gui (gimp, show_gui);
units_init (gimp);
gimp_load_config (gimp, NULL, NULL);
gimp_load_config (gimp, gimprc, NULL);
base_init (GIMP_BASE_CONFIG (gimp->config),
FALSE /*be_verbose*/,
FALSE /*use_cpu_accel*/);
......@@ -124,6 +116,38 @@ gimp_init_for_gui_testing (gboolean show_gui)
return gimp;
}
/**
* gimp_init_for_gui_testing:
* @show_gui:
*
* Initializes a #Gimp instance for use in test cases that rely on GUI
* code to be initialized.
*
* Returns: The #Gimp instance.
**/
Gimp *
gimp_init_for_gui_testing (gboolean show_gui)
{
return gimp_init_for_gui_testing_internal (show_gui, NULL);
}
/**
* gimp_init_for_gui_testing:
* @show_gui:
* @gimprc:
*
* Like gimp_init_for_gui_testing(), but also allows a custom gimprc
* filename to be specified.
*
* Returns: The #Gimp instance.
**/
Gimp *
gimp_init_for_gui_testing_with_rc (gboolean show_gui,
const gchar *gimprc)
{
return gimp_init_for_gui_testing_internal (show_gui, gimprc);
}
#endif /* GIMP_CONSOLE_COMPILATION */
static gboolean
......
......@@ -20,8 +20,10 @@
Gimp * gimp_init_for_testing (void);
Gimp * gimp_init_for_gui_testing (gboolean show_gui);
void gimp_test_run_temp_mainloop (guint32 running_time);
Gimp * gimp_init_for_gui_testing (gboolean show_gui);
Gimp * gimp_init_for_gui_testing_with_rc (gboolean show_gui,
const gchar *gimprc);
void gimp_test_run_temp_mainloop (guint32 running_time);
void gimp_test_run_mainloop_until_idle (void);
void gimp_test_bail_if_no_display (void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment