From 886cf5b4e585479e267365027b9f4f5a1cd1807c Mon Sep 17 00:00:00 2001 From: John Ralls Date: Sat, 15 Jan 2011 19:11:42 +0000 Subject: [PATCH] Fix qof/test compilation errors, provide guard for glib_testing. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20107 57a11ea4-9604-0410-9ed3-97b8803252fd --- configure.ac | 12 ++++++++++++ src/libqof/qof/Makefile.am | 6 +++++- src/libqof/qof/test/test-qofbook.c | 1 + src/libqof/qof/test/test-qofinstance.c | 1 + src/libqof/qof/test/test-qofsession.c | 3 ++- 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index cb4cfd9f98..af7736e875 100644 --- a/configure.ac +++ b/configure.ac @@ -200,6 +200,17 @@ else AC_MSG_RESULT(no) fi +AC_MSG_CHECKING([for GLib testing (glib >= 2.16.0)]) +if $PKG_CONFIG 'glib-2.0 >= 2.16.0' +then + AC_MSG_RESULT(yes) + _have_glib_testing=yes +else + AC_MSG_RESULT(no) + _have_glib_testing=no +fi +AM_CONDITIONAL(HAVE_GLIB_TESTING, test "x$_have_glib_testing" = "xyes") + AC_CHECK_HEADERS(dirent.h dlfcn.h dl.h utmp.h locale.h mcheck.h unistd.h wctype.h) # Gnucash replaced dlopen/dlsym by the g_module functions; dlsym @@ -1446,6 +1457,7 @@ AC_CONFIG_FILES( src/import-export/aqbanking/schemas/Makefile src/libqof/Makefile src/libqof/qof/Makefile + src/libqof/qof/test/Makefile src/optional/Makefile src/optional/python-bindings/Makefile src/optional/python-bindings/tests/Makefile diff --git a/src/libqof/qof/Makefile.am b/src/libqof/qof/Makefile.am index e42fff06f0..5503cf8d62 100644 --- a/src/libqof/qof/Makefile.am +++ b/src/libqof/qof/Makefile.am @@ -1,4 +1,8 @@ -#SUBDIRS = test +if HAVE_GLIB_TESTING +SUBDIRS = . test +else +SUBDIRS = . +endif lib_LTLIBRARIES = libgnc-qof.la diff --git a/src/libqof/qof/test/test-qofbook.c b/src/libqof/qof/test/test-qofbook.c index 29877d421a..af1f9e9f56 100644 --- a/src/libqof/qof/test/test-qofbook.c +++ b/src/libqof/qof/test/test-qofbook.c @@ -25,6 +25,7 @@ #include static const gchar *suitename = "/qof/qofbook"; +void test_suite_qofbook ( void ); typedef struct { diff --git a/src/libqof/qof/test/test-qofinstance.c b/src/libqof/qof/test/test-qofinstance.c index b79bdeade3..3aa13e221e 100644 --- a/src/libqof/qof/test/test-qofinstance.c +++ b/src/libqof/qof/test/test-qofinstance.c @@ -24,6 +24,7 @@ #include static const gchar *suitename = "/qof/qofinstance"; +void test_suite_qofinstance ( void ); typedef struct { diff --git a/src/libqof/qof/test/test-qofsession.c b/src/libqof/qof/test/test-qofsession.c index cb7609e46c..2047629845 100644 --- a/src/libqof/qof/test/test-qofsession.c +++ b/src/libqof/qof/test/test-qofsession.c @@ -27,6 +27,7 @@ #include static const gchar *suitename = "/qof/qofsession"; +void test_suite_qofsession ( void ); typedef struct { @@ -69,7 +70,7 @@ test_session_safe_save( Fixture *fixture, gconstpointer pData ) g_assert( NULL == qof_session_get_url( fixture->session )); } -GTestSuite* +void test_suite_qofsession ( void ) { g_test_add( suitename, Fixture, NULL, setup, test_session_safe_save, teardown );