2009-09-05 21:52:01 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
|
|
|
* Copyright (C) 2009 Martin Nordholts
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <glib-object.h>
|
|
|
|
|
|
|
|
#include "core/core-types.h"
|
|
|
|
|
2009-09-08 01:06:57 +08:00
|
|
|
#include "base/base.h"
|
|
|
|
|
|
|
|
#include "config/gimpbaseconfig.h"
|
|
|
|
|
2009-09-05 21:52:01 +08:00
|
|
|
#include "core/gimp.h"
|
|
|
|
|
|
|
|
#include "tests.h"
|
|
|
|
#include "units.h"
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_init_for_testing:
|
|
|
|
*
|
|
|
|
* Initialize the GIMP object system for unit testing. This is a
|
|
|
|
* selected subset of the initialization happning in app_run().
|
|
|
|
**/
|
|
|
|
Gimp *
|
2009-09-08 01:06:57 +08:00
|
|
|
gimp_init_for_testing (gboolean use_cpu_accel)
|
2009-09-05 21:52:01 +08:00
|
|
|
{
|
2009-09-08 01:06:57 +08:00
|
|
|
Gimp *gimp = gimp_new ("Unit Tested GIMP", NULL, FALSE, TRUE, TRUE, TRUE,
|
|
|
|
FALSE, TRUE, TRUE, FALSE);
|
2009-09-05 21:52:01 +08:00
|
|
|
|
|
|
|
units_init (gimp);
|
|
|
|
|
|
|
|
gimp_load_config (gimp, NULL, NULL);
|
|
|
|
|
2009-09-08 01:06:57 +08:00
|
|
|
base_init (GIMP_BASE_CONFIG (gimp->config), FALSE, use_cpu_accel);
|
|
|
|
|
2009-09-05 21:52:01 +08:00
|
|
|
return gimp;
|
|
|
|
}
|