30 #include <sys/types.h>
35 #include "gnc-module.h"
39 #include "io-example-account.h"
41 #include "test-stuff.h"
43 #include "test-file-stuff.h"
45 static const gchar *da_ending =
".gnucash-xea";
48 test_load_file(
const char *filename)
52 gea = gnc_read_example_account(filename);
56 success(
"example account load");
57 gnc_destroy_example_account(gea);
61 failure_args(
"example account load", __FILE__, __LINE__,
"for file %s",
67 guile_main (
void *closure,
int argc,
char **argv)
69 const char *location = g_getenv(
"GNC_ACCOUNT_PATH");
75 location =
"../../../../accounts/C";
78 gnc_module_system_init();
79 gnc_module_load(
"gnucash/engine", 0);
81 if ((ea_dir = g_dir_open(location, 0, NULL)) == NULL)
83 failure(
"unable to open ea directory");
89 while ((entry = g_dir_read_name(ea_dir)) != NULL)
91 if (g_str_has_suffix(entry, da_ending))
93 gchar *to_open = g_build_filename(location, entry, (gchar*)NULL);
94 if (!g_file_test(to_open, G_FILE_TEST_IS_DIR))
96 test_load_file(to_open);
105 list = gnc_load_example_account_list(location);
107 do_test(list != NULL,
"gnc_load_example_account_list");
109 gnc_free_example_account_list(list);
113 print_test_results();
118 main (
int argc,
char ** argv)
120 g_setenv (
"GNC_UNINSTALLED",
"1", TRUE);
121 scm_boot_guile (argc, argv, guile_main, NULL);
api for GnuCash version 2 XML-based file format
All type declarations for the whole Gnucash engine.