Beispiel #1
0
static void
gnc_log_init()
{
    if (log_to_filename != NULL)
    {
        qof_log_init_filename_special(log_to_filename);
    }
    else
    {
        /* initialize logging to our file. */
        gchar *tracefilename;
        tracefilename = g_build_filename(g_get_tmp_dir(), "gnucash.trace",
                                         (gchar *)NULL);
        qof_log_init_filename(tracefilename);
        g_free(tracefilename);
    }

    // set a reasonable default.
    qof_log_set_default(QOF_LOG_WARNING);

    gnc_log_default();

    if (gnc_is_debugging())
    {
        qof_log_set_level("", QOF_LOG_INFO);
        qof_log_set_level("qof", QOF_LOG_INFO);
        qof_log_set_level("gnc", QOF_LOG_INFO);
    }

    {
        gchar *log_config_filename;
        log_config_filename = gnc_build_dotgnucash_path("log.conf");
        if (g_file_test(log_config_filename, G_FILE_TEST_EXISTS))
            qof_log_parse_log_config(log_config_filename);
        g_free(log_config_filename);
    }

    if (log_flags != NULL)
    {
        int i = 0;
        for (; log_flags[i] != NULL; i++)
        {
            QofLogLevel level;
            gchar **parts = NULL;

            gchar *log_opt = log_flags[i];
            parts = g_strsplit(log_opt, "=", 2);
            if (parts == NULL || parts[0] == NULL || parts[1] == NULL)
            {
                g_warning("string [%s] not parseable", log_opt);
                continue;
            }

            level = qof_log_level_from_string(parts[1]);
            qof_log_set_level(parts[0], level);
            g_strfreev(parts);
        }
    }
}
Beispiel #2
0
int
main (int   argc,
      char *argv[])
{
    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 ();

    return g_test_run( );
}
int
main (int   argc,
      char* argv[])
{
    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 */
    cashobjects_register ();
    g_assert (qof_load_backend_library ("../.libs/", GNC_LIB_NAME));
    g_assert (qof_load_backend_library ("../../xml/.libs",
                                        "gncmod-backend-xml"));

    test_suite_gnc_backend_dbi ();

    return g_test_run ();
}
Beispiel #4
0
int
main (int   argc,
      char *argv[])
{
    qof_init();     /* You may or may not need this, depending on
			* whether the module you're testing or any
			* dependencies use GObject. */
    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();
    test_suite_module4();

    return g_test_run();           /* Run the result */
}
Beispiel #5
0
int
main (int   argc,
      char *argv[])
{
    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 */

    test_suite_gnc_guid();
    test_suite_qofbook();
    test_suite_qofinstance();
    test_suite_kvp_frame();
    test_suite_qofobject();
    test_suite_qofsession();
    test_suite_gnc_date();
    test_suite_qof_string_cache();

    return g_test_run( );
}
Beispiel #6
0
int
main (int   argc,
      char *argv[])
{
    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 */
    /* Disable the transaction log */
    xaccLogDisable();

    test_suite_account();
    test_suite_budget();
    test_suite_gncEntry();
    test_suite_gncInvoice();
    test_suite_transaction();
    test_suite_split();
    test_suite_engine_kvp_properties ();

    return g_test_run( );
}