mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-22 00:47:42 -06:00
Tests: harmonize test initialization
In particular, use qof_init instead of g_type_init. The former calls the latter by default. Also our current engine code is heavily dependent on gobject, so it makes sense to initialize it as early on as possible. Having once central place to do so will make it easier to fix this if ever we move away from gobject. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22943 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
eb409ecd35
commit
84b2428192
@ -194,7 +194,6 @@ int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
g_setenv ("GNC_UNINSTALLED", "1", TRUE);
|
||||
g_type_init();
|
||||
qof_init();
|
||||
gnc_engine_init(0, NULL);
|
||||
|
||||
|
@ -35,11 +35,10 @@ int
|
||||
main (int argc,
|
||||
char *argv[])
|
||||
{
|
||||
g_type_init(); /* Initialize the GObject system */
|
||||
g_test_init ( &argc, &argv, NULL ); /* initialize test program */
|
||||
qof_init(); /* equally initializes gobject system */
|
||||
qof_log_init_filename_special("stderr"); /* Init the log system */
|
||||
g_test_init ( &argc, &argv, NULL ); /* initialize test program */
|
||||
g_test_bug_base("https://bugzilla.gnome.org/show_bug.cgi?id="); /* init the bugzilla URL */
|
||||
qof_init();
|
||||
cashobjects_register();
|
||||
g_assert (qof_load_backend_library ("../.libs/", GNC_LIB_NAME));
|
||||
g_assert (qof_load_backend_library ("../../xml/.libs",
|
||||
|
@ -31,9 +31,9 @@ int
|
||||
main (int argc,
|
||||
char *argv[])
|
||||
{
|
||||
g_type_init(); /* Initialize the GObject system */
|
||||
g_test_init ( &argc, &argv, NULL ); /* initialize test program */
|
||||
qof_init(); /* Initialize the GObject system */
|
||||
qof_log_init_filename_special("stderr"); /* Init the log system */
|
||||
g_test_init ( &argc, &argv, NULL ); /* initialize test program */
|
||||
g_test_bug_base("https://bugzilla.gnome.org/show_bug.cgi?id="); /* init the bugzilla URL */
|
||||
|
||||
test_suite_gnc_backend_sql ();
|
||||
|
@ -115,7 +115,6 @@ main (int argc, char ** argv)
|
||||
const char *location = g_getenv("GNC_TEST_FILES");
|
||||
GDir *xml2_dir;
|
||||
|
||||
g_type_init();
|
||||
qof_init();
|
||||
cashobjects_register();
|
||||
do_test(qof_load_backend_library ("../.libs/", GNC_LIB_NAME),
|
||||
|
@ -35,9 +35,9 @@ int
|
||||
main (int argc,
|
||||
char *argv[])
|
||||
{
|
||||
g_type_init(); /* Initialize the GObject system */
|
||||
g_test_init ( &argc, &argv, NULL ); /* initialize test program */
|
||||
qof_init(); /* Initialize the GObject system */
|
||||
qof_log_init_filename_special("stderr"); /* Init the log system */
|
||||
g_test_init ( &argc, &argv, NULL ); /* initialize test program */
|
||||
//qof_log_set_level("gnc", G_LOG_LEVEL_DEBUG);
|
||||
g_test_bug_base("https://bugzilla.gnome.org/show_bug.cgi?id="); /* init the bugzilla URL */
|
||||
|
||||
|
@ -37,9 +37,9 @@ int
|
||||
main (int argc,
|
||||
char *argv[])
|
||||
{
|
||||
g_type_init(); /* Initialize the GObject system */
|
||||
g_test_init ( &argc, &argv, NULL ); /* initialize test program */
|
||||
qof_init(); /* Initialize the GObject system */
|
||||
qof_log_init_filename_special("stderr"); /* Init the log system */
|
||||
g_test_init ( &argc, &argv, NULL ); /* initialize test program */
|
||||
// g_log_set_always_fatal (0);
|
||||
g_test_bug_base("https://bugzilla.gnome.org/show_bug.cgi?id="); /* init the bugzilla URL */
|
||||
|
||||
|
@ -42,9 +42,9 @@ int
|
||||
main (int argc,
|
||||
char *argv[])
|
||||
{
|
||||
g_type_init(); /* Initialize the GObject system */
|
||||
g_test_init ( &argc, &argv, NULL ); /* initialize test program */
|
||||
qof_init(); /* Initialize the GObject system */
|
||||
qof_log_init_filename_special("stderr"); /* Init the log system */
|
||||
g_test_init ( &argc, &argv, NULL ); /* initialize test program */
|
||||
g_test_bug_base("https://bugzilla.gnome.org/show_bug.cgi?id="); /* init the bugzilla URL */
|
||||
|
||||
// Initialize glibmm
|
||||
|
@ -34,13 +34,13 @@ int
|
||||
main (int argc,
|
||||
char *argv[])
|
||||
{
|
||||
g_type_init(); /* You may or may not need this, depending on
|
||||
qof_init(); /* You may or may not need this, depending on
|
||||
* whether the module you're testing or any
|
||||
* dependencies use GObject. */
|
||||
g_test_init ( &argc, &argv, NULL ); /* initialize test program */
|
||||
qof_log_init_filename_special("/dev/null"); /* Initialize the
|
||||
* gnucash logging system. Your tests will
|
||||
* crash on the first logging call otherwise */
|
||||
g_test_init ( &argc, &argv, NULL ); /* initialize test program */
|
||||
test_suite_module1(); /* Call each suite assembly function */
|
||||
test_suite_module2();
|
||||
test_suite_module3();
|
||||
|
Loading…
Reference in New Issue
Block a user