Files
gnucash/src/gnc-module/test/test-modsysver.c
T
John Ralls 6d32b6f693 [Testing] Separate unit test functions from make check functions.
I'd originally put the functions supporting log detection, qof event handling, and mock-counting in test-stuff along with the functions that support the older "make check" integration tests. There are now more unit test support functions than there are of the older functions, so it's time for them to move out on their own.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22132 57a11ea4-9604-0410-9ed3-97b8803252fd
2012-04-03 21:35:19 +00:00

49 lines
1.2 KiB
C

#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <libguile.h>
#include <unittest-support.h>
#include "gnc-module.h"
static void
guile_main(void *closure, int argc, char ** argv)
{
GNCModule foo;
gchar *msg1 = "Module '../../../src/gnc-module/test/misc-mods/.libs/libgncmod_futuremodsys.so' requires newer module system\n";
gchar *msg2 = "Could not locate module gnucash/futuremodsys interface v.0";
gchar *logdomain = "gnc.module";
guint loglevel = G_LOG_LEVEL_WARNING;
TestErrorStruct check1 = { loglevel, logdomain, msg1 };
TestErrorStruct check2 = { loglevel, logdomain, msg2 };
test_add_error (&check1);
test_add_error (&check2);
g_log_set_handler (logdomain, loglevel,
(GLogFunc)test_list_handler, NULL);
g_test_message(" test-modsysver.c: checking for a module we shouldn't find ...\n");
gnc_module_system_init();
foo = gnc_module_load("gnucash/futuremodsys", 0);
if (!foo)
{
printf(" ok\n");
exit(0);
}
else
{
printf(" oops! loaded incompatible module\n");
exit(-1);
}
test_clear_error_list ();
}
int
main(int argc, char ** argv)
{
scm_boot_guile(argc, argv, guile_main, NULL);
return 0;
}