mirror of https://github.com/GNOME/gimp.git
app: Add gimp_test_run_mainloop_until_idle()
Add function that runs a main loop until it is idle. Useful for test cases.
This commit is contained in:
parent
0f7c373f3b
commit
049de90d81
16
app/tests.c
16
app/tests.c
|
@ -136,4 +136,20 @@ gimp_test_run_temp_mainloop (guint32 running_time)
|
|||
g_main_loop_unref (loop);
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_test_run_mainloop_until_idle:
|
||||
*
|
||||
* Creates and runs a main loop until it is idle, i.e. has no more
|
||||
* work to do.
|
||||
**/
|
||||
void
|
||||
gimp_test_run_mainloop_until_idle (void)
|
||||
{
|
||||
GMainLoop *loop = g_main_loop_new (NULL, FALSE);
|
||||
|
||||
g_idle_add ((GSourceFunc) gimp_tests_quit_mainloop, loop);
|
||||
|
||||
g_main_loop_run (loop);
|
||||
|
||||
g_main_loop_unref (loop);
|
||||
}
|
||||
|
|
|
@ -19,10 +19,11 @@
|
|||
#define __TESTS_H__
|
||||
|
||||
|
||||
Gimp * gimp_init_for_testing (gboolean use_cpu_accel);
|
||||
Gimp * gimp_init_for_gui_testing (gboolean use_cpu_accel,
|
||||
gboolean show_gui);
|
||||
void gimp_test_run_temp_mainloop (guint32 running_time);
|
||||
Gimp * gimp_init_for_testing (gboolean use_cpu_accel);
|
||||
Gimp * gimp_init_for_gui_testing (gboolean use_cpu_accel,
|
||||
gboolean show_gui);
|
||||
void gimp_test_run_temp_mainloop (guint32 running_time);
|
||||
void gimp_test_run_mainloop_until_idle (void);
|
||||
|
||||
|
||||
#endif /* __TESTS_H__ */
|
||||
|
|
Loading…
Reference in New Issue