Dissolve the business-core module, by integrating its remaining bits in

the engine, where the rest already was moved before.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21605 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Geert Janssens 2011-11-21 10:40:17 +00:00
parent 2e2edc1375
commit 76d820735c
31 changed files with 159 additions and 470 deletions

View File

@ -1336,8 +1336,6 @@ AC_CONFIG_FILES(
src/tax/us/test/Makefile
src/test-core/Makefile
src/business/Makefile
src/business/business-core/Makefile
src/business/business-core/test/Makefile
src/business/business-utils/Makefile
src/business/dialog-tax-table/Makefile
src/business/business-gnome/Makefile

View File

@ -1,5 +1,4 @@
SUBDIRS = \
business-core \
business-utils \
dialog-tax-table \
business-ledger \

View File

@ -1,62 +0,0 @@
SUBDIRS = . test
pkglib_LTLIBRARIES = libgncmod-business-core.la
AM_CPPFLAGS = \
-I${top_srcdir}/src \
-I${top_builddir}/src \
-I${top_srcdir}/src/engine \
-I${top_srcdir}/src/gnc-module \
-I${top_srcdir}/src/libqof/qof \
${GUILE_INCS} \
${GLIB_CFLAGS}
libgncmod_business_core_la_SOURCES = \
gncmod-business-core.c
noinst_HEADERS =
libgncmod_business_core_la_LDFLAGS = -avoid-version
libgncmod_business_core_la_LIBADD = \
${top_builddir}/src/gnc-module/libgnc-module.la \
${top_builddir}/src/engine/libgncmod-engine.la \
${top_builddir}/src/libqof/qof/libgnc-qof.la \
${GUILE_LIBS} \
${GLIB_LIBS} \
${EFENCE_LIBS}
# business-core-helpers.c
gncmoddir = ${GNC_SHAREDIR}/guile-modules/gnucash
gncmod_DATA = business-core.scm
EXTRA_DIST = ${gncmod_DATA}
if GNUCASH_SEPARATE_BUILDDIR
#For executing test cases
SCM_FILE_LINKS = ${gncmod_DATA}
endif
.scm-links:
$(RM) -rf gnucash
mkdir -p gnucash
if GNUCASH_SEPARATE_BUILDDIR
for X in ${SCM_FILE_LINKS} ; do \
$(LN_S) -f ${srcdir}/$$X . ; \
done
endif
( cd gnucash; for A in $(gncmod_DATA) ; do $(LN_S) -f ../$$A . ; done )
if ! OS_WIN32
# Windows knows no "ln -s" but uses "cp": must copy every time (see bug #566567).
touch .scm-links
endif
noinst_DATA = .scm-links
clean-local:
rm -rf gnucash
CLEANFILES = gnucash .scm-links ${SCM_FILE_LINKS}
MAINTAINERCLEANFILES =
INCLUDES = -DG_LOG_DOMAIN=\"gnc.business.core\"

View File

@ -1,84 +0,0 @@
/*********************************************************************
* businessmod-core.c
* module definition/initialization for the core Business module
*
* Copyright (c) 2001 Derek Atkins <warlord@MIT.EDU>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, contact:
*
* Free Software Foundation Voice: +1-617-542-5942
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
* Boston, MA 02110-1301, USA gnu@gnu.org
*
*********************************************************************/
#include "config.h"
#include <gmodule.h>
#include <libguile.h>
#include "gnc-module.h"
#include "gnc-module-api.h"
#include "gncBusiness.h"
GNC_MODULE_API_DECL(libgncmod_business_core)
extern SCM scm_init_sw_business_core_module (void);
/* version of the gnc module system interface we require */
int libgncmod_business_core_gnc_module_system_interface = 0;
/* module versioning uses libtool semantics. */
int libgncmod_business_core_gnc_module_current = 0;
int libgncmod_business_core_gnc_module_revision = 0;
int libgncmod_business_core_gnc_module_age = 0;
char *
libgncmod_business_core_gnc_module_path(void)
{
return g_strdup("gnucash/business-core");
}
char *
libgncmod_business_core_gnc_module_description(void)
{
return g_strdup("The GnuCash business core");
}
int
libgncmod_business_core_gnc_module_init(int refcount)
{
/* load the engine (we depend on it) */
if (!gnc_module_load("gnucash/engine", 0))
{
return FALSE;
}
if (refcount == 0)
{
/* Object initialization already finished in the engine. */
}
scm_init_sw_business_core_module();
scm_c_eval_string("(use-modules (sw_business_core))");
scm_c_eval_string("(use-modules (gnucash business-core))");
return TRUE;
}
int
libgncmod_business_core_gnc_module_end(int refcount)
{
return TRUE;
}

View File

@ -1,55 +0,0 @@
AM_CPPFLAGS = \
-I${top_srcdir}/src \
-I${top_srcdir}/src/gnc-module \
-I${top_srcdir}/src/test-core \
-I${top_srcdir}/src/engine \
-I${top_srcdir}/src/business/business-core \
-I${top_srcdir}/src/libqof/qof \
-I${top_srcdir}/src/backend/xml \
${GUILE_INCS} \
${GLIB_CFLAGS}
LDADD = \
${top_builddir}/src/libqof/qof/libgnc-qof.la \
${top_builddir}/src/gnc-module/libgnc-module.la \
${top_builddir}/src/test-core/libtest-core.la \
${top_builddir}/src/engine/libgncmod-engine.la \
../libgncmod-business-core.la \
${GLIB_LIBS}
TESTS = \
test-load-module \
test-business \
test-address \
test-customer \
test-employee \
test-job \
test-vendor
GNC_TEST_DEPS = \
--gnc-module-dir ${top_builddir}/src/engine \
--gnc-module-dir ${top_builddir}/src/business/business-core \
--guile-load-dir ${top_builddir}/src/gnc-module \
--guile-load-dir ${top_builddir}/src/engine \
--guile-load-dir ${top_builddir}/src/business/business-core \
--library-dir ${top_builddir}/src/libqof/qof \
--library-dir ${top_builddir}/src/core-utils \
--library-dir ${top_builddir}/src/gnc-module \
--library-dir ${top_builddir}/src/engine \
--library-dir ${top_builddir}/src/business/business-core \
--library-dir ${top_builddir}/src/backend/xml
TESTS_ENVIRONMENT = \
$(shell ${top_srcdir}/src/gnc-test-env --no-exports ${GNC_TEST_DEPS})
check_PROGRAMS = \
test-load-module \
test-business \
test-address \
test-customer \
test-employee \
test-job \
test-vendor
EXTRA_DIST =

View File

@ -1,26 +0,0 @@
This directory contains unit test cases for the core business objects.
Notes on test of dirty/clean flag:
---------------------------------
Test cases will fail the test of the 'dirty' flag if a backend
is not set up. That's because the 'dirty' flag is supposed to be
cleared by the backend only.
An object cannot be marked 'clean' unless it has actually
been saved to a file or sql db. (Or, in the case of the file
backend, the 'dirtiness' of the data has been duly noted, and
will be taken care of for the next file save.
Until its saved, it lives in perpetual dirtiness. Thus, the
test cases need to specify a backend, then do the commit,
then test the dirty flag.
Actually, the use of the dirty flag in gnucash is, at this time,
mildly ambiguous, and its semantics are not clearly defined.
TODO
----
Make tests better

View File

@ -1,62 +0,0 @@
/*********************************************************************
* test-load-module.c
*
* Copyright (c) 2001 Derek Atkins <warlord@MIT.EDU>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, contact:
*
* Free Software Foundation Voice: +1-617-542-5942
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
* Boston, MA 02110-1301, USA gnu@gnu.org
*
*********************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <libguile.h>
#include "gnc-module.h"
static void
guile_main (void *closure, int argc, char ** argv)
{
GNCModule module;
printf(" test-load-module.c: loading/unloading business-core module ... ");
gnc_module_system_init();
module = gnc_module_load("gnucash/business-core", 0);
if (!module)
{
printf(" Failed to load engine\n");
exit(-1);
}
if (!gnc_module_unload(module))
{
printf(" Failed to unload engine\n");
exit(-1);
}
printf(" successful.\n");
exit(0);
}
int
main (int argc, char ** argv)
{
scm_boot_guile(argc, argv, guile_main, NULL);
return 0;
}

View File

@ -14,7 +14,6 @@ AM_CPPFLAGS = \
-I${top_srcdir}/src/gnome-search \
-I${top_srcdir}/src/html \
-I${top_srcdir}/src/report/report-gnome \
-I${top_srcdir}/src/business/business-core \
-I${top_srcdir}/src/business/business-ledger \
-I${top_srcdir}/src/business/dialog-tax-table \
-I${top_srcdir}/src/register/register-core \
@ -69,7 +68,6 @@ libgncmod_business_gnome_la_LDFLAGS = -avoid-version
libgncmod_business_gnome_la_LIBADD = \
${top_builddir}/src/gnome/libgnc-gnome.la \
${top_builddir}/src/business/business-core/libgncmod-business-core.la \
${top_builddir}/src/business/business-ledger/libgnc-business-ledger.la \
${top_builddir}/src/business/dialog-tax-table/libgncmod-dialog-tax-table.la \
${top_builddir}/src/register/register-core/libgncmod-register-core.la \

View File

@ -2,7 +2,6 @@
(use-modules (gnucash gnc-module))
(gnc:module-load "gnucash/gnome-utils" 0)
(gnc:module-load "gnucash/business-core" 0)
(gnc:module-load "gnucash/business-utils" 0)
(gnc:module-load "gnucash/gnome-search" 0)
(gnc:module-load "gnucash/dialog-tax-table" 0)

View File

@ -75,16 +75,12 @@ libgncmod_business_gnome_gnc_module_description(void)
int
libgncmod_business_gnome_gnc_module_init(int refcount)
{
/* load business-core: we depend on it -- and it depends on the engine */
if (!gnc_module_load ("gnucash/business-core", 0))
{
return FALSE;
}
/* We also depend on app-utils, gnome-utils, and gnome-search modules */
/* load app-utils: we depend on it -- and it depends on the engine */
if (!gnc_module_load ("gnucash/app-utils", 0))
{
return FALSE;
}
/* We also depend on gnome-utils and gnome-search modules */
if (!gnc_module_load ("gnucash/gnome-utils", 0))
{
return FALSE;
@ -97,32 +93,10 @@ libgncmod_business_gnome_gnc_module_init(int refcount)
{
return FALSE;
}
// if (!libgncmod_business_gnome_gnc_module_load ("gnucash/report/standard-reports", 0)) {
// return FALSE;
// }
scm_c_eval_string("(use-modules (gnucash business-gnome))");
scm_c_eval_string("(use-modules (gnucash report business-reports))");
// temp code until gnc:url-type is wrapped
/*
{
SCM wct_gnc_url_type = scm_c_eval_string("<gnc:url-type>");
SCM tmp;
tmp = gw_wcp_assimilate_ptr(GNC_CUSTOMER_MODULE_NAME, wct_gnc_url_type);
scm_c_define("gnc:url-type-customer", tmp);
tmp = gw_wcp_assimilate_ptr(GNC_VENDOR_MODULE_NAME, wct_gnc_url_type);
scm_c_define("gnc:url-type-vendor", tmp);
tmp = gw_wcp_assimilate_ptr(GNC_EMPLOYEE_MODULE_NAME, wct_gnc_url_type);
scm_c_define("gnc:url-type-employee", tmp);
tmp = gw_wcp_assimilate_ptr(GNC_INVOICE_MODULE_NAME, wct_gnc_url_type);
scm_c_define("gnc:url-type-invoice", tmp);
tmp = gw_wcp_assimilate_ptr(URL_TYPE_OWNERREPORT, wct_gnc_url_type);
scm_c_define("gnc:url-type-ownerreport", tmp);
}
*/
if (refcount == 0)
{
/* Register the Owner search type */

View File

@ -18,7 +18,6 @@ noinst_HEADERS = \
gncEntryLedgerModel.h
libgnc_business_ledger_la_LIBADD = \
${top_builddir}/src/business/business-core/libgncmod-business-core.la \
${top_builddir}/src/business/business-utils/libgncmod-business-utils.la \
${top_builddir}/src/business/dialog-tax-table/libgncmod-dialog-tax-table.la \
${top_builddir}/src/register/register-core/libgncmod-register-core.la \
@ -33,7 +32,6 @@ libgnc_business_ledger_la_LIBADD = \
${GLIB_LIBS}
AM_CPPFLAGS = \
-I${top_srcdir}/src/business/business-core \
-I${top_srcdir}/src/business/business-utils \
-I${top_srcdir}/src/business/dialog-tax-table \
-I${top_srcdir}/src \

View File

@ -2,7 +2,6 @@
(use-modules (gnucash gnc-module))
(gnc:module-load "gnucash/app-utils" 0)
(gnc:module-load "gnucash/business-core" 0)
(define gnc:*business-label* (N_ "Business"))
(define gnc:*company-name* (N_ "Company Name"))

View File

@ -55,12 +55,6 @@ libgncmod_business_utils_gnc_module_description(void)
int
libgncmod_business_utils_gnc_module_init(int refcount)
{
/* load the business-core (we depend on it) */
if (!gnc_module_load("gnucash/business-core", 0))
{
return FALSE;
}
/* Load the application utils.. */
if (!gnc_module_load("gnucash/app-utils", 0))
{

View File

@ -7,7 +7,6 @@ AM_CPPFLAGS = \
-I${top_srcdir}/src/gnc-module \
-I${top_srcdir}/src/gnome-utils \
-I${top_srcdir}/src/app-utils \
-I${top_srcdir}/src/business/business-core \
-I${top_srcdir}/src/libqof/qof \
${GNOME_CFLAGS} \
${GLADE_CFLAGS} \
@ -25,7 +24,6 @@ noinst_HEADERS = \
libgncmod_dialog_tax_table_la_LDFLAGS = -avoid-version
libgncmod_dialog_tax_table_la_LIBADD = \
${top_builddir}/src/business/business-core/libgncmod-business-core.la \
${top_builddir}/src/gnome-utils/libgncmod-gnome-utils.la \
${top_builddir}/src/app-utils/libgncmod-app-utils.la \
${top_builddir}/src/engine/libgncmod-engine.la \

View File

@ -56,16 +56,12 @@ libgncmod_dialog_tax_table_gnc_module_description(void)
int
libgncmod_dialog_tax_table_gnc_module_init(int refcount)
{
/* load business-core: we depend on it -- and it depends on the engine */
if (!gnc_module_load ("gnucash/business-core", 0))
{
return FALSE;
}
/* We also depend on app-utils and gnome-utils modules */
/* load app-utils: we depend on it -- and it depends on the engine */
if (!gnc_module_load ("gnucash/app-utils", 0))
{
return FALSE;
}
/* We also depend on the gnome-utils module */
if (!gnc_module_load ("gnucash/gnome-utils", 0))
{
return FALSE;

View File

@ -42,7 +42,6 @@ libgncmod_engine_la_SOURCES = \
engine-helpers.c \
glib-helpers.c \
policy.c \
swig-business-core.c \
gncBusGuile.c \
gncBusiness.c \
gncAddress.c \
@ -143,7 +142,8 @@ libgncmod_engine_la_LIBADD = \
${top_builddir}/lib/libc/libc-missing.la
gncmoddir = ${GNC_SHAREDIR}/guile-modules/gnucash
gncmod_DATA = engine.scm
gncmod_DATA = engine.scm \
business-core.scm
gncscmdir = ${GNC_SHAREDIR}/scm
gncscm_DATA = \
@ -195,10 +195,6 @@ swig-engine.c: engine.i $(top_srcdir)/src/base-typemaps.i \
$(gncinclude_HEADERS) $(noinst_HEADERS)
$(SWIG) -guile $(SWIG_ARGS) -Linkage module \
-I${top_srcdir}/src/libqof/qof -I${top_srcdir}/src -o $@ $<
swig-business-core.c: business-core.i $(top_srcdir)/src/base-typemaps.i \
$(gncinclude_HEADERS) $(noinst_HEADERS)
$(SWIG) -guile $(SWIG_ARGS) -Linkage module \
-I${top_srcdir}/src -o $@ $<
endif
iso-4217-currencies.c: iso-4217-currencies.scm iso-currencies-to-c
@ -209,7 +205,7 @@ BUILT_SOURCES = iso-4217-currencies.c
CLEANFILES = $(BUILT_SOURCES) .scm-links \
${SCM_FILE_LINKS}
MAINTAINERCLEANFILES = swig-engine.c swig-business-core.c
MAINTAINERCLEANFILES = swig-engine.c
clean-local:
rm -rf gnucash

View File

@ -1,30 +1,5 @@
%module sw_business_core
%{
/* Includes the header in the wrapper code */
#include <config.h>
#include <gncAddress.h>
#include <gncBillTerm.h>
#include <gncCustomer.h>
#include <gncEmployee.h>
#include <gncEntry.h>
#include <gncInvoice.h>
#include <gncJob.h>
#include <gncOrder.h>
#include <gncOwner.h>
#include <gncTaxTable.h>
#include <gncVendor.h>
%}
#if defined(SWIGGUILE)
%{
#include <guile-mappings.h>
#include <gncBusGuile.h>
#ifdef _MSC_VER
# define snprintf _snprintf
#endif
#include "engine-helpers.h"
#include "gncBusGuile.h"
/* Disable -Waddress. GCC 4.2 warns (and fails to compile with -Werror) when
* passing the address of a guid on the stack to QOF_BOOK_LOOKUP_ENTITY via
* gncInvoiceLookup and friends. When the macro gets inlined, the compiler
@ -33,13 +8,9 @@
#if (__GNUC__ >= 4 && __GNUC_MINOR__ >= 2)
# pragma GCC diagnostic warning "-Waddress"
#endif
SCM scm_init_sw_business_core_module (void);
%}
#endif
%import "base-typemaps.i"
%rename(gncOwnerReturnGUID) gncOwnerRetGUID;
%inline %{

View File

@ -1,5 +1,4 @@
(define-module (gnucash business-core))
(use-modules (sw_business_core))
(use-modules (gnucash gnc-module))
(gnc:module-load "gnucash/engine" 0)

View File

@ -18,6 +18,19 @@
#include "kvp-scm.h"
#include "glib-helpers.h"
#include "gncAddress.h"
#include "gncBillTerm.h"
#include "gncCustomer.h"
#include "gncEmployee.h"
#include "gncEntry.h"
#include "gncInvoice.h"
#include "gncJob.h"
#include "gncOrder.h"
#include "gncOwner.h"
#include "gncTaxTable.h"
#include "gncVendor.h"
#include "gncBusGuile.h"
SCM scm_init_sw_engine_module (void);
%}
@ -294,3 +307,5 @@ KvpValue * kvp_frame_get_slot_path_gslist (KvpFrame *frame, GSList *key_path);
}
#endif
%include business-core.i

View File

@ -49,6 +49,7 @@ libgncmod_engine_gnc_module_init(int refcount)
scm_init_sw_engine_module();
scm_c_eval_string("(use-modules (sw_engine))");
scm_c_eval_string("(use-modules (gnucash engine))");
scm_c_eval_string("(use-modules (gnucash business-core))");
return TRUE;
}

View File

@ -44,7 +44,13 @@ TESTS = \
test-transaction-reversal \
test-transaction-voiding \
test-recurrence \
test-scm-query
test-scm-query \
test-business \
test-address \
test-customer \
test-employee \
test-job \
test-vendor
GNC_TEST_DEPS = \
--gnc-module-dir ${top_builddir}/src/engine \
@ -76,7 +82,13 @@ check_PROGRAMS = \
test-scm-query \
test-split-vs-account \
test-transaction-reversal \
test-transaction-voiding
test-transaction-voiding \
test-business \
test-address \
test-customer \
test-employee \
test-job \
test-vendor
test_link_SOURCES = test-link.c

View File

@ -1,7 +1,41 @@
This directory contains unit test cases to excercise basic
This directory contains unit test cases to exercise basic
GnuCash engine functions.
To run the tests, just do 'make check'
Notes on test of dirty/clean flag:
---------------------------------
This test is currently performed in part in
test-customer
test-employee
test-job
test-vendor
The test cases will check if the dirty flag is unset on creation
of an object and if the dirty flag is set when the object
is modified.
There used to be a test also to check if the dirty flag is
cleared again upon committing the change.
This test has been removed, because it can only be successful
if a backend is set up. That's because the 'dirty' flag is
supposed to be cleared by the backend only.
We are in the engine test code however. In here it's not possible
to load a backend without creating some circular dependencies
between gnucash modules.
Just for completeness, this was said on the dirty flag tests before
these test cases got moved to the engine:
"An object cannot be marked 'clean' unless it has actually
been saved to a file or sql db. (Or, in the case of the file
backend, the 'dirtiness' of the data has been duly noted, and
will be taken care of for the next file save.
Until its saved, it lives in perpetual dirtiness. Thus, the
test cases need to specify a backend, then do the commit,
then test the dirty flag.
Actually, the use of the dirty flag in gnucash is, at this time,
mildly ambiguous, and its semantics are not clearly defined."

View File

@ -123,7 +123,7 @@ test_printable (const char *name, gpointer obj)
static void
main_helper (void *closure, int argc, char **argv)
{
gnc_module_load("gnucash/business-core", 0);
gnc_module_load("gnucash/engine", 0);
test_business();
print_test_results();
exit(get_rv());

View File

@ -33,11 +33,6 @@
#include "gncJobP.h"
#include "test-stuff.h"
#include "gnc-backend-xml.h"
#define FILE_NAME "xml:///tmp/testbook.gnucash"
#define GNC_LIB_NAME "gncmod-backend-xml"
static int count = 0;
static void
@ -58,21 +53,10 @@ test_bool_fcn (QofBook *book, const char *message,
static void
test_customer (void)
{
QofBackend *be;
QofSession *session;
QofBook *book;
GncCustomer *customer;
session = qof_session_new();
be = NULL;
qof_session_begin(session, FILE_NAME, FALSE, FALSE, FALSE);
book = qof_session_get_book(session);
be = qof_book_get_backend(book);
/* The book *must* have a backend to pass the test of the 'dirty' flag
so use a session to use the default XML. However, until the SQL backend can be used,
entities remain dirty until the session is saved or closed. */
do_test (be != NULL, "xml backend could not be set");
book = qof_book_new ();
/* Test creation/destruction */
{
@ -147,7 +131,7 @@ test_customer (void)
}
/* Note: JobList is tested from the Job tests */
qof_session_end(session);
qof_book_destroy (book);
}
static void
@ -165,7 +149,11 @@ test_string_fcn (QofBook *book, const char *message,
do_test (gncCustomerIsDirty (customer), "test dirty later");
gncCustomerCommitEdit (customer);
/* Customer record should be not dirty */
do_test (!gncCustomerIsDirty (customer), "test dirty after commit");
/* Skip, because will always fail without a backend.
* It's not possible to load a backend in the engine code
* without having circular dependencies.
*/
// do_test (!gncCustomerIsDirty (customer), "test dirty after commit");
do_test (safe_strcmp (get (customer), str) == 0, message);
gncCustomerSetActive (customer, FALSE);
count++;
@ -186,7 +174,11 @@ test_numeric_fcn (QofBook *book, const char *message,
do_test (gncCustomerIsDirty (customer), "test dirty later");
gncCustomerCommitEdit (customer);
/* Customer record should be not dirty */
do_test (!gncCustomerIsDirty (customer), "test dirty after commit");
/* Skip, because will always fail without a backend.
* It's not possible to load a backend in the engine code
* without having circular dependencies.
*/
// do_test (!gncCustomerIsDirty (customer), "test dirty after commit");
do_test (gnc_numeric_equal (get (customer), num), message);
gncCustomerSetActive (customer, FALSE);
count++;
@ -209,7 +201,11 @@ test_bool_fcn (QofBook *book, const char *message,
do_test (gncCustomerIsDirty (customer), "test dirty later");
gncCustomerCommitEdit (customer);
/* Customer record should be not dirty */
do_test (!gncCustomerIsDirty (customer), "test dirty after commit");
/* Skip, because will always fail without a backend.
* It's not possible to load a backend in the engine code
* without having circular dependencies.
*/
// do_test (!gncCustomerIsDirty (customer), "test dirty after commit");
do_test (get (customer) == num, message);
gncCustomerSetActive (customer, FALSE);
count++;
@ -219,7 +215,6 @@ int
main (int argc, char **argv)
{
qof_init();
qof_load_backend_library ("../../../backend/xml/.libs/", GNC_LIB_NAME);
do_test (cashobjects_register(), "Cannot register cash objects");
/* These three registrations are done during cashobjects_register,
so trying to register them again naturally fails. */

View File

@ -33,11 +33,6 @@
#include "gncInvoiceP.h"
#include "test-stuff.h"
#include "gnc-backend-xml.h"
#define FILE_NAME "xml:///tmp/testbook.gnucash"
#define GNC_LIB_NAME "gncmod-backend-xml"
static int count = 0;
static void
@ -65,19 +60,10 @@ test_gint_fcn (QofBook *book, const char *message,
static void
test_employee (void)
{
QofBackend *be;
QofBook *book;
QofSession *session;
GncEmployee *employee;
session = qof_session_new();
qof_session_begin(session, FILE_NAME, FALSE, FALSE, FALSE);
book = qof_session_get_book(session);
be = qof_book_get_backend (book);
/* The book *must* have a backend to pass the test of the 'dirty' flag */
/* See the README file for details */
do_test (be != NULL, "xml backend could not be set");
book = qof_book_new();
/* Test creation/destruction */
{
@ -138,6 +124,8 @@ test_employee (void)
do_test (res != NULL, "Printable NULL?");
do_test (safe_strcmp (str, res) == 0, "Printable equals");
}
qof_book_destroy (book);
}
static void
@ -155,7 +143,11 @@ test_string_fcn (QofBook *book, const char *message,
do_test (gncEmployeeIsDirty (employee), "test dirty later");
gncEmployeeCommitEdit (employee);
/* Employee record should be not dirty */
do_test (!gncEmployeeIsDirty (employee), "test dirty after commit");
/* Skip, because will always fail without a backend.
* It's not possible to load a backend in the engine code
* without having circular dependencies.
*/
// do_test (!gncEmployeeIsDirty (employee), "test dirty after commit");
do_test (safe_strcmp (get (employee), str) == 0, message);
gncEmployeeSetActive (employee, FALSE);
count++;
@ -176,7 +168,11 @@ test_numeric_fcn (QofBook *book, const char *message,
do_test (gncEmployeeIsDirty (employee), "test dirty later");
gncEmployeeCommitEdit (employee);
/* Employee record should be not dirty */
do_test (!gncEmployeeIsDirty (employee), "test dirty after commit");
/* Skip, because will always fail without a backend.
* It's not possible to load a backend in the engine code
* without having circular dependencies.
*/
// do_test (!gncEmployeeIsDirty (employee), "test dirty after commit");
do_test (gnc_numeric_equal (get (employee), num), message);
gncEmployeeSetActive (employee, FALSE);
count++;
@ -199,7 +195,11 @@ test_bool_fcn (QofBook *book, const char *message,
do_test (gncEmployeeIsDirty (employee), "test dirty later");
gncEmployeeCommitEdit (employee);
/* Employee record should be not dirty */
do_test (!gncEmployeeIsDirty (employee), "test dirty after commit");
/* Skip, because will always fail without a backend.
* It's not possible to load a backend in the engine code
* without having circular dependencies.
*/
// do_test (!gncEmployeeIsDirty (employee), "test dirty after commit");
do_test (get (employee) == num, message);
gncEmployeeSetActive (employee, FALSE);
count++;
@ -221,7 +221,11 @@ test_gint_fcn (QofBook *book, const char *message,
do_test (gncEmployeeIsDirty (employee), "test dirty later");
gncEmployeeCommitEdit (employee);
/* Employee record should be not dirty */
do_test (!gncEmployeeIsDirty (employee), "test dirty after commit");
/* Skip, because will always fail without a backend.
* It's not possible to load a backend in the engine code
* without having circular dependencies.
*/
// do_test (!gncEmployeeIsDirty (employee), "test dirty after commit");
do_test (get (employee) == num, message);
gncEmployeeSetActive (employee, FALSE);
count++;
@ -232,7 +236,6 @@ int
main (int argc, char **argv)
{
qof_init();
qof_load_backend_library ("../../../backend/xml/.libs/", GNC_LIB_NAME);
do_test (gncInvoiceRegister(), "Cannot register GncInvoice");
do_test (gncJobRegister (), "Cannot register GncJob");
do_test (gncCustomerRegister(), "Cannot register GncCustomer");

View File

@ -33,11 +33,6 @@
#include "gncOwner.h"
#include "test-stuff.h"
#include "gnc-backend-xml.h"
#define FILE_NAME "xml:///tmp/testbook.gnucash"
#define GNC_LIB_NAME "gncmod-backend-xml"
static int count = 0;
static void
@ -67,20 +62,10 @@ test_gint_fcn (QofBook *book, const char *message,
static void
test_job (void)
{
QofBackend *be;
QofSession *session;
QofBook *book;
GncJob *job;
session = qof_session_new();
be = NULL;
qof_session_begin(session, FILE_NAME, FALSE, FALSE, FALSE);
book = qof_session_get_book (session);
be = qof_book_get_backend(book);
/* The book *must* have a backend to pass the test of the 'dirty' flag */
/* See the README file for details */
do_test (be != NULL, "xml backend could not be set");
book = qof_book_new();
/* Test creation/destruction */
{
@ -158,6 +143,8 @@ test_job (void)
list = gncCustomerGetJoblist (cust, TRUE);
do_test (list == NULL, "no more jobs");
}
qof_book_destroy (book);
}
static void
@ -175,7 +162,11 @@ test_string_fcn (QofBook *book, const char *message,
do_test (qof_instance_is_dirty (QOF_INSTANCE(job)), "test dirty later");
gncJobCommitEdit (job);
/* Job record should be not dirty */
do_test (!qof_instance_is_dirty (QOF_INSTANCE(job)), "test dirty after commit");
/* Skip, because will always fail without a backend.
* It's not possible to load a backend in the engine code
* without having circular dependencies.
*/
// do_test (!qof_instance_is_dirty (QOF_INSTANCE(job)), "test dirty after commit");
do_test (safe_strcmp (get (job), str) == 0, message);
gncJobSetActive (job, FALSE);
count++;
@ -197,7 +188,11 @@ test_numeric_fcn (QofBook *book, const char *message,
do_test (qof_instance_is_dirty (QOF_INSTANCE(job)), "test dirty later");
gncJobCommitEdit (job);
/* Job record should be not dirty */
do_test (!qof_instance_is_dirty (QOF_INSTANCE(job)), "test dirty after commit");
/* Skip, because will always fail without a backend.
* It's not possible to load a backend in the engine code
* without having circular dependencies.
*/
// do_test (!qof_instance_is_dirty (QOF_INSTANCE(job)), "test dirty after commit");
do_test (gnc_numeric_equal (get (job), num), message);
gncJobSetActive (job, FALSE);
count++;
@ -221,7 +216,11 @@ test_bool_fcn (QofBook *book, const char *message,
do_test (qof_instance_is_dirty (QOF_INSTANCE(job)), "test dirty later");
gncJobCommitEdit (job);
/* Job record should be not dirty */
do_test (!qof_instance_is_dirty (QOF_INSTANCE(job)), "test dirty after commit");
/* Skip, because will always fail without a backend.
* It's not possible to load a backend in the engine code
* without having circular dependencies.
*/
// do_test (!qof_instance_is_dirty (QOF_INSTANCE(job)), "test dirty after commit");
do_test (get (job) == num, message);
gncJobSetActive (job, FALSE);
count++;
@ -243,7 +242,11 @@ test_gint_fcn (QofBook *book, const char *message,
do_test (qof_instance_is_dirty (QOF_INSTANCE(job)), "test dirty later");
gncJobCommitEdit (job);
/* Job record should be not dirty */
do_test (!qof_instance_is_dirty (QOF_INSTANCE(job)), "test dirty after commit");
/* Skip, because will always fail without a backend.
* It's not possible to load a backend in the engine code
* without having circular dependencies.
*/
// do_test (!qof_instance_is_dirty (QOF_INSTANCE(job)), "test dirty after commit");
do_test (get (job) == num, message);
gncJobSetActive (job, FALSE);
count++;
@ -254,7 +257,6 @@ int
main (int argc, char **argv)
{
qof_init();
qof_load_backend_library ("../../../backend/xml/.libs/", GNC_LIB_NAME);
do_test (gncInvoiceRegister(), "Cannot register GncInvoice");
do_test (gncJobRegister (), "Cannot register GncJob");
do_test (gncCustomerRegister(), "Cannot register GncCustomer");

View File

@ -32,11 +32,6 @@
#include "gncVendorP.h"
#include "test-stuff.h"
#include "gnc-backend-xml.h"
#define FILE_NAME "xml:///tmp/testbook.gnucash"
#define GNC_LIB_NAME "gncmod-backend-xml"
static int count = 0;
static void
@ -71,15 +66,7 @@ test_vendor (void)
QofBook *book;
GncVendor *vendor;
session = qof_session_new();
be = NULL;
qof_session_begin(session, FILE_NAME, FALSE, FALSE, FALSE);
book = qof_session_get_book (session);
be = qof_book_get_backend(book);
/* The book *must* have a backend to pass the test of the 'dirty' flag */
/* See the README file for details */
do_test (be != NULL, "xml backend could not be set");
book = qof_book_new();
/* Test creation/destruction */
{
@ -137,6 +124,8 @@ test_vendor (void)
do_test (res != NULL, "Printable NULL?");
do_test (safe_strcmp (str, res) == 0, "Printable equals");
}
qof_book_destroy (book);
}
static void
@ -154,7 +143,11 @@ test_string_fcn (QofBook *book, const char *message,
do_test (gncVendorIsDirty (vendor), "test dirty later");
gncVendorCommitEdit (vendor);
/* Vendor record should be not dirty */
do_test (!gncVendorIsDirty (vendor), "test dirty after commit");
/* Skip, because will always fail without a backend.
* It's not possible to load a backend in the engine code
* without having circular dependencies.
*/
// do_test (!gncVendorIsDirty (vendor), "test dirty after commit");
do_test (safe_strcmp (get (vendor), str) == 0, message);
gncVendorSetActive (vendor, FALSE);
count++;
@ -176,7 +169,11 @@ test_numeric_fcn (QofBook *book, const char *message,
do_test (gncVendorIsDirty (vendor), "test dirty later");
gncVendorCommitEdit (vendor);
/* Vendor record should be not dirty */
do_test (!gncVendorIsDirty (vendor), "test dirty after commit");
/* Skip, because will always fail without a backend.
* It's not possible to load a backend in the engine code
* without having circular dependencies.
*/
// do_test (!gncVendorIsDirty (vendor), "test dirty after commit");
do_test (gnc_numeric_equal (get (vendor), num), message);
gncVendorSetActive (vendor, FALSE);
count++;
@ -200,7 +197,11 @@ test_bool_fcn (QofBook *book, const char *message,
do_test (gncVendorIsDirty (vendor), "test dirty later");
gncVendorCommitEdit (vendor);
/* Vendor record should be not dirty */
do_test (!gncVendorIsDirty (vendor), "test dirty after commit");
/* Skip, because will always fail without a backend.
* It's not possible to load a backend in the engine code
* without having circular dependencies.
*/
// do_test (!gncVendorIsDirty (vendor), "test dirty after commit");
do_test (get (vendor) == num, message);
gncVendorSetActive (vendor, FALSE);
count++;
@ -222,7 +223,11 @@ test_gint_fcn (QofBook *book, const char *message,
do_test (gncVendorIsDirty (vendor), "test dirty later");
gncVendorCommitEdit (vendor);
/* Vendor record should be not dirty */
do_test (!gncVendorIsDirty (vendor), "test dirty after commit");
/* Skip, because will always fail without a backend.
* It's not possible to load a backend in the engine code
* without having circular dependencies.
*/
// do_test (!gncVendorIsDirty (vendor), "test dirty after commit");
do_test (get (vendor) == num, message);
gncVendorSetActive (vendor, FALSE);
count++;
@ -233,7 +238,6 @@ int
main (int argc, char **argv)
{
qof_init();
qof_load_backend_library ("../../../backend/xml/.libs/", GNC_LIB_NAME);
do_test (gncInvoiceRegister(), "Cannot register GncInvoice");
do_test (gncJobRegister (), "Cannot register GncJob");
do_test (gncCustomerRegister(), "Cannot register GncCustomer");

View File

@ -21,7 +21,6 @@ _gnucash_core_c_la_CPPFLAGS = \
-I${top_srcdir}/src/libqof/qof \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/engine \
-I$(top_srcdir)/src/business/business-core \
-I${top_srcdir}/src/gnome-utils \
-I${top_srcdir}/src/app-utils \
-I${top_srcdir}/src/gnc-module \
@ -76,7 +75,6 @@ _gnucash_core_c_includes= \
gnucash_core.c: $(SWIG_FILES) ${top_srcdir}/src/base-typemaps.i ${top_srcdir}/src/engine/engine-common.i $(_gnucash_core_c_includes)
swig -python -Wall -Werror \
-I$(top_srcdir)/src -I$(top_srcdir)/src/engine \
-I$(top_srcdir)/src/business/business-core \
-I${top_srcdir}/src/libqof/qof \
-o $@ $<

View File

@ -73,10 +73,6 @@ libgncmod_bi_import_gnc_module_init (int refcount)
{
return FALSE;
}
if (!gnc_module_load ("gnucash/business-core", 0))
{
return FALSE;
}
if (!gnc_module_load ("gnucash/engine", 0))
{
return FALSE;

View File

@ -31,7 +31,6 @@
(use-modules (gnucash gnc-module))
(gnc:module-load "gnucash/report/report-system" 0)
(gnc:module-load "gnucash/business-core" 0)
(use-modules (gnucash report standard-reports))
(use-modules (gnucash report business-reports))