From 56f1e28e361585420af7ebb04bdb5bd73b41f9e2 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Tue, 18 Jan 2011 18:16:58 +0000 Subject: [PATCH] Minor fixes to g_test: Adjust MODULEPATH so that the boundary path delimiters go at invocation; add DEFAULT_INCLUDES to the test_foo_CFLAGS; include the required NULL third arg to g_test_init() git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20121 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/libqof/qof/test/test-qof.c | 2 +- test-templates/Makefile.am | 11 ++++++----- test-templates/test-module.c | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/libqof/qof/test/test-qof.c b/src/libqof/qof/test/test-qof.c index 69f648d334..58de1ae0b6 100644 --- a/src/libqof/qof/test/test-qof.c +++ b/src/libqof/qof/test/test-qof.c @@ -34,7 +34,7 @@ main (int argc, char *argv[]) { g_type_init(); /* Initialize the GObject system */ - g_test_init ( &argc, &argv ); /* initialize test program */ + g_test_init ( &argc, &argv, NULL ); /* initialize test program */ qof_log_init_filename_special("/dev/null"); /* Init the log system */ test_suite_qofbook(); diff --git a/test-templates/Makefile.am b/test-templates/Makefile.am index 1238b787dc..43259f37f5 100644 --- a/test-templates/Makefile.am +++ b/test-templates/Makefile.am @@ -6,7 +6,7 @@ include $(top_srcdir)/test-templates/Makefile.decl #You will only need one of these: It points to the module directory #after $(top_srcdir) or ${top_builddir}: -MODULEPATH = path/to/foo/ +MODULEPATH = path/to/foo #The libtool convenience library to assemble the common test code #(fixture code, setup and teardown routines, mocks, etc.). Use it only @@ -34,15 +34,16 @@ test_foo_SOURCES = \ #etc. test_foo_HEADERSS = \ - $(top_srcdir)${MODULEPATH}module1.h \ - $(top_srcdir)${MODULEPATH}module2.h \ + $(top_srcdir)/${MODULEPATH}/module1.h \ + $(top_srcdir)/${MODULEPATH}/module2.h \ #etc. #The tests might require more libraries, but try to keep them #as independent as possible. -test_foo_LDADD = ${top_buildir}${MODULEPATH}libgnc_foo.la +test_foo_LDADD = ${top_buildir}/${MODULEPATH}/libgnc_foo.la test_foo_CFLAGS = \ - -I$(top_srcdir)${MODULEPATH} \ + ${DEFAULT_INCLUDES} \ + -I$(top_srcdir)/${MODULEPATH}/ \ ${GLIB_CFLAGS} diff --git a/test-templates/test-module.c b/test-templates/test-module.c index 3baa59cdb2..e826ba64e4 100644 --- a/test-templates/test-module.c +++ b/test-templates/test-module.c @@ -37,7 +37,7 @@ main (int argc, g_type_init(); /* You may or may not need this, depending on * whether the module you're testing or any * dependencies use GObject. */ - g_test_init ( &argc, &argv ); /* initialize test program */ + g_test_init ( &argc, &argv, NULL ); /* initialize test program */ qof_log_init_filename_special("/dev/null"); /* Initialize the * gnucash logging system. Your tests will * crash on the first logging call otherwise */