tests

tests

Synopsis

Gimp *              gimp_init_for_testing               (void);
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);

Description

Details

gimp_init_for_testing ()

Gimp *              gimp_init_for_testing               (void);

Initialize the GIMP object system for unit testing. This is a selected subset of the initialization happning in app_run().


gimp_init_for_gui_testing ()

Gimp *              gimp_init_for_gui_testing           (gboolean show_gui);

Like gimp_init_for_gui_testing(), but also allows a custom gimprc filename to be specified.

Returns :

The Gimp instance.

gimp_init_for_gui_testing_with_rc ()

Gimp *              gimp_init_for_gui_testing_with_rc   (gboolean show_gui,
                                                         const gchar *gimprc);


gimp_test_run_temp_mainloop ()

void                gimp_test_run_temp_mainloop         (guint32 running_time);

Helper function for tests that wants to run a main loop for a while. Useful when you want GIMP's state to settle before doing tests.

running_time :

The time to run the main loop.

gimp_test_run_mainloop_until_idle ()

void                gimp_test_run_mainloop_until_idle   (void);

Creates and runs a main loop until it is idle, i.e. has no more work to do.


gimp_test_bail_if_no_display ()

void                gimp_test_bail_if_no_display        (void);

If no DISPLAY is set, call exit(EXIT_SUCCESS). There is no use in having UI tests failing in DISPLAY-less environments.