r20121 - gnucash/trunk - 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()

John Ralls jralls at code.gnucash.org
Tue Jan 18 13:16:58 EST 2011


Author: jralls
Date: 2011-01-18 13:16:58 -0500 (Tue, 18 Jan 2011)
New Revision: 20121
Trac: http://svn.gnucash.org/trac/changeset/20121

Modified:
   gnucash/trunk/src/libqof/qof/test/test-qof.c
   gnucash/trunk/test-templates/Makefile.am
   gnucash/trunk/test-templates/test-module.c
Log:
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()

Modified: gnucash/trunk/src/libqof/qof/test/test-qof.c
===================================================================
--- gnucash/trunk/src/libqof/qof/test/test-qof.c	2011-01-18 02:53:32 UTC (rev 20120)
+++ gnucash/trunk/src/libqof/qof/test/test-qof.c	2011-01-18 18:16:58 UTC (rev 20121)
@@ -34,7 +34,7 @@
       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();

Modified: gnucash/trunk/test-templates/Makefile.am
===================================================================
--- gnucash/trunk/test-templates/Makefile.am	2011-01-18 02:53:32 UTC (rev 20120)
+++ gnucash/trunk/test-templates/Makefile.am	2011-01-18 18:16:58 UTC (rev 20121)
@@ -6,7 +6,7 @@
 
 #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 @@
 	#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}

Modified: gnucash/trunk/test-templates/test-module.c
===================================================================
--- gnucash/trunk/test-templates/test-module.c	2011-01-18 02:53:32 UTC (rev 20120)
+++ gnucash/trunk/test-templates/test-module.c	2011-01-18 18:16:58 UTC (rev 20121)
@@ -37,7 +37,7 @@
     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 */



More information about the gnucash-changes mailing list