From 60ae4ac8ecf20a478871222d176b186c6576833e Mon Sep 17 00:00:00 2001 From: John Ralls Date: Thu, 21 Jan 2016 12:07:29 -0800 Subject: [PATCH] Fix new cdv-import tests for running in a separate build directory. --- configure.ac | 2 ++ src/import-export/csv-imp/test/Makefile.am | 31 +++++++++++++++++-- src/import-export/csv-imp/test/test-csv-imp.c | 4 +-- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 381e94df91..20b4e6169d 100644 --- a/configure.ac +++ b/configure.ac @@ -1613,6 +1613,8 @@ AC_CONFIG_FILES([src/tax/us/test/test-load-module], # A few files need extra actions at creation time AC_CONFIG_FILES([src/bin/overrides/gnucash-make-guids], [chmod u+x src/bin/overrides/gnucash-make-guids]) +#Link (copy on Windows) test data files: +AC_CONFIG_LINKS([src/import-export/csv-imp/test/sample1.csv:src/import-export/csv-imp/test/sample1.csv]) LDFLAGS="${LDFLAGS} ${NOUNDEF}" AC_OUTPUT diff --git a/src/import-export/csv-imp/test/Makefile.am b/src/import-export/csv-imp/test/Makefile.am index e7ff7bab87..52af6d8aeb 100644 --- a/src/import-export/csv-imp/test/Makefile.am +++ b/src/import-export/csv-imp/test/Makefile.am @@ -24,12 +24,12 @@ test_csv_imp_SOURCES = \ test-csv-imp.c \ utest-gnc-csv-model.c -test_csv_imp_HEADERSS = +test_csv_imp_HEADERS = #The tests might require more libraries, but try to keep them #as independent as possible. test_csv_imp_LDADD = \ - ${top_builddir}/${MODULEPATH}/libgncmod-csv-import.la \ + ${top_builddir}/${MODULEPATH}/Libgncmod-csv-import.la \ ${top_builddir}/src/import-export/libgncmod-generic-import.la \ ${top_builddir}/src/gnome/libgnc-gnome.la \ ${top_builddir}/src/gnome-utils/libgncmod-gnome-utils.la \ @@ -66,8 +66,33 @@ test_csv_imp_CFLAGS = \ ${GTK_CFLAGS} \ ${GLIB_CFLAGS} +GNC_TEST_DEPS = \ +--library-dir ${top_builddir}/${MODULEPATH} \ +--library-dir ${top_builddir}/src/import-export \ +--library-dir ${top_builddir}/src/gnome \ +--library-dir ${top_builddir}/src/gnome-utils \ +--library-dir ${top_builddir}/src/gnome-search \ +--library-dir ${top_builddir}/src/register/ledger-core \ +--library-dir ${top_builddir}/src/register/register-core \ +--library-dir ${top_builddir}/src/register/register-gnome \ +--library-dir ${top_builddir}/src/report/report-system \ +--library-dir ${top_builddir}/src/report/report-gnome \ +--library-dir ${top_builddir}/src/html \ +--library-dir ${top_builddir}/src/app-utils \ +--library-dir ${top_builddir}/src/backend/xml \ +--library-dir ${top_builddir}/src/engine \ +--library-dir ${top_builddir}/src/core-utils \ +--library-dir ${top_builddir}/src/gnc-module \ +--library-dir ${top_builddir}/src/libqof/qof \ +--library-dir ${top_builddir}/lib/stf + TESTS_ENVIRONMENT = \ SRCDIR=${srcdir} \ - G_DEBUG= + G_DEBUG= \ + $(shell ${abs_top_srcdir}/src/gnc-test-env.pl --noexports ${GNC_TEST_DEPS}) + +EXTRA_DIST= \ + sample1.csv + AM_CPPFLAGS = -DG_LOG_DOMAIN=\"gnc.import.csv\" diff --git a/src/import-export/csv-imp/test/test-csv-imp.c b/src/import-export/csv-imp/test/test-csv-imp.c index 33cf83fae9..6665de181e 100644 --- a/src/import-export/csv-imp/test/test-csv-imp.c +++ b/src/import-export/csv-imp/test/test-csv-imp.c @@ -40,7 +40,7 @@ main (int argc, qof_init(); /* Initialize the GObject system */ qof_log_init_filename_special("stderr"); /* Init the log system */ g_test_init ( &argc, &argv, NULL ); /* initialize test program */ - qof_log_set_level("gnc", G_LOG_LEVEL_DEBUG); + qof_log_set_level("gnc", (QofLogLevel)G_LOG_LEVEL_DEBUG); g_test_bug_base("https://bugzilla.gnome.org/show_bug.cgi?id="); /* init the bugzilla URL */ /* Disable the transaction log */ xaccLogDisable(); @@ -58,5 +58,3 @@ main (int argc, return g_test_run(); } - -