mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
gnc-module test updates
- move test modules into a subdirectory on Windows as well - move the futuremod module into its own subdirectory to avoid its load warnings each time gnc_module_init is called That also tends to happen when building guile modules. - remove the log handlers filtering out the futuremodsys warnings They didn't match the actual warning signature anyway and they're no longer emitted during testing
This commit is contained in:
@@ -30,6 +30,7 @@ gnc_add_test(test-modsysver
|
||||
test-modsysver.c
|
||||
GNC_MODULE_TEST_INCLUDE_DIRS
|
||||
GNC_MODULE_TEST_LIBS
|
||||
"GNC_MODULE_PATH=${LIBDIR_BUILD}/gnucash/test/future"
|
||||
)
|
||||
gnc_add_test(test-incompatdep
|
||||
test-incompatdep.c
|
||||
|
||||
@@ -13,9 +13,14 @@ target_link_libraries(gncmod-futuremodsys ${GLIB2_LDFLAGS})
|
||||
add_library(gncmod-incompatdep EXCLUDE_FROM_ALL incompatdep.c)
|
||||
target_link_libraries(gncmod-incompatdep gnc-module ${GLIB2_LDFLAGS})
|
||||
|
||||
set_target_properties(gncmod-agedver gncmod-futuremodsys gncmod-incompatdep PROPERTIES
|
||||
set_target_properties(gncmod-agedver gncmod-incompatdep PROPERTIES
|
||||
LIBRARY_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/test)
|
||||
|
||||
set_target_properties(gncmod-futuremodsys PROPERTIES
|
||||
LIBRARY_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test/future
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test/future
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/test/future)
|
||||
|
||||
set_dist_list(misc_mods_DIST CMakeLists.txt agedver.c futuremodsys.c incompatdep.c)
|
||||
|
||||
@@ -16,6 +16,6 @@ target_include_directories(gncmod-ordinary PRIVATE
|
||||
set_target_properties(ordinary gncmod-ordinary PROPERTIES
|
||||
LIBRARY_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/test)
|
||||
|
||||
set_dist_list(mod_ordinary_DIST CMakeLists.txt ordinary.c ordinary.h gnc-mod-ordinary.c)
|
||||
|
||||
@@ -22,6 +22,6 @@ target_include_directories(gncmod-withdep PRIVATE
|
||||
set_target_properties(withdep gncmod-withdep PROPERTIES
|
||||
LIBRARY_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/test)
|
||||
|
||||
set_dist_list(mod_withdep_DIST CMakeLists.txt withdep.c withdep.h gnc-mod-withdep.c)
|
||||
|
||||
@@ -29,12 +29,6 @@ int
|
||||
main(int argc, char ** argv)
|
||||
{
|
||||
GNCModule testmod;
|
||||
gchar *msg = "Module '../../../libgnucash/gnc-module/test/misc-mods/.libs/libgncmod_futuremodsys.so' requires newer module system\n";
|
||||
gchar *logdomain = "gnc.module";
|
||||
guint loglevel = G_LOG_LEVEL_WARNING;
|
||||
TestErrorStruct check = { loglevel, logdomain, msg };
|
||||
g_log_set_handler (logdomain, loglevel,
|
||||
(GLogFunc)test_checked_handler, &check);
|
||||
g_test_message(" test-agedver.c: asking for an old but supported interface ...");
|
||||
|
||||
gnc_module_system_init();
|
||||
|
||||
@@ -35,14 +35,8 @@ int
|
||||
main(int argc, char ** argv)
|
||||
{
|
||||
GModule *gmodule;
|
||||
gchar *msg = "Module '../../../libgnucash/gnc-module/test/misc-mods/.libs/libgncmod_futuremodsys.so' requires newer module system\n";
|
||||
gchar *logdomain = "gnc.module";
|
||||
gchar *modpath;
|
||||
guint loglevel = G_LOG_LEVEL_WARNING;
|
||||
const char *libdir = g_getenv("LIBDIR");
|
||||
TestErrorStruct check = { loglevel, logdomain, msg };
|
||||
g_log_set_handler (logdomain, loglevel,
|
||||
(GLogFunc)test_checked_handler, &check);
|
||||
|
||||
if (libdir == NULL)
|
||||
{
|
||||
|
||||
@@ -29,14 +29,11 @@ int
|
||||
main(int argc, char ** argv)
|
||||
{
|
||||
GNCModule foo;
|
||||
gchar *msg1 = "Module '../../../libgnucash/gnc-module/test/misc-mods/.libs/libgncmod_futuremodsys.so' requires newer module system\n";
|
||||
gchar *msg2 = "Could not locate module gnucash/incompatdep interface v.0";
|
||||
gchar *msg = "Could not locate module gnucash/incompatdep 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);
|
||||
TestErrorStruct check = { loglevel, logdomain, msg };
|
||||
test_add_error (&check);
|
||||
g_log_set_handler (logdomain, loglevel,
|
||||
(GLogFunc)test_list_handler, NULL);
|
||||
|
||||
|
||||
@@ -32,12 +32,6 @@ main(int argc, char ** argv)
|
||||
{
|
||||
gint retval = 0;
|
||||
GNCModule testmod;
|
||||
gchar *msg = "Module '../../../libgnucash/gnc-module/test/misc-mods/.libs/libgncmod-futuremodsys.so' requires newer module system\n";
|
||||
gchar *logdomain = "gnc.module";
|
||||
guint loglevel = G_LOG_LEVEL_WARNING;
|
||||
TestErrorStruct check = { loglevel, logdomain, msg };
|
||||
g_log_set_handler (logdomain, loglevel,
|
||||
(GLogFunc)test_checked_handler, &check);
|
||||
|
||||
gnc_module_system_init();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user