Commit 65426177 authored by Michael Natterer's avatar Michael Natterer 😴

Initialize some more stuff so real tests are possible

* tests.[ch]: initialize base so we have a tile cache and add
  parameter "gboolean use_cpu_accel" so we can test stuff both with
  and without using CPU features.

* tests/test-layer-grouping.c: changed accordingly. Call g_thread_init()
  so the tile cache works (and to be on the safe side in general).
parent 2e2c7aaf
......@@ -21,6 +21,10 @@
#include "core/core-types.h"
#include "base/base.h"
#include "config/gimpbaseconfig.h"
#include "core/gimp.h"
#include "tests.h"
......@@ -34,14 +38,16 @@
* selected subset of the initialization happning in app_run().
**/
Gimp *
gimp_init_for_testing (void)
gimp_init_for_testing (gboolean use_cpu_accel)
{
Gimp *gimp = gimp_new ("Unit Tested GIMP", NULL, FALSE, TRUE, TRUE, TRUE,
FALSE, TRUE, TRUE, FALSE);
Gimp *gimp = gimp_new ("Unit Tested GIMP", NULL, FALSE, TRUE, TRUE, TRUE,
FALSE, TRUE, TRUE, FALSE);
units_init (gimp);
gimp_load_config (gimp, NULL, NULL);
base_init (GIMP_BASE_CONFIG (gimp->config), FALSE, use_cpu_accel);
return gimp;
}
......@@ -18,6 +18,8 @@
#ifndef __TESTS_H__
#define __TESTS_H__
Gimp * gimp_init_for_testing (void);
Gimp * gimp_init_for_testing (gboolean use_cpu_accel);
#endif /* __TESTS_H__ */
......@@ -50,11 +50,13 @@ int
main (int argc,
char **argv)
{
g_thread_init (NULL);
g_type_init ();
g_test_init (&argc, &argv, NULL);
/* We share the same application instance across all tests */
gimp = gimp_init_for_testing ();
gimp = gimp_init_for_testing (TRUE);
/* Setup the tests */
g_test_add ("/gimp-layer-grouping/add-layer",
......
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