mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-09-03 20:53:02 -05:00
Fix backend-dbi tests to run from a separate build directory
Include asserts to fail immediately if either the dbi or xml backends fail to load. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22511 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -26,6 +26,7 @@ LDADD = ${top_builddir}/src/test-core/libtest-core.la \
|
||||
${top_builddir}/src/libqof/qof/libgnc-qof.la \
|
||||
../libgncmod-backend-dbi.la \
|
||||
${top_builddir}/src/backend/sql/libgnc-backend-sql.la \
|
||||
${top_builddir}/src/backend/xml/libgnc-backend-xml-utils.la \
|
||||
${top_builddir}/lib/libc/libc-missing.la
|
||||
|
||||
GNC_TEST_DEPS = \
|
||||
@@ -34,13 +35,14 @@ GNC_TEST_DEPS = \
|
||||
--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/engine \
|
||||
--library-dir ${top_builddir}/src/backend/xml
|
||||
|
||||
TESTS_ENVIRONMENT = \
|
||||
GNC_ACCOUNT_PATH=${top_srcdir}/accounts/C \
|
||||
SRCDIR=${srcdir} \
|
||||
${gnc_dbd_dir_override} \
|
||||
$(shell ${top_srcdir}/src/gnc-test-env --no-exports ${GNC_TEST_DEPS})
|
||||
$(shell ${top_srcdir}/src/gnc-test-env ${GNC_TEST_DEPS})
|
||||
|
||||
EXTRA_DIST += \
|
||||
test-dbi-stuff.h \
|
||||
@@ -64,6 +66,9 @@ test_backend_dbi_SOURCES = \
|
||||
test-dbi-business-stuff.c
|
||||
|
||||
test_backend_dbi_LDFLAGS="-ldbi"
|
||||
test_backend_dbi_CPPFLAGS=-DDBI_TEST_XML_FILENAME=\"${srcdir}/test-dbi.xml\"
|
||||
|
||||
|
||||
|
||||
INCLUDES = -DG_LOG_DOMAIN=\"gnc.backend.dbi\"
|
||||
|
||||
|
||||
@@ -41,8 +41,9 @@ main (int argc,
|
||||
g_test_bug_base("https://bugzilla.gnome.org/show_bug.cgi?id="); /* init the bugzilla URL */
|
||||
qof_init();
|
||||
cashobjects_register();
|
||||
qof_load_backend_library ("../.libs/", GNC_LIB_NAME);
|
||||
qof_load_backend_library ("../../xml/.libs", "gncmod-backend-xml");
|
||||
g_assert (qof_load_backend_library ("../.libs/", GNC_LIB_NAME));
|
||||
g_assert (qof_load_backend_library ("../../xml/.libs",
|
||||
"gncmod-backend-xml"));
|
||||
|
||||
|
||||
test_suite_gnc_backend_dbi_basic();
|
||||
|
||||
@@ -20,8 +20,6 @@ void do_test_sqlite(void);
|
||||
void do_test_mysql(void);
|
||||
void do_test_pgsql(void);
|
||||
|
||||
#define DBI_TEST_XML_FILENAME "test-dbi.xml"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
QofSession *session;
|
||||
|
||||
@@ -43,9 +43,6 @@ void test_suite_gnc_backend_dbi_business(void);
|
||||
|
||||
void do_test_business_sqlite(void);
|
||||
|
||||
#define DBI_TEST_XML_FILENAME "test-dbi.xml"
|
||||
#define FILE_NAME "sqlite3:///tmp/test-sqlite3-file"
|
||||
#define GNC_LIB_NAME "gncmod-backend-dbi"
|
||||
#include "config.h"
|
||||
#include "qof.h"
|
||||
#include "cashobjects.h"
|
||||
|
||||
Reference in New Issue
Block a user