mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Merge branch 'maint'
This commit is contained in:
commit
7f65a3356e
@ -11,6 +11,8 @@ ENDIF()
|
|||||||
|
|
||||||
PROJECT (Gnucash)
|
PROJECT (Gnucash)
|
||||||
|
|
||||||
|
#ENABLE_TESTING()
|
||||||
|
|
||||||
# Version number of gnucash
|
# Version number of gnucash
|
||||||
SET (GNUCASH_MAJOR_VERSION 2)
|
SET (GNUCASH_MAJOR_VERSION 2)
|
||||||
SET (GNUCASH_MINOR_VERSION 6)
|
SET (GNUCASH_MINOR_VERSION 6)
|
||||||
@ -43,6 +45,7 @@ INCLUDE (CheckIncludeFiles)
|
|||||||
INCLUDE (GncAddSchemeTargets)
|
INCLUDE (GncAddSchemeTargets)
|
||||||
INCLUDE (GncConfigure)
|
INCLUDE (GncConfigure)
|
||||||
INCLUDE (GncAddGSchemaTargets)
|
INCLUDE (GncAddGSchemaTargets)
|
||||||
|
#INCLUDE (GncAddTest)
|
||||||
|
|
||||||
# ############################################################
|
# ############################################################
|
||||||
# These options are settable from the CMake command line. For example, to disable
|
# These options are settable from the CMake command line. For example, to disable
|
||||||
@ -76,6 +79,8 @@ SET(DATADIRNAME share)
|
|||||||
SET(GNC_SYSTEM_XDG_DATA_DIRS /usr/local/share /usr/share)
|
SET(GNC_SYSTEM_XDG_DATA_DIRS /usr/local/share /usr/share)
|
||||||
SET(GNC_DBD_DIR ${CMAKE_PREFIX_PATH}/lib/dbd CACHE PATH "specify location of libdbi drivers")
|
SET(GNC_DBD_DIR ${CMAKE_PREFIX_PATH}/lib/dbd CACHE PATH "specify location of libdbi drivers")
|
||||||
SET(PKGLIBDIR ${CMAKE_INSTALL_PREFIX}/lib/gnucash)
|
SET(PKGLIBDIR ${CMAKE_INSTALL_PREFIX}/lib/gnucash)
|
||||||
|
#SET(TEST_MYSQL_URL "" CACHE STRING "MySQL database URL for testing")
|
||||||
|
#SET(TEST_PGSQL_URL "" CACHE STRING "PgSQL database URL for testing")
|
||||||
|
|
||||||
IF(GNC_BUILD_AS_INSTALL)
|
IF(GNC_BUILD_AS_INSTALL)
|
||||||
SET(DATADIR_BUILD ${CMAKE_BINARY_DIR}/${DATADIRNAME})
|
SET(DATADIR_BUILD ${CMAKE_BINARY_DIR}/${DATADIRNAME})
|
||||||
@ -85,6 +90,11 @@ IF(GNC_BUILD_AS_INSTALL)
|
|||||||
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
#SET(SHELL_FROM_ENV $ENV{SHELL})
|
||||||
|
#SET(SHELL bin/bash)
|
||||||
|
#IF (SHELL_FROM_ENV) # Replacing this with IF ($ENV{SHELL}) doesn't work.
|
||||||
|
# SET(SHELL ${SHELL_FROM_ENV})
|
||||||
|
#ENDIF()
|
||||||
|
|
||||||
IF (WIN32)
|
IF (WIN32)
|
||||||
# Help Windows find the various dependencies. We assume here that the standard advice for building
|
# Help Windows find the various dependencies. We assume here that the standard advice for building
|
||||||
@ -379,7 +389,7 @@ ENDIF (APPLE AND WITH_GNUCASH)
|
|||||||
|
|
||||||
IF (UNIX AND NOT APPLE)
|
IF (UNIX AND NOT APPLE)
|
||||||
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/gnucash")
|
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/gnucash")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
SET(BUILD_SHARED_LIBS ON)
|
SET(BUILD_SHARED_LIBS ON)
|
||||||
|
|
||||||
@ -406,6 +416,25 @@ IF (GNC_BUILD_AS_INSTALL)
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
# ############################################################
|
# ############################################################
|
||||||
|
|
||||||
|
#SET(CMAKE_CTEST_COMMAND ctest)
|
||||||
|
#IF (XCODE_VERSION)
|
||||||
|
# SET(CMAKE_CTEST_COMMAND ctest -C Debug)
|
||||||
|
#ENDIF()
|
||||||
|
|
||||||
|
# There are targets that need to build before tests will run
|
||||||
|
#ADD_CUSTOM_TARGET(check
|
||||||
|
# COMMAND ${CMAKE_CTEST_COMMAND}
|
||||||
|
# DEPENDS gnucash scm-app-utils scm-gnome-utils scm-report-gnome
|
||||||
|
# scm-engine scm-gnc-module scm-test-engine scm-report-system-3
|
||||||
|
# scm-test-core scm-test-report-system scm-standard-reports-2
|
||||||
|
# scm-test-standard-reports foo gncmodfoo baz gncmodbaz
|
||||||
|
# bar gncmodbar gncmod_agedver gncmod_incompatdep
|
||||||
|
# gncmod_futuremodsys
|
||||||
|
#)
|
||||||
|
#IF (NOT WIN32)
|
||||||
|
# ADD_DEPENDENCIES(check gncmod-backend-xml-link)
|
||||||
|
#ENDIF()
|
||||||
|
|
||||||
# The subdirectories
|
# The subdirectories
|
||||||
ADD_SUBDIRECTORY (accounts)
|
ADD_SUBDIRECTORY (accounts)
|
||||||
ADD_SUBDIRECTORY (checks)
|
ADD_SUBDIRECTORY (checks)
|
||||||
|
@ -29,10 +29,10 @@ faster that using the default Makefile generator to me.)
|
|||||||
|
|
||||||
== Scope
|
== Scope
|
||||||
|
|
||||||
The scope of the current work is to duplicate the `make` and `make
|
The scope of the current work is to duplicate the `make`,
|
||||||
install` actions as the Autotools system would. Currently, there is no
|
`make check` and `make install` actions as the Autotools system would.
|
||||||
support for `make check`, `make dist`, `make distcheck` or similar
|
Currently, there is no support for `make dist`, `make distcheck` or
|
||||||
targets. Other limitations include:
|
similar targets. Other limitations include:
|
||||||
|
|
||||||
* Not all options available in `./configure` have been ported to
|
* Not all options available in `./configure` have been ported to
|
||||||
this CMake system.
|
this CMake system.
|
||||||
@ -152,6 +152,24 @@ For Xcode via the command line (see below to build from within Xcode):
|
|||||||
|
|
||||||
$ xcodebuild -jobs N [-target=install]
|
$ xcodebuild -jobs N [-target=install]
|
||||||
|
|
||||||
|
=== Running tests
|
||||||
|
|
||||||
|
To run the Gnucash tests (also called checks), use the `check` target.
|
||||||
|
For ninja, use:
|
||||||
|
|
||||||
|
$ ninja check
|
||||||
|
|
||||||
|
For Makefiles:
|
||||||
|
|
||||||
|
$ make check
|
||||||
|
|
||||||
|
For Xcode via the command line:
|
||||||
|
|
||||||
|
$ xcodebuild -jobs N -target=check
|
||||||
|
|
||||||
|
A test summary will appear in the terminal. Full logs are available
|
||||||
|
in at Testing/Temporary/LastTest.log in the build directory.
|
||||||
|
|
||||||
=== Launching GnuCash
|
=== Launching GnuCash
|
||||||
|
|
||||||
Assuming the build completes successfully, in all cases you can run
|
Assuming the build completes successfully, in all cases you can run
|
||||||
@ -186,7 +204,6 @@ Then continue to follow the existing build instructions.
|
|||||||
At this writing, generating a distribution with the CMake build
|
At this writing, generating a distribution with the CMake build
|
||||||
via dist.sh has not been tested.
|
via dist.sh has not been tested.
|
||||||
|
|
||||||
|
|
||||||
== Using Xcode on OS X
|
== Using Xcode on OS X
|
||||||
|
|
||||||
CMake can generate build files for Xcode such that GnuCash can be
|
CMake can generate build files for Xcode such that GnuCash can be
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
|
|
||||||
# Set of available languages.
|
# Set of available languages.
|
||||||
SET (TP_LINGUAS az ca cs da eu fa ja nl pt rw sk sr sv tr uk zh_CN)
|
SET (TP_LINGUAS az ca cs da eu fa ja nl rw sk sr sv tr uk zh_CN)
|
||||||
# already marked as external at TP:
|
# already marked as external at TP:
|
||||||
SET (GC_LINGUAS ar bg de el en_GB es fi fr gu he hi hu it kn ko lt lv mr nb ne pl pt_BR pt_PT ro ru ta te ur vi zh_TW)
|
SET (GC_LINGUAS ar bg de el en_GB es fi fr gu he hi hu it kn ko lt lv mr nb ne pl pt pt_BR ro ru ta te ur vi zh_TW)
|
||||||
# not marked or no TP team:
|
# not marked or no TP team:
|
||||||
SET (NEW_LINGUAS as brx doi es_NI kok kok@latin ks mai mni mni@bengali)
|
SET (NEW_LINGUAS as brx doi es_NI kok kok@latin ks mai mni mni@bengali)
|
||||||
|
|
||||||
|
@ -103,6 +103,7 @@ IF (APPLE)
|
|||||||
# FIXME: HANDLE gtk-mac-integration-gtk2
|
# FIXME: HANDLE gtk-mac-integration-gtk2
|
||||||
SET(GNC_PLATFORM_DARWIN 1)
|
SET(GNC_PLATFORM_DARWIN 1)
|
||||||
SET(GNC_PLATFORM_OSX 1)
|
SET(GNC_PLATFORM_OSX 1)
|
||||||
|
SET(PLATFORM_OSX 1)
|
||||||
SET(HAVE_OSX_KEYCHAIN 1)
|
SET(HAVE_OSX_KEYCHAIN 1)
|
||||||
|
|
||||||
ENDIF(APPLE)
|
ENDIF(APPLE)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
|
#ADD_SUBDIRECTORY(test)
|
||||||
# Build the library
|
# Build the library
|
||||||
|
|
||||||
SET (app_utils_noinst_HEADERS
|
SET (app_utils_noinst_HEADERS
|
||||||
@ -190,4 +190,4 @@ GNC_ADD_SCHEME_TARGETS(scm-app-utils-3
|
|||||||
FALSE
|
FALSE
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_CUSTOM_TARGET(scm-app-utils ALL DEPENDS scm-app-utils-3 scm-app-utils-2 scm-app-utils-1 scm-gettext)
|
ADD_CUSTOM_TARGET(scm-app-utils ALL DEPENDS scm-app-utils-3 scm-app-utils-2 scm-app-utils-1 scm-gettext)
|
||||||
|
@ -1199,7 +1199,7 @@ create_each_transaction_helper(Transaction *template_txn, void *user_data)
|
|||||||
|
|
||||||
if (err_flag)
|
if (err_flag)
|
||||||
{
|
{
|
||||||
g_critical("new transaction creation sx [%s]",
|
g_critical("Error in SX transaction [%s], creation aborted.",
|
||||||
xaccSchedXactionGetName(sx));
|
xaccSchedXactionGetName(sx));
|
||||||
xaccTransDestroy(new_txn);
|
xaccTransDestroy(new_txn);
|
||||||
xaccTransCommitEdit(new_txn);
|
xaccTransCommitEdit(new_txn);
|
||||||
@ -1278,6 +1278,7 @@ gnc_sx_instance_model_effect_change(GncSxInstanceModel *model,
|
|||||||
{
|
{
|
||||||
GncSxInstance *inst = (GncSxInstance*)instance_iter->data;
|
GncSxInstance *inst = (GncSxInstance*)instance_iter->data;
|
||||||
gboolean sx_is_auto_create;
|
gboolean sx_is_auto_create;
|
||||||
|
GList *instance_errors = NULL;
|
||||||
|
|
||||||
xaccSchedXactionGetAutoCreate(inst->parent->sx, &sx_is_auto_create, NULL);
|
xaccSchedXactionGetAutoCreate(inst->parent->sx, &sx_is_auto_create, NULL);
|
||||||
if (auto_create_only && !sx_is_auto_create)
|
if (auto_create_only && !sx_is_auto_create)
|
||||||
@ -1315,9 +1316,20 @@ gnc_sx_instance_model_effect_change(GncSxInstanceModel *model,
|
|||||||
increment_sx_state(inst, &last_occur_date, &instance_count, &remain_occur_count);
|
increment_sx_state(inst, &last_occur_date, &instance_count, &remain_occur_count);
|
||||||
break;
|
break;
|
||||||
case SX_INSTANCE_STATE_TO_CREATE:
|
case SX_INSTANCE_STATE_TO_CREATE:
|
||||||
create_transactions_for_instance(inst, created_transaction_guids, creation_errors);
|
create_transactions_for_instance (inst,
|
||||||
increment_sx_state(inst, &last_occur_date, &instance_count, &remain_occur_count);
|
created_transaction_guids,
|
||||||
gnc_sx_instance_model_change_instance_state(model, inst, SX_INSTANCE_STATE_CREATED);
|
&instance_errors);
|
||||||
|
if (instance_errors == NULL)
|
||||||
|
{
|
||||||
|
increment_sx_state (inst, &last_occur_date,
|
||||||
|
&instance_count,
|
||||||
|
&remain_occur_count);
|
||||||
|
gnc_sx_instance_model_change_instance_state
|
||||||
|
(model, inst, SX_INSTANCE_STATE_CREATED);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
*creation_errors = g_list_concat (*creation_errors,
|
||||||
|
instance_errors);
|
||||||
break;
|
break;
|
||||||
case SX_INSTANCE_STATE_REMINDER:
|
case SX_INSTANCE_STATE_REMINDER:
|
||||||
// do nothing
|
// do nothing
|
||||||
|
28
src/app-utils/test/CMakeLists.txt
Normal file
28
src/app-utils/test/CMakeLists.txt
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
|
||||||
|
SET(APP_UTILS_TEST_INCLUDE_DIRS
|
||||||
|
${CMAKE_SOURCE_DIR}/src/app-utils
|
||||||
|
${CMAKE_SOURCE_DIR}/src/libqof/qof # for qof.h
|
||||||
|
${CMAKE_SOURCE_DIR}/src/test-core
|
||||||
|
${CMAKE_SOURCE_DIR}/src/engine/test-core
|
||||||
|
${CMAKE_BINARY_DIR}/src # for config.h
|
||||||
|
${GLIB2_INCLUDE_DIRS}
|
||||||
|
${GUILE_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
SET(APP_UTILS_TEST_LIBS gncmod-app-utils gncmod-test-engine gnc-qof test-core ${GUILE_LDFLAGS})
|
||||||
|
|
||||||
|
MACRO(ADD_APP_UTILS_TEST _TARGET _SOURCE_FILES)
|
||||||
|
GNC_ADD_TEST(${_TARGET} "${_SOURCE_FILES}" APP_UTILS_TEST_INCLUDE_DIRS APP_UTILS_TEST_LIBS)
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
ADD_APP_UTILS_TEST(test-exp-parser test-exp-parser.c)
|
||||||
|
GNC_ADD_TEST_WITH_GUILE(test-link-module test-link-module APP_UTILS_TEST_INCLUDE_DIRS APP_UTILS_TEST_LIBS)
|
||||||
|
ADD_APP_UTILS_TEST(test-print-parse-amount test-print-parse-amount.c)
|
||||||
|
# This test not run in autotools build.
|
||||||
|
#GNC_ADD_TEST_WITH_GUILE(test-print-queries test-print-queries.c APP_UTILS_TEST_INCLUDE_DIRS APP_UTILS_TEST_LIBS)
|
||||||
|
GNC_ADD_TEST_WITH_GUILE(test-scm-query-string test-scm-query-string.c
|
||||||
|
APP_UTILS_TEST_INCLUDE_DIRS APP_UTILS_TEST_LIBS
|
||||||
|
)
|
||||||
|
ADD_APP_UTILS_TEST(test-sx test-sx.c)
|
||||||
|
|
||||||
|
GNC_ADD_SCHEME_TEST(scm-test-load-module test-load-module.in)
|
@ -135,7 +135,7 @@ main (int argc, char **argv)
|
|||||||
/* When built with clang, guile-1.8.8's scm_c_eval_string truncates all
|
/* When built with clang, guile-1.8.8's scm_c_eval_string truncates all
|
||||||
* integer values to int32, which causes this test to fail.
|
* integer values to int32, which causes this test to fail.
|
||||||
*/
|
*/
|
||||||
#ifndef __clang__
|
#if !(defined(__clang__)) || defined(HAVE_GUILE20)
|
||||||
scm_boot_guile (argc, argv, main_helper, NULL);
|
scm_boot_guile (argc, argv, main_helper, NULL);
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# CMakeLists.txt for src/backend/dbi
|
# CMakeLists.txt for src/backend/dbi
|
||||||
|
|
||||||
|
#ADD_SUBDIRECTORY(test)
|
||||||
|
|
||||||
# Source file gncmod-backend-dbi.c does not appear to be use in Makefile.in, so not included here.
|
# Source file gncmod-backend-dbi.c does not appear to be use in Makefile.in, so not included here.
|
||||||
|
|
||||||
SET (backend_dbi_SOURCES
|
SET (backend_dbi_SOURCES
|
||||||
|
31
src/backend/dbi/test/CMakeLists.txt
Normal file
31
src/backend/dbi/test/CMakeLists.txt
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
SET(BACKEND_DBI_TEST_INCLUDE_DIRS
|
||||||
|
${CMAKE_BINARY_DIR}/src # for config.h
|
||||||
|
${CMAKE_SOURCE_DIR}/src/core-utils
|
||||||
|
${CMAKE_SOURCE_DIR}/src/backend/dbi/test
|
||||||
|
${CMAKE_SOURCE_DIR}/src/backend/sql
|
||||||
|
${CMAKE_SOURCE_DIR}/src/libqof/qof # for qof.h
|
||||||
|
${CMAKE_SOURCE_DIR}/src/engine
|
||||||
|
${CMAKE_SOURCE_DIR}/src/engine/test-core
|
||||||
|
${CMAKE_SOURCE_DIR}/src/test-core
|
||||||
|
${LIBDBI_INCLUDE_PATH}
|
||||||
|
${GLIB2_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
SET(BACKEND_DBI_TEST_LIBS gnc-backend-sql gncmod-engine gncmod-test-engine gnc-qof test-core ${LIBDBI_LIBRARY})
|
||||||
|
|
||||||
|
SET(test_dbi_backend_SOURCES
|
||||||
|
test-backend-dbi.c
|
||||||
|
test-backend-dbi-basic.c
|
||||||
|
test-dbi-business-stuff.c
|
||||||
|
test-dbi-stuff.c
|
||||||
|
)
|
||||||
|
|
||||||
|
GNC_ADD_TEST(test-backend-dbi "${test_dbi_backend_SOURCES}"
|
||||||
|
BACKEND_DBI_TEST_INCLUDE_DIRS BACKEND_DBI_TEST_LIBS
|
||||||
|
)
|
||||||
|
|
||||||
|
TARGET_COMPILE_DEFINITIONS(test-backend-dbi PRIVATE
|
||||||
|
TEST_MYSQL_URL=\"${TEST_MYSQL_URL}\"
|
||||||
|
TEST_PGSQL_URL=\"${TEST_PGSQL_URL}\"
|
||||||
|
DBI_TEST_XML_FILENAME=\"${CMAKE_CURRENT_SOURCE_DIR}/test-dbi.xml\"
|
||||||
|
)
|
@ -1,6 +1,6 @@
|
|||||||
# CMakeLists.txt for src/backend/dbi
|
# CMakeLists.txt for src/backend/dbi
|
||||||
|
|
||||||
|
#ADD_SUBDIRECTORY(test)
|
||||||
|
|
||||||
SET (backend_sql_SOURCES
|
SET (backend_sql_SOURCES
|
||||||
gnc-backend-sql.cpp
|
gnc-backend-sql.cpp
|
||||||
|
23
src/backend/sql/test/CMakeLists.txt
Normal file
23
src/backend/sql/test/CMakeLists.txt
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
SET(BACKEND_SQL_TEST_INCLUDE_DIRS
|
||||||
|
${CMAKE_BINARY_DIR}/src # for config.h
|
||||||
|
${CMAKE_SOURCE_DIR}/src/backend/sql
|
||||||
|
${CMAKE_SOURCE_DIR}/src/libqof/qof # for qof.
|
||||||
|
${CMAKE_SOURCE_DIR}/src/engine
|
||||||
|
${CMAKE_SOURCE_DIR}/src/test-core
|
||||||
|
${GLIB2_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
SET(BACKEND_SQL_TEST_LIBS gnc-backend-sql gncmod-engine gnc-qof test-core)
|
||||||
|
|
||||||
|
# This test does not actually do anything.
|
||||||
|
GNC_ADD_TEST(test-column-types test-column-types.c
|
||||||
|
BACKEND_SQL_TEST_INCLUDE_DIRS BACKEND_SQL_TEST_LIBS
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
GNC_ADD_TEST(test-sqlbe "test-sqlbe.c;utest-gnc-backend-sql.c"
|
||||||
|
BACKEND_SQL_TEST_INCLUDE_DIRS BACKEND_SQL_TEST_LIBS
|
||||||
|
)
|
||||||
|
TARGET_COMPILE_DEFINITIONS(test-sqlbe PRIVATE TESTPROG=test_sqlbe)
|
@ -1,5 +1,7 @@
|
|||||||
# CMakeLists.txt for src/backend/xml
|
# CMakeLists.txt for src/backend/xml
|
||||||
|
|
||||||
|
#ADD_SUBDIRECTORY(test)
|
||||||
|
|
||||||
# Command to generate the swig-engine.c wrapper file
|
# Command to generate the swig-engine.c wrapper file
|
||||||
SET (SWIG_GNC_MODULE_C ${CMAKE_CURRENT_BINARY_DIR}/swig-gnc-module.c)
|
SET (SWIG_GNC_MODULE_C ${CMAKE_CURRENT_BINARY_DIR}/swig-gnc-module.c)
|
||||||
GNC_ADD_SWIG_COMMAND (${SWIG_GNC_MODULE_C} ${CMAKE_CURRENT_SOURCE_DIR}/gnc-module.i)
|
GNC_ADD_SWIG_COMMAND (${SWIG_GNC_MODULE_C} ${CMAKE_CURRENT_SOURCE_DIR}/gnc-module.i)
|
||||||
|
99
src/backend/xml/test/CMakeLists.txt
Normal file
99
src/backend/xml/test/CMakeLists.txt
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
# Common stuff
|
||||||
|
|
||||||
|
SET(XML_TEST_INCLUDE_DIRS
|
||||||
|
${CMAKE_SOURCE_DIR}/src/backend/xml
|
||||||
|
${CMAKE_SOURCE_DIR}/src/backend/xml/test
|
||||||
|
${CMAKE_SOURCE_DIR}/src/engine
|
||||||
|
${CMAKE_SOURCE_DIR}/src/engine/test-core
|
||||||
|
${CMAKE_SOURCE_DIR}/src/libqof/qof # for qof.h
|
||||||
|
${CMAKE_BINARY_DIR}/src # for config.h
|
||||||
|
${CMAKE_SOURCE_DIR}/src/test-core # for unittest-support.h
|
||||||
|
${GLIB2_INCLUDE_DIRS}
|
||||||
|
${LIBXML2_INCLUDE_DIRS}
|
||||||
|
${ZLIB_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
SET(XML_TEST_LIBS gncmod-engine gnc-qof gncmod-test-engine test-core ${LIBXML2_LDFLAGS} -lz)
|
||||||
|
|
||||||
|
FUNCTION(ADD_XML_TEST _TARGET _SOURCE_FILES)
|
||||||
|
GNC_ADD_TEST(${_TARGET} "${_SOURCE_FILES}" XML_TEST_INCLUDE_DIRS XML_TEST_LIBS ${ARGN})
|
||||||
|
ENDFUNCTION()
|
||||||
|
|
||||||
|
|
||||||
|
################################
|
||||||
|
|
||||||
|
SET(test_backend_xml_base_SOURCES
|
||||||
|
${CMAKE_SOURCE_DIR}/src/backend/xml/sixtp-dom-parsers.c
|
||||||
|
${CMAKE_SOURCE_DIR}/src/backend/xml/sixtp-dom-generators.c
|
||||||
|
${CMAKE_SOURCE_DIR}/src/backend/xml/sixtp-utils.c
|
||||||
|
${CMAKE_SOURCE_DIR}/src/backend/xml/sixtp.c
|
||||||
|
${CMAKE_SOURCE_DIR}/src/backend/xml/sixtp-stack.c
|
||||||
|
${CMAKE_SOURCE_DIR}/src/backend/xml/sixtp-to-dom-parser.c
|
||||||
|
${CMAKE_SOURCE_DIR}/src/backend/xml/gnc-xml-helper.c
|
||||||
|
)
|
||||||
|
|
||||||
|
## the xml backend is now a GModule - this test does
|
||||||
|
## not load it as a module and cannot link to it
|
||||||
|
## and remain portable.
|
||||||
|
|
||||||
|
SET(test_backend_xml_module_SOURCES
|
||||||
|
${test_backend_xml_base_SOURCES}
|
||||||
|
${CMAKE_SOURCE_DIR}/src/backend/xml/io-example-account.c
|
||||||
|
${CMAKE_SOURCE_DIR}/src/backend/xml/io-gncxml-gen.c
|
||||||
|
${CMAKE_SOURCE_DIR}/src/backend/xml/io-gncxml-v2.c
|
||||||
|
${CMAKE_SOURCE_DIR}/src/backend/xml/io-utils.c
|
||||||
|
${CMAKE_SOURCE_DIR}/src/backend/xml/gnc-account-xml-v2.c
|
||||||
|
${CMAKE_SOURCE_DIR}/src/backend/xml/gnc-budget-xml-v2.c
|
||||||
|
${CMAKE_SOURCE_DIR}/src/backend/xml/gnc-lot-xml-v2.c
|
||||||
|
${CMAKE_SOURCE_DIR}/src/backend/xml/gnc-recurrence-xml-v2.c
|
||||||
|
${CMAKE_SOURCE_DIR}/src/backend/xml/gnc-schedxaction-xml-v2.c
|
||||||
|
${CMAKE_SOURCE_DIR}/src/backend/xml/gnc-freqspec-xml-v2.c
|
||||||
|
${CMAKE_SOURCE_DIR}/src/backend/xml/gnc-transaction-xml-v2.c
|
||||||
|
${CMAKE_SOURCE_DIR}/src/backend/xml/gnc-commodity-xml-v2.c
|
||||||
|
${CMAKE_SOURCE_DIR}/src/backend/xml/gnc-book-xml-v2.c
|
||||||
|
${CMAKE_SOURCE_DIR}/src/backend/xml/gnc-pricedb-xml-v2.c
|
||||||
|
)
|
||||||
|
|
||||||
|
# The test test-dom-parser1.c is not run by Makefile.am
|
||||||
|
|
||||||
|
ADD_XML_TEST(test-date-converting "${test_backend_xml_base_SOURCES};test-date-converting.c")
|
||||||
|
ADD_XML_TEST(test-dom-converters1 "${test_backend_xml_base_SOURCES};test-dom-converters1.c")
|
||||||
|
ADD_XML_TEST(test-kvp-frames "${test_backend_xml_base_SOURCES};test-kvp-frames.c")
|
||||||
|
ADD_XML_TEST(test-load-backend test-load-backend.c)
|
||||||
|
ADD_XML_TEST(test-load-xml2 test-load-xml2.c
|
||||||
|
GNC_TEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/test-files/xml2
|
||||||
|
)
|
||||||
|
# Not run in autotools.
|
||||||
|
#ADD_XML_TEST(test-save-in-lang test-save-in-lang.c
|
||||||
|
# GNC_TEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/test-files/xml2
|
||||||
|
#)
|
||||||
|
|
||||||
|
GNC_ADD_TEST_WITH_GUILE(test-load-example-account
|
||||||
|
"${test_backend_xml_module_SOURCES};test-load-example-account.c"
|
||||||
|
XML_TEST_INCLUDE_DIRS XML_TEST_LIBS
|
||||||
|
GNC_ACCOUNT_PATH=${CMAKE_SOURCE_DIR}/accounts/C
|
||||||
|
)
|
||||||
|
ADD_XML_TEST(test-string-converters "${test_backend_xml_base_SOURCES};test-string-converters.c")
|
||||||
|
ADD_XML_TEST(test-xml-account "${test_backend_xml_module_SOURCES};test-xml-account.c;test-file-stuff.c")
|
||||||
|
ADD_XML_TEST(test-xml-commodity "${test_backend_xml_module_SOURCES};test-xml-commodity.c;test-file-stuff.c")
|
||||||
|
ADD_XML_TEST(test-xml-pricedb "${test_backend_xml_module_SOURCES};test-xml-pricedb.c;test-file-stuff.c")
|
||||||
|
ADD_XML_TEST(test-xml-transaction "${test_backend_xml_module_SOURCES};test-xml-transaction.c;test-file-stuff.c")
|
||||||
|
ADD_XML_TEST(test-xml2-is-file "${test_backend_xml_module_SOURCES};test-xml2-is-file.c"
|
||||||
|
GNC_TEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/test-files/xml2)
|
||||||
|
|
||||||
|
SET(CMAKE_COMMAND_TMP "")
|
||||||
|
IF (${CMAKE_VERSION} VERSION_GREATER 3.1)
|
||||||
|
SET(CMAKE_COMMAND_TMP ${CMAKE_COMMAND} -E env)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
SET(test-real-data-env
|
||||||
|
SRCDIR=${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
VERBOSE=yes
|
||||||
|
TEST_PATH=${CMAKE_BINARY_DIR}/bin
|
||||||
|
)
|
||||||
|
ADD_TEST(NAME test-real-data
|
||||||
|
COMMAND ${CMAKE_COMMAND_TMP}
|
||||||
|
${SHELL} ${CMAKE_CURRENT_SOURCE_DIR}/test-real-data.sh.in
|
||||||
|
)
|
||||||
|
SET_TESTS_PROPERTIES(test-real-data PROPERTIES ENVIRONMENT "${test-real-data-env}")
|
@ -3,7 +3,9 @@
|
|||||||
#set -e
|
#set -e
|
||||||
|
|
||||||
EXIT_VALUE=0
|
EXIT_VALUE=0
|
||||||
|
if [ "x$TEST_PATH" == "x" ] ; then
|
||||||
|
TEST_PATH=.
|
||||||
|
fi
|
||||||
for i in $SRCDIR/test-files/xml2/*.gml2 ; do
|
for i in $SRCDIR/test-files/xml2/*.gml2 ; do
|
||||||
|
|
||||||
if [ ! -d $i ] ; then
|
if [ ! -d $i ] ; then
|
||||||
@ -15,9 +17,9 @@ for i in $SRCDIR/test-files/xml2/*.gml2 ; do
|
|||||||
FILES=`perl $SRCDIR/grab-types.pl "gnc:$j" $i "$j/dataXXX.xml"`
|
FILES=`perl $SRCDIR/grab-types.pl "gnc:$j" $i "$j/dataXXX.xml"`
|
||||||
if [ ! -z "$FILES" ] ; then
|
if [ ! -z "$FILES" ] ; then
|
||||||
if [ "x$VERBOSE" = "xyes" ] ; then
|
if [ "x$VERBOSE" = "xyes" ] ; then
|
||||||
echo "Testing ./test-xml-$j $j/data*.xml # from `basename $i`:"
|
echo "Testing $TEST_PATH/test-xml-$j $j/data*.xml # from `basename $i`:"
|
||||||
fi
|
fi
|
||||||
eval "./test-xml-$j $FILES 2>/dev/null"
|
eval "$TEST_PATH/test-xml-$j $FILES 2>/dev/null"
|
||||||
if [ $? != 0 ] ; then
|
if [ $? != 0 ] ; then
|
||||||
EXIT_VALUE=1
|
EXIT_VALUE=1
|
||||||
fi
|
fi
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
ADD_SUBDIRECTORY(overrides)
|
ADD_SUBDIRECTORY(overrides)
|
||||||
|
#ADD_SUBDIRECTORY(test)
|
||||||
# Some settings are platform dependent. Let's define them per platform.
|
# Some settings are platform dependent. Let's define them per platform.
|
||||||
IF (WIN32)
|
IF (WIN32)
|
||||||
# Windows specific settings go here:
|
# Windows specific settings go here:
|
||||||
|
3
src/bin/test/CMakeLists.txt
Normal file
3
src/bin/test/CMakeLists.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
ADD_TEST(NAME test-version
|
||||||
|
COMMAND ${CMAKE_BINARY_DIR}/bin/gnucash --version)
|
64
src/cmake_modules/GncAddTest.cmake
Normal file
64
src/cmake_modules/GncAddTest.cmake
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
|
||||||
|
FUNCTION(GNC_ADD_TEST _TARGET _SOURCE_FILES TEST_INCLUDE_VAR_NAME TEST_LIBS_VAR_NAME)
|
||||||
|
SET(HAVE_ENV_VARS FALSE)
|
||||||
|
IF (${ARGC} GREATER 4)
|
||||||
|
# Extra arguments are treated as environment variables
|
||||||
|
SET(HAVE_ENV_VARS TRUE)
|
||||||
|
ENDIF()
|
||||||
|
SET(TEST_INCLUDE_DIRS ${${TEST_INCLUDE_VAR_NAME}})
|
||||||
|
SET(TEST_LIBS ${${TEST_LIBS_VAR_NAME}})
|
||||||
|
SET_SOURCE_FILES_PROPERTIES (${_SOURCE_FILES} PROPERTIES OBJECT_DEPENDS ${CONFIG_H})
|
||||||
|
ADD_EXECUTABLE(${_TARGET} EXCLUDE_FROM_ALL ${_SOURCE_FILES})
|
||||||
|
TARGET_LINK_LIBRARIES(${_TARGET} ${TEST_LIBS})
|
||||||
|
TARGET_INCLUDE_DIRECTORIES(${_TARGET} PRIVATE ${TEST_INCLUDE_DIRS})
|
||||||
|
IF (${HAVE_ENV_VARS})
|
||||||
|
SET(CMAKE_COMMAND_TMP "")
|
||||||
|
IF (${CMAKE_VERSION} VERSION_GREATER 3.1)
|
||||||
|
SET(CMAKE_COMMAND_TMP ${CMAKE_COMMAND} -E env)
|
||||||
|
ENDIF()
|
||||||
|
ADD_TEST(${_TARGET} ${CMAKE_COMMAND_TMP}
|
||||||
|
${CMAKE_BINARY_DIR}/bin/${_TARGET}
|
||||||
|
)
|
||||||
|
SET_TESTS_PROPERTIES(${_TARGET} PROPERTIES ENVIRONMENT "${ARGN}")
|
||||||
|
ELSE()
|
||||||
|
ADD_TEST(NAME ${_TARGET} COMMAND ${_TARGET})
|
||||||
|
ENDIF()
|
||||||
|
ADD_DEPENDENCIES(check ${_TARGET})
|
||||||
|
ENDFUNCTION()
|
||||||
|
|
||||||
|
FUNCTION(GNC_ADD_TEST_WITH_GUILE _TARGET _SOURCE_FILES TEST_INCLUDE_VAR_NAME TEST_LIBS_VAR_NAME)
|
||||||
|
SET(_GNC_MODULE_PATH ${CMAKE_BINARY_DIR}/lib:${CMAKE_BINARY_DIR}/lib/gnucash)
|
||||||
|
GNC_ADD_TEST(${_TARGET} "${_SOURCE_FILES}" "${TEST_INCLUDE_VAR_NAME}" "${TEST_LIBS_VAR_NAME}"
|
||||||
|
GNC_UNINSTALLED=yes
|
||||||
|
GNC_BUILDDIR=${CMAKE_BINARY_DIR}
|
||||||
|
GUILE_WARN_DEPRECATED=no
|
||||||
|
GNC_MODULE_PATH=${_GNC_MODULE_PATH}
|
||||||
|
DYLD_LIBRARY_PATH=${_GNC_MODULE_PATH}
|
||||||
|
LD_LIBRARY_PATH=${_GNC_MODULE_PATH}
|
||||||
|
GUILE_LOAD_COMPILED_PATH=${CMAKE_BINARY_DIR}/lib/gnucash/scm/ccache/2.0
|
||||||
|
${ARGN}
|
||||||
|
)
|
||||||
|
ENDFUNCTION()
|
||||||
|
|
||||||
|
|
||||||
|
FUNCTION(GNC_ADD_SCHEME_TEST _TARGET _SOURCE_FILE)
|
||||||
|
SET(CMAKE_COMMAND_TMP "")
|
||||||
|
IF (${CMAKE_VERSION} VERSION_GREATER 3.1)
|
||||||
|
SET(CMAKE_COMMAND_TMP ${CMAKE_COMMAND} -E env)
|
||||||
|
ENDIF()
|
||||||
|
SET(_GNC_MODULE_PATH ${CMAKE_BINARY_DIR}/lib:${CMAKE_BINARY_DIR}/lib/gnucash)
|
||||||
|
SET(GUILE_ENV
|
||||||
|
GNC_UNINSTALLED=yes
|
||||||
|
GNC_BUILDDIR=${CMAKE_BINARY_DIR}
|
||||||
|
GUILE_WARN_DEPRECATED=no
|
||||||
|
GNC_MODULE_PATH=${_GNC_MODULE_PATH}
|
||||||
|
DYLD_LIBRARY_PATH=${_GNC_MODULE_PATH}
|
||||||
|
LD_LIBRARY_PATH=${_GNC_MODULE_PATH}
|
||||||
|
GUILE_LOAD_COMPILED_PATH=${CMAKE_BINARY_DIR}/lib/gnucash/scm/ccache/2.0
|
||||||
|
${ARGN}
|
||||||
|
)
|
||||||
|
ADD_TEST(${_TARGET} ${CMAKE_COMMAND_TMP}
|
||||||
|
${GUILE_EXECUTABLE} --debug -l ${CMAKE_CURRENT_SOURCE_DIR}/${_SOURCE_FILE} -c "(exit (run-test))"
|
||||||
|
)
|
||||||
|
SET_TESTS_PROPERTIES(${_TARGET} PROPERTIES ENVIRONMENT "${GUILE_ENV}")
|
||||||
|
ENDFUNCTION()
|
@ -36,6 +36,7 @@
|
|||||||
|
|
||||||
/* Running on OSX, either X11 or Quartz */
|
/* Running on OSX, either X11 or Quartz */
|
||||||
#cmakedefine GNC_PLATFORM_OSX 1
|
#cmakedefine GNC_PLATFORM_OSX 1
|
||||||
|
#cmakedefine PLATFORM_OSX 1
|
||||||
|
|
||||||
/* POSIX-compliant OS */
|
/* POSIX-compliant OS */
|
||||||
#cmakedefine GNC_PLATFORM_POSIX 1
|
#cmakedefine GNC_PLATFORM_POSIX 1
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# CMakeLists.txt for src/core-utils
|
# CMakeLists.txt for src/core-utils
|
||||||
|
|
||||||
|
#ADD_SUBDIRECTORY(test)
|
||||||
# Command to generate the swig-engine.c wrapper file
|
# Command to generate the swig-engine.c wrapper file
|
||||||
SET (SWIG_CORE_UTILS_C ${CMAKE_CURRENT_BINARY_DIR}/swig-core-utils.c)
|
SET (SWIG_CORE_UTILS_C ${CMAKE_CURRENT_BINARY_DIR}/swig-core-utils.c)
|
||||||
GNC_ADD_SWIG_COMMAND (${SWIG_CORE_UTILS_C} ${CMAKE_CURRENT_SOURCE_DIR}/core-utils.i)
|
GNC_ADD_SWIG_COMMAND (${SWIG_CORE_UTILS_C} ${CMAKE_CURRENT_SOURCE_DIR}/core-utils.i)
|
||||||
|
18
src/core-utils/test/CMakeLists.txt
Normal file
18
src/core-utils/test/CMakeLists.txt
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
|
||||||
|
|
||||||
|
SET(CORE_UTILS_TEST_INCLUDE_DIRS
|
||||||
|
${CMAKE_BINARY_DIR}/src # for config.h
|
||||||
|
${CMAKE_SOURCE_DIR}/src/core-utils
|
||||||
|
${CMAKE_SOURCE_DIR}/src/test-core
|
||||||
|
${CMAKE_SOURCE_DIR}/src/libqof/qof # for qof.h
|
||||||
|
${GLIB2_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
SET(CORE_UTILS_TEST_LIBS gnc-core-utils gnc-qof test-core)
|
||||||
|
|
||||||
|
MACRO(ADD_CORE_UTILS_TEST _TARGET _SOURCE_FILES)
|
||||||
|
GNC_ADD_TEST(${_TARGET} "${_SOURCE_FILES}" CORE_UTILS_TEST_INCLUDE_DIRS CORE_UTILS_TEST_LIBS)
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
ADD_CORE_UTILS_TEST(test-gnc-glib-utils test-gnc-glib-utils.c)
|
||||||
|
ADD_CORE_UTILS_TEST(test-gnc-uri-utils test-gnc-uri-utils.c)
|
||||||
|
ADD_CORE_UTILS_TEST(test-resolve-file-path test-resolve-file-path.c)
|
@ -1,5 +1,8 @@
|
|||||||
# CMakeLists.txt for src/engine
|
# CMakeLists.txt for src/engine
|
||||||
|
|
||||||
|
#ADD_SUBDIRECTORY(test-core)
|
||||||
|
#ADD_SUBDIRECTORY(test)
|
||||||
|
|
||||||
SET(engine_noinst_HEADERS
|
SET(engine_noinst_HEADERS
|
||||||
AccountP.h
|
AccountP.h
|
||||||
ScrubP.h
|
ScrubP.h
|
||||||
|
17
src/engine/test-core/CMakeLists.txt
Normal file
17
src/engine/test-core/CMakeLists.txt
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
|
||||||
|
|
||||||
|
SET(libgncmod_test_engine_SOURCES
|
||||||
|
gncmod-test-engine.c test-engine-stuff.c
|
||||||
|
)
|
||||||
|
|
||||||
|
ADD_LIBRARY(gncmod-test-engine STATIC ${libgncmod_test_engine_SOURCES})
|
||||||
|
|
||||||
|
TARGET_INCLUDE_DIRECTORIES(gncmod-test-engine PRIVATE
|
||||||
|
${GMODULE_INCLUDE_DIRS}
|
||||||
|
${CMAKE_SOURCE_DIR}/src/gnc-module
|
||||||
|
${CMAKE_SOURCE_DIR}/src/libqof/qof
|
||||||
|
${CMAKE_BINARY_DIR}/src # for config.h
|
||||||
|
${CMAKE_SOURCE_DIR}/src
|
||||||
|
${CMAKE_SOURCE_DIR}/src/engine
|
||||||
|
${CMAKE_SOURCE_DIR}/src/test-core
|
||||||
|
)
|
91
src/engine/test/CMakeLists.txt
Normal file
91
src/engine/test/CMakeLists.txt
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
# Common stuff
|
||||||
|
|
||||||
|
SET(ENGINE_TEST_INCLUDE_DIRS
|
||||||
|
${CMAKE_SOURCE_DIR}/src/backend/xml
|
||||||
|
${CMAKE_SOURCE_DIR}/src/engine
|
||||||
|
${CMAKE_SOURCE_DIR}/src/engine/test-core
|
||||||
|
${CMAKE_SOURCE_DIR}/src/libqof/qof # for qof.h
|
||||||
|
${CMAKE_BINARY_DIR}/src # for config.h
|
||||||
|
${CMAKE_SOURCE_DIR}/src/test-core # for unittest-support.h
|
||||||
|
${GLIB2_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
SET(ENGINE_TEST_LIBS gncmod-engine gnc-qof gncmod-test-engine test-core ${LIBXML2_LDFLAGS})
|
||||||
|
|
||||||
|
MACRO(ADD_ENGINE_TEST _TARGET _SOURCE_FILES)
|
||||||
|
GNC_ADD_TEST(${_TARGET} "${_SOURCE_FILES}" ENGINE_TEST_INCLUDE_DIRS ENGINE_TEST_LIBS)
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
# Not via macro because of unique link requirements
|
||||||
|
|
||||||
|
ADD_EXECUTABLE(test-link EXCLUDE_FROM_ALL test-link.c)
|
||||||
|
TARGET_LINK_LIBRARIES(test-link gnc-qof gnc-core-utils)
|
||||||
|
ADD_TEST(NAME test-link COMMAND test-link)
|
||||||
|
ADD_DEPENDENCIES(check test-link)
|
||||||
|
|
||||||
|
#################################################
|
||||||
|
|
||||||
|
ADD_ENGINE_TEST(test-load-engine test-load-engine.c)
|
||||||
|
ADD_ENGINE_TEST(test-guid test-guid.c)
|
||||||
|
ADD_ENGINE_TEST(test-numeric test-numeric.c)
|
||||||
|
ADD_ENGINE_TEST(test-date test-date.c)
|
||||||
|
ADD_ENGINE_TEST(test-object test-object.c)
|
||||||
|
ADD_ENGINE_TEST(test-commodities test-commodities.c)
|
||||||
|
|
||||||
|
SET(test_engine_SOURCES
|
||||||
|
test-engine.c
|
||||||
|
utest-Account.c
|
||||||
|
utest-Budget.c
|
||||||
|
utest-Entry.c
|
||||||
|
utest-Invoice.c
|
||||||
|
utest-Split.c
|
||||||
|
utest-Transaction.c
|
||||||
|
)
|
||||||
|
|
||||||
|
ADD_ENGINE_TEST(test-engine "${test_engine_SOURCES}")
|
||||||
|
TARGET_COMPILE_OPTIONS(test-engine PRIVATE -Wno-write-strings)
|
||||||
|
|
||||||
|
ADD_ENGINE_TEST(test-account-object test-account-object.c)
|
||||||
|
ADD_ENGINE_TEST(test-group-vs-book test-group-vs-book.c)
|
||||||
|
ADD_ENGINE_TEST(test-lots test-lots.c)
|
||||||
|
ADD_ENGINE_TEST(test-querynew test-querynew.c)
|
||||||
|
ADD_ENGINE_TEST(test-query test-query.c)
|
||||||
|
ADD_ENGINE_TEST(test-split-vs-account test-split-vs-account.c)
|
||||||
|
ADD_ENGINE_TEST(test-transaction-reversal test-transaction-reversal.c)
|
||||||
|
ADD_ENGINE_TEST(test-transaction-voiding test-transaction-voiding.c)
|
||||||
|
ADD_ENGINE_TEST(test-recurrence test-recurrence.c)
|
||||||
|
ADD_ENGINE_TEST(test-business test-business.c)
|
||||||
|
ADD_ENGINE_TEST(test-address test-address.c)
|
||||||
|
ADD_ENGINE_TEST(test-customer test-customer.c)
|
||||||
|
ADD_ENGINE_TEST(test-employee test-employee.c)
|
||||||
|
ADD_ENGINE_TEST(test-job test-job.c)
|
||||||
|
ADD_ENGINE_TEST(test-vendor test-vendor.c)
|
||||||
|
|
||||||
|
############################
|
||||||
|
# This is a C test that needs GUILE environment variables set.
|
||||||
|
GNC_ADD_TEST_WITH_GUILE(test-scm-query test-scm-query.c ENGINE_TEST_INCLUDE_DIRS ENGINE_TEST_LIBS)
|
||||||
|
############################
|
||||||
|
|
||||||
|
GNC_ADD_SCHEME_TEST(scm-test-account test-account.scm)
|
||||||
|
GNC_ADD_SCHEME_TEST(scm-test-create-account test-create-account.scm)
|
||||||
|
GNC_ADD_SCHEME_TEST(scm-test-test-extra test-test-extras.scm)
|
||||||
|
GNC_ADD_SCHEME_TEST(scm-test-split test-split.scm)
|
||||||
|
# This check not run in autotools. Doesn't pass.
|
||||||
|
#GNC_ADD_SCHEME_TEST(scm-test-scm-query-import test-scm-query-import.scm)
|
||||||
|
|
||||||
|
SET(engine_test_SCHEME test-extras.scm)
|
||||||
|
|
||||||
|
SET(GUILE_MODULES "")
|
||||||
|
SET(GUILE_LOAD_DIRS src/app-utils src/scm)
|
||||||
|
SET(GUILE_LIBRARY_DIRS "")
|
||||||
|
SET(GUILE_DEPENDS scm-app-utils scm-scm)
|
||||||
|
|
||||||
|
GNC_ADD_SCHEME_TARGETS(scm-test-engine
|
||||||
|
"${engine_test_SCHEME}"
|
||||||
|
gnucash/engine/test
|
||||||
|
"${GUILE_MODULES}"
|
||||||
|
"${GUILE_LOAD_DIRS}"
|
||||||
|
"${GUILE_LIBRARY_DIRS}"
|
||||||
|
"${GUILE_DEPENDS}"
|
||||||
|
FALSE
|
||||||
|
)
|
@ -1,4 +1,5 @@
|
|||||||
# CMakeLists.txt for src/gnc-module
|
# CMakeLists.txt for src/gnc-module
|
||||||
|
#ADD_SUBDIRECTORY(test)
|
||||||
|
|
||||||
# Command to generate the swig-engine.c wrapper file
|
# Command to generate the swig-engine.c wrapper file
|
||||||
SET (SWIG_GNC_MODULE_C ${CMAKE_CURRENT_BINARY_DIR}/swig-gnc-module.c)
|
SET (SWIG_GNC_MODULE_C ${CMAKE_CURRENT_BINARY_DIR}/swig-gnc-module.c)
|
||||||
|
103
src/gnc-module/test/CMakeLists.txt
Normal file
103
src/gnc-module/test/CMakeLists.txt
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
|
||||||
|
# TESTCOUNTS: { dir: gnc-module/test, test_count: 12 }
|
||||||
|
|
||||||
|
ADD_SUBDIRECTORY(mod-foo)
|
||||||
|
ADD_SUBDIRECTORY(mod-bar)
|
||||||
|
ADD_SUBDIRECTORY(mod-baz)
|
||||||
|
ADD_SUBDIRECTORY(misc-mods)
|
||||||
|
|
||||||
|
SET(GNC_MODULE_TEST_INCLUDE_DIRS
|
||||||
|
${CMAKE_BINARY_DIR}/src # for config.h
|
||||||
|
${CMAKE_SOURCE_DIR}/src/gnc-module
|
||||||
|
${CMAKE_SOURCE_DIR}/src/test-core
|
||||||
|
${CMAKE_SOURCE_DIR}/src/libqof/qof # for qof.h
|
||||||
|
${GLIB2_INCLUDE_DIRS}
|
||||||
|
${GUILE_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
SET(GNC_MODULE_TEST_LIBS gnc-module gnc-qof test-core)
|
||||||
|
|
||||||
|
MACRO(ADD_GNC_MODULE_TEST _TARGET _SOURCE_FILES)
|
||||||
|
GNC_ADD_TEST(${_TARGET} "${_SOURCE_FILES}" GNC_MODULE_TEST_INCLUDE_DIRS GNC_MODULE_TEST_LIBS)
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
SET(_GNC_MODULE_PATH ${CMAKE_BINARY_DIR}/lib:${CMAKE_BINARY_DIR}/lib/gnucash)
|
||||||
|
SET(GUILE_ENV
|
||||||
|
GNC_UNINSTALLED=yes
|
||||||
|
GNC_BUILDDIR=${CMAKE_BINARY_DIR}
|
||||||
|
GUILE_WARN_DEPRECATED=no
|
||||||
|
GNC_MODULE_PATH=${_GNC_MODULE_PATH}
|
||||||
|
DYLD_LIBRARY_PATH=${_GNC_MODULE_PATH}
|
||||||
|
LD_LIBRARY_PATH=${_GNC_MODULE_PATH}
|
||||||
|
GUILE_LOAD_COMPILED_PATH=${CMAKE_BINARY_DIR}/lib/gnucash/scm/ccache/2.0
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
FUNCTION(RUN_TEST_WITH_GUILE _TARGET _SOURCE_FILE)
|
||||||
|
SET(CMAKE_COMMAND_TMP "")
|
||||||
|
IF (${CMAKE_VERSION} VERSION_GREATER 3.1)
|
||||||
|
SET(CMAKE_COMMAND_TMP ${CMAKE_COMMAND} -E env)
|
||||||
|
ENDIF()
|
||||||
|
ADD_TEST(NAME ${_TARGET}
|
||||||
|
COMMAND ${CMAKE_COMMAND_TMP}
|
||||||
|
${GUILE_EXECUTABLE} -s ${_SOURCE_FILE}
|
||||||
|
)
|
||||||
|
SET_TESTS_PROPERTIES(${_TARGET} PROPERTIES ENVIRONMENT "${GUILE_ENV};${ARGN}")
|
||||||
|
ENDFUNCTION()
|
||||||
|
|
||||||
|
GNC_ADD_TEST_WITH_GUILE(test-load-c test-load-c.c GNC_MODULE_TEST_INCLUDE_DIRS GNC_MODULE_TEST_LIBS
|
||||||
|
GUILE_LOAD_PATH=${CMAKE_CURRENT_SOURCE_DIR}/mod-foo
|
||||||
|
)
|
||||||
|
|
||||||
|
RUN_TEST_WITH_GUILE(test-load-scm ${CMAKE_CURRENT_SOURCE_DIR}/test-load-scm.in
|
||||||
|
GUILE_LOAD_PATH=${CMAKE_CURRENT_SOURCE_DIR}/mod-foo
|
||||||
|
)
|
||||||
|
RUN_TEST_WITH_GUILE(test-load-deps ${CMAKE_CURRENT_SOURCE_DIR}/test-load-deps.in
|
||||||
|
GUILE_LOAD_PATH=${CMAKE_CURRENT_SOURCE_DIR}/mod-foo:${CMAKE_CURRENT_SOURCE_DIR}/mod-baz
|
||||||
|
)
|
||||||
|
RUN_TEST_WITH_GUILE(test-scm-init ${CMAKE_CURRENT_SOURCE_DIR}/test-scm-init.in)
|
||||||
|
|
||||||
|
RUN_TEST_WITH_GUILE(test-scm-multi ${CMAKE_CURRENT_SOURCE_DIR}/test-scm-multi.in
|
||||||
|
GUILE_LOAD_PATH=${CMAKE_CURRENT_SOURCE_DIR}/mod-foo:${CMAKE_CURRENT_SOURCE_DIR}/mod-bar
|
||||||
|
)
|
||||||
|
RUN_TEST_WITH_GUILE(test-scm-dynload ${CMAKE_CURRENT_SOURCE_DIR}/test-scm-dynload.in)
|
||||||
|
|
||||||
|
GNC_ADD_TEST_WITH_GUILE(test-modsysver test-modsysver.c
|
||||||
|
GNC_MODULE_TEST_INCLUDE_DIRS GNC_MODULE_TEST_LIBS
|
||||||
|
)
|
||||||
|
GNC_ADD_TEST_WITH_GUILE(test-incompatdep test-incompatdep.c
|
||||||
|
GNC_MODULE_TEST_INCLUDE_DIRS GNC_MODULE_TEST_LIBS
|
||||||
|
)
|
||||||
|
GNC_ADD_TEST_WITH_GUILE(test-agedver test-agedver.c
|
||||||
|
GNC_MODULE_TEST_INCLUDE_DIRS GNC_MODULE_TEST_LIBS
|
||||||
|
)
|
||||||
|
|
||||||
|
GNC_ADD_TEST(test-dynload test-dynload.c
|
||||||
|
GNC_MODULE_TEST_INCLUDE_DIRS GNC_MODULE_TEST_LIBS
|
||||||
|
LIBDIR=${CMAKE_BINARY_DIR}/lib
|
||||||
|
)
|
||||||
|
|
||||||
|
SET(GUILE ${GUILE_EXECUTABLE})
|
||||||
|
CONFIGURE_FILE(test-gwrapped-c.in test-gwrapped-c)
|
||||||
|
CONFIGURE_FILE(test-scm-module.in test-scm-module)
|
||||||
|
|
||||||
|
FUNCTION(RUN_GUILE_SHELL_TEST _TARGET _SOURCE_FILE)
|
||||||
|
SET(CMAKE_COMMAND_TMP "")
|
||||||
|
IF (${CMAKE_VERSION} VERSION_GREATER 3.1)
|
||||||
|
SET(CMAKE_COMMAND_TMP ${CMAKE_COMMAND} -E env)
|
||||||
|
ENDIF()
|
||||||
|
ADD_TEST(NAME ${_TARGET}
|
||||||
|
COMMAND ${CMAKE_COMMAND_TMP}
|
||||||
|
${SHELL} ${_SOURCE_FILE}
|
||||||
|
)
|
||||||
|
SET_TESTS_PROPERTIES(${_TARGET} PROPERTIES ENVIRONMENT "${GUILE_ENV};${ARGN}")
|
||||||
|
ENDFUNCTION()
|
||||||
|
|
||||||
|
RUN_GUILE_SHELL_TEST(test-gwrapped-c ${CMAKE_CURRENT_BINARY_DIR}/test-gwrapped-c
|
||||||
|
GUILE_LOAD_PATH=${CMAKE_CURRENT_SOURCE_DIR}/mod-foo
|
||||||
|
)
|
||||||
|
|
||||||
|
RUN_GUILE_SHELL_TEST(test-scm-module ${CMAKE_CURRENT_BINARY_DIR}/test-scm-module
|
||||||
|
GUILE_LOAD_PATH=${CMAKE_CURRENT_SOURCE_DIR}/mod-foo
|
||||||
|
)
|
||||||
|
|
14
src/gnc-module/test/misc-mods/CMakeLists.txt
Normal file
14
src/gnc-module/test/misc-mods/CMakeLists.txt
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
INCLUDE_DIRECTORIES(
|
||||||
|
${CMAKE_SOURCE_DIR}/src/gnc-module
|
||||||
|
${GLIB2_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
ADD_LIBRARY(gncmod_agedver EXCLUDE_FROM_ALL agedver.c)
|
||||||
|
TARGET_LINK_LIBRARIES(gncmod_agedver ${GLIB2_LDFLAGS})
|
||||||
|
|
||||||
|
ADD_LIBRARY(gncmod_futuremodsys EXCLUDE_FROM_ALL futuremodsys.c)
|
||||||
|
TARGET_LINK_LIBRARIES(gncmod_futuremodsys ${GLIB2_LDFLAGS})
|
||||||
|
|
||||||
|
ADD_LIBRARY(gncmod_incompatdep EXCLUDE_FROM_ALL incompatdep.c)
|
||||||
|
TARGET_LINK_LIBRARIES(gncmod_incompatdep gnc-module ${GLIB2_LDFLAGS})
|
18
src/gnc-module/test/mod-bar/CMakeLists.txt
Normal file
18
src/gnc-module/test/mod-bar/CMakeLists.txt
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
|
||||||
|
SET (SWIG_BAR_C ${CMAKE_CURRENT_BINARY_DIR}/swig-bar.c)
|
||||||
|
GNC_ADD_SWIG_COMMAND (${SWIG_BAR_C} ${CMAKE_CURRENT_SOURCE_DIR}/bar.i bar.h)
|
||||||
|
|
||||||
|
ADD_LIBRARY(bar EXCLUDE_FROM_ALL bar.c bar.h)
|
||||||
|
ADD_LIBRARY(gncmodbar EXCLUDE_FROM_ALL gnc-mod-bar.c)
|
||||||
|
SET_SOURCE_FILES_PROPERTIES (gnc-mod-bar.c PROPERTY OBJECT_DEPENDS ${SWIG_BAR_C})
|
||||||
|
|
||||||
|
TARGET_LINK_LIBRARIES(gncmodbar bar gnc-module)
|
||||||
|
TARGET_INCLUDE_DIRECTORIES(gncmodbar PRIVATE
|
||||||
|
${CMAKE_BINARY_DIR}/src
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
${CMAKE_SOURCE_DIR}/src
|
||||||
|
${CMAKE_SOURCE_DIR}/src/gnc-module
|
||||||
|
${GLIB2_INCLUDE_DIRS}
|
||||||
|
${GUILE_INCLUDE_DIRS}
|
||||||
|
)
|
24
src/gnc-module/test/mod-baz/CMakeLists.txt
Normal file
24
src/gnc-module/test/mod-baz/CMakeLists.txt
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
|
||||||
|
SET (SWIG_BAZ_C ${CMAKE_CURRENT_BINARY_DIR}/swig-baz.c)
|
||||||
|
GNC_ADD_SWIG_COMMAND (${SWIG_BAZ_C} ${CMAKE_CURRENT_SOURCE_DIR}/baz.i baz.h)
|
||||||
|
|
||||||
|
ADD_LIBRARY(baz EXCLUDE_FROM_ALL baz.c baz.h)
|
||||||
|
TARGET_INCLUDE_DIRECTORIES(baz PRIVATE
|
||||||
|
${CMAKE_SOURCE_DIR}/src/gnc-module/test/mod-foo
|
||||||
|
)
|
||||||
|
TARGET_LINK_LIBRARIES(baz foo)
|
||||||
|
|
||||||
|
|
||||||
|
ADD_LIBRARY(gncmodbaz EXCLUDE_FROM_ALL gnc-mod-baz.c)
|
||||||
|
SET_SOURCE_FILES_PROPERTIES (gnc-mod-baz.c PROPERTY OBJECT_DEPENDS ${SWIG_BAZ_C})
|
||||||
|
|
||||||
|
TARGET_LINK_LIBRARIES(gncmodbaz baz gnc-module)
|
||||||
|
TARGET_INCLUDE_DIRECTORIES(gncmodbaz PRIVATE
|
||||||
|
${CMAKE_BINARY_DIR}/src
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
${CMAKE_SOURCE_DIR}/src
|
||||||
|
${CMAKE_SOURCE_DIR}/src/gnc-module
|
||||||
|
${GLIB2_INCLUDE_DIRS}
|
||||||
|
${GUILE_INCLUDE_DIRS}
|
||||||
|
)
|
18
src/gnc-module/test/mod-foo/CMakeLists.txt
Normal file
18
src/gnc-module/test/mod-foo/CMakeLists.txt
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
|
||||||
|
SET (SWIG_FOO_C ${CMAKE_CURRENT_BINARY_DIR}/swig-foo.c)
|
||||||
|
GNC_ADD_SWIG_COMMAND (${SWIG_FOO_C} ${CMAKE_CURRENT_SOURCE_DIR}/foo.i foo.h)
|
||||||
|
|
||||||
|
ADD_LIBRARY(foo EXCLUDE_FROM_ALL foo.c foo.h)
|
||||||
|
ADD_LIBRARY(gncmodfoo EXCLUDE_FROM_ALL gnc-mod-foo.c)
|
||||||
|
SET_SOURCE_FILES_PROPERTIES (gnc-mod-foo.c PROPERTY OBJECT_DEPENDS ${SWIG_FOO_C})
|
||||||
|
|
||||||
|
TARGET_LINK_LIBRARIES(gncmodfoo foo gnc-module)
|
||||||
|
TARGET_INCLUDE_DIRECTORIES(gncmodfoo PRIVATE
|
||||||
|
${CMAKE_BINARY_DIR}/src
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
${CMAKE_SOURCE_DIR}/src
|
||||||
|
${CMAKE_SOURCE_DIR}/src/gnc-module
|
||||||
|
${GLIB2_INCLUDE_DIRS}
|
||||||
|
${GUILE_INCLUDE_DIRS}
|
||||||
|
)
|
@ -40,10 +40,16 @@ guile_main(void *closure, int argc, char ** argv)
|
|||||||
gchar *logdomain = "gnc.module";
|
gchar *logdomain = "gnc.module";
|
||||||
gchar *modpath;
|
gchar *modpath;
|
||||||
guint loglevel = G_LOG_LEVEL_WARNING;
|
guint loglevel = G_LOG_LEVEL_WARNING;
|
||||||
|
const char *libdir = g_getenv("LIBDIR");
|
||||||
TestErrorStruct check = { loglevel, logdomain, msg };
|
TestErrorStruct check = { loglevel, logdomain, msg };
|
||||||
g_log_set_handler (logdomain, loglevel,
|
g_log_set_handler (logdomain, loglevel,
|
||||||
(GLogFunc)test_checked_handler, &check);
|
(GLogFunc)test_checked_handler, &check);
|
||||||
|
|
||||||
|
if (libdir == NULL)
|
||||||
|
{
|
||||||
|
libdir = "../.libs";
|
||||||
|
}
|
||||||
|
|
||||||
g_test_message(" test-dynload.c: testing dynamic linking of libgnc-module ...");
|
g_test_message(" test-dynload.c: testing dynamic linking of libgnc-module ...");
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
/* MinGW builds libgnc-module-0.dll */
|
/* MinGW builds libgnc-module-0.dll */
|
||||||
@ -53,9 +59,16 @@ guile_main(void *closure, int argc, char ** argv)
|
|||||||
* that means that g_module_build_path (), which uses ".so", doesn't
|
* that means that g_module_build_path (), which uses ".so", doesn't
|
||||||
* build the right path name.
|
* build the right path name.
|
||||||
*/
|
*/
|
||||||
modpath = g_build_filename ("..", ".libs", "libgnc-module.dylib", NULL);
|
if (libdir == NULL)
|
||||||
|
{
|
||||||
|
modpath = g_build_filename ("..", ".libs", "libgnc-module.dylib", NULL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
modpath = g_build_filename (libdir, "libgnc-module.dylib", NULL);
|
||||||
|
}
|
||||||
#else /* Regular Unix */
|
#else /* Regular Unix */
|
||||||
modpath = g_module_build_path ("../.libs", "gnc-module");
|
modpath = g_module_build_path (libdir, "gnc-module");
|
||||||
#endif
|
#endif
|
||||||
gmodule = g_module_open(modpath, 0);
|
gmodule = g_module_open(modpath, 0);
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
ADD_SUBDIRECTORY(gschemas)
|
ADD_SUBDIRECTORY(gschemas)
|
||||||
ADD_SUBDIRECTORY(gtkbuilder)
|
ADD_SUBDIRECTORY(gtkbuilder)
|
||||||
ADD_SUBDIRECTORY(ui)
|
ADD_SUBDIRECTORY(ui)
|
||||||
|
#ADD_SUBDIRECTORY(test)
|
||||||
|
|
||||||
SET (SWIG_GNOME_UTILS_C ${CMAKE_CURRENT_BINARY_DIR}/swig-gnome-utils.c)
|
SET (SWIG_GNOME_UTILS_C ${CMAKE_CURRENT_BINARY_DIR}/swig-gnome-utils.c)
|
||||||
GNC_ADD_SWIG_COMMAND (${SWIG_GNOME_UTILS_C} ${CMAKE_CURRENT_SOURCE_DIR}/gnome-utils.i)
|
GNC_ADD_SWIG_COMMAND (${SWIG_GNOME_UTILS_C} ${CMAKE_CURRENT_SOURCE_DIR}/gnome-utils.i)
|
||||||
@ -261,4 +262,4 @@ GNC_ADD_SCHEME_TARGETS(scm-gnome-utils-2
|
|||||||
FALSE
|
FALSE
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_CUSTOM_TARGET(scm-gnome-utils ALL DEPENDS scm-gnome-utils-2 scm-gnome-utils-1)
|
ADD_CUSTOM_TARGET(scm-gnome-utils ALL DEPENDS scm-gnome-utils-2 scm-gnome-utils-1)
|
||||||
|
32
src/gnome-utils/test/CMakeLists.txt
Normal file
32
src/gnome-utils/test/CMakeLists.txt
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
|
||||||
|
SET(GNOME_UTILS_TEST_INCLUDE_DIRS
|
||||||
|
${CMAKE_SOURCE_DIR}/src/gnc-module
|
||||||
|
${GLIB2_INCLUDE_DIRS}
|
||||||
|
${GUILE_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
SET(GNOME_UTILS_TEST_LIBS gnc-module test-core)
|
||||||
|
|
||||||
|
GNC_ADD_TEST_WITH_GUILE(test-link-module-gnome-utils test-link-module.c
|
||||||
|
GNOME_UTILS_TEST_INCLUDE_DIRS GNOME_UTILS_TEST_LIBS
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
SET(GNOME_UTILS_GUI_TEST_INCLUDE_DIRS
|
||||||
|
${GNOME_UTILS_TEST_INCLUDE_DIRS}
|
||||||
|
${CMAKE_BINARY_DIR}/src
|
||||||
|
${CMAKE_SOURCE_DIR}/src/gnome-utils
|
||||||
|
${CMAKE_SOURCE_DIR}/src/engine
|
||||||
|
${CMAKE_SOURCE_DIR}/src/libqof/qof # for qof.h
|
||||||
|
${GTK2_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
SET(GNOME_UTILS_GUI_TEST_LIBS
|
||||||
|
${GNOME_UTILS_TEST_LIBS}
|
||||||
|
gncmod-gnome-utils
|
||||||
|
)
|
||||||
|
#This is a GUI test
|
||||||
|
#GNC_ADD_TEST(test-gnc-recurrence test-gnc-recurrence.c
|
||||||
|
# GNOME_UTILS_GUI_TEST_INCLUDE_DIRS
|
||||||
|
# GNOME_UTILS_GUI_TEST_LIBS
|
||||||
|
#
|
||||||
|
|
||||||
|
GNC_ADD_SCHEME_TEST(test-load-module-gnome-utils test-load-module.in)
|
@ -644,6 +644,8 @@ gnc_sxed_split_check_account (GncSxEditorDialog *sxed, Split *s,
|
|||||||
"sx-account", &acct_guid,
|
"sx-account", &acct_guid,
|
||||||
NULL);
|
NULL);
|
||||||
acct = xaccAccountLookup (acct_guid, gnc_get_current_book ());
|
acct = xaccAccountLookup (acct_guid, gnc_get_current_book ());
|
||||||
|
if (acct == NULL)
|
||||||
|
return FALSE;
|
||||||
split_cmdty = xaccAccountGetCommodity(acct);
|
split_cmdty = xaccAccountGetCommodity(acct);
|
||||||
split_amount = xaccSplitGetAmount(s);
|
split_amount = xaccSplitGetAmount(s);
|
||||||
if (!gnc_numeric_zero_p(split_amount) && base_cmdty == NULL)
|
if (!gnc_numeric_zero_p(split_amount) && base_cmdty == NULL)
|
||||||
@ -685,6 +687,100 @@ gnc_sxed_split_calculate_formula (GncSxEditorDialog *sxed, Split *s,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
GncSxEditorDialog *sxed;
|
||||||
|
GHashTable *txns;
|
||||||
|
GHashTable *vars;
|
||||||
|
txnCreditDebitSums *tcds;
|
||||||
|
gboolean multi_commodity;
|
||||||
|
gboolean err;
|
||||||
|
} CheckTxnSplitData;
|
||||||
|
|
||||||
|
static void
|
||||||
|
split_error_warning_dialog (GtkWidget *parent, const gchar *title,
|
||||||
|
gchar *message)
|
||||||
|
{
|
||||||
|
GtkWidget *dialog = gtk_message_dialog_new (GTK_WINDOW (parent), 0,
|
||||||
|
GTK_MESSAGE_ERROR,
|
||||||
|
GTK_BUTTONS_CLOSE,
|
||||||
|
"%s", title);
|
||||||
|
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
|
||||||
|
"%s", message);
|
||||||
|
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
|
||||||
|
g_signal_connect_swapped (dialog, "response",
|
||||||
|
G_CALLBACK(gtk_widget_destroy), dialog);
|
||||||
|
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||||
|
|
||||||
|
}
|
||||||
|
static gboolean
|
||||||
|
check_transaction_splits (Transaction *txn, gpointer data)
|
||||||
|
{
|
||||||
|
GList *splitList = xaccTransGetSplitList (txn);
|
||||||
|
CheckTxnSplitData *sd = (CheckTxnSplitData*)data;
|
||||||
|
|
||||||
|
for ( ; splitList; splitList = splitList->next )
|
||||||
|
{
|
||||||
|
gnc_commodity *base_cmdty = NULL;
|
||||||
|
txnCreditDebitSums *tcds;
|
||||||
|
Split *s = (Split*)splitList->data;
|
||||||
|
|
||||||
|
tcds = (txnCreditDebitSums*)g_hash_table_lookup (sd->txns,
|
||||||
|
(gpointer)txn);
|
||||||
|
if (sd->tcds == NULL)
|
||||||
|
{
|
||||||
|
sd->tcds = tcds_new ();
|
||||||
|
g_hash_table_insert (sd->txns, (gpointer)txn, (gpointer)(sd->tcds));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!gnc_sxed_split_check_account (sd->sxed, s, base_cmdty,
|
||||||
|
&sd->multi_commodity))
|
||||||
|
{
|
||||||
|
gchar *message = g_strdup_printf
|
||||||
|
(_("Split with memo %s has an invalid account."),
|
||||||
|
xaccSplitGetMemo (s));
|
||||||
|
split_error_warning_dialog (sd->sxed->dialog,
|
||||||
|
_("Invalid Account in Split"),
|
||||||
|
message);
|
||||||
|
g_free (message);
|
||||||
|
sd->err = TRUE;
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!gnc_sxed_split_calculate_formula (sd->sxed, s, sd->vars,
|
||||||
|
"sx-credit-formula",
|
||||||
|
sd->tcds))
|
||||||
|
{
|
||||||
|
gchar *message = g_strdup_printf
|
||||||
|
(_("Split with memo %s has an unparseable Credit Formula."),
|
||||||
|
xaccSplitGetMemo (s));
|
||||||
|
split_error_warning_dialog (sd->sxed->dialog,
|
||||||
|
_("Unparsable Formula in Split"),
|
||||||
|
message);
|
||||||
|
g_free (message);
|
||||||
|
sd->err = TRUE;
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!gnc_sxed_split_calculate_formula (sd->sxed, s, sd->vars,
|
||||||
|
"sx-debit-formula",
|
||||||
|
sd->tcds))
|
||||||
|
|
||||||
|
{
|
||||||
|
gchar *message = g_strdup_printf
|
||||||
|
(_("Split with memo %s has an unparseable Debit Formula."),
|
||||||
|
xaccSplitGetMemo (s));
|
||||||
|
split_error_warning_dialog (sd->sxed->dialog,
|
||||||
|
_("Unparsable Formula in Split"),
|
||||||
|
message);
|
||||||
|
g_free (message);
|
||||||
|
sd->err = TRUE;
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Checks to make sure that the SX is in a reasonable state to save.
|
* Checks to make sure that the SX is in a reasonable state to save.
|
||||||
* @return true if checks out okay, false otherwise.
|
* @return true if checks out okay, false otherwise.
|
||||||
@ -724,6 +820,8 @@ gnc_sxed_check_consistent( GncSxEditorDialog *sxed )
|
|||||||
(GDestroyNotify)gnc_sx_variable_free);
|
(GDestroyNotify)gnc_sx_variable_free);
|
||||||
GHashTable *txns = g_hash_table_new_full (g_direct_hash, g_direct_equal,
|
GHashTable *txns = g_hash_table_new_full (g_direct_hash, g_direct_equal,
|
||||||
NULL, g_free);
|
NULL, g_free);
|
||||||
|
CheckTxnSplitData sd = {sxed, txns, vars, NULL, FALSE, FALSE};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Plan:
|
* Plan:
|
||||||
* . Do a first pass to get the variables.
|
* . Do a first pass to get the variables.
|
||||||
@ -751,38 +849,16 @@ gnc_sxed_check_consistent( GncSxEditorDialog *sxed )
|
|||||||
for ( i = 0; i < numIters && !unbalanceable; i++ )
|
for ( i = 0; i < numIters && !unbalanceable; i++ )
|
||||||
{
|
{
|
||||||
GList *splitList = xaccSchedXactionGetSplits (sxed->sx);
|
GList *splitList = xaccSchedXactionGetSplits (sxed->sx);
|
||||||
|
Account *tmpl_acct = gnc_sx_get_template_transaction_account (sxed->sx);
|
||||||
gnc_sx_randomize_variables(vars);
|
gnc_sx_randomize_variables(vars);
|
||||||
g_hash_table_foreach( txns, set_sums_to_zero, NULL );
|
g_hash_table_foreach( txns, set_sums_to_zero, NULL );
|
||||||
|
|
||||||
splitCount += g_list_length( splitList );
|
splitCount += g_list_length( splitList );
|
||||||
|
|
||||||
for ( ; splitList; splitList = splitList->next )
|
xaccAccountForEachTransaction(tmpl_acct, check_transaction_splits, &sd);
|
||||||
{
|
|
||||||
gnc_commodity *base_cmdty = NULL;
|
|
||||||
txnCreditDebitSums *tcds;
|
|
||||||
Split *s = (Split*)splitList->data;
|
|
||||||
Transaction *t = xaccSplitGetParent (s);
|
|
||||||
|
|
||||||
tcds = (txnCreditDebitSums*)g_hash_table_lookup (txns, (gpointer)t);
|
if (sd.err)
|
||||||
if (tcds == NULL)
|
return FALSE;
|
||||||
{
|
|
||||||
tcds = tcds_new ();
|
|
||||||
g_hash_table_insert (txns, (gpointer)t, (gpointer)tcds);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!gnc_sxed_split_check_account (sxed, s, base_cmdty,
|
|
||||||
&multi_commodity))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
if (!gnc_sxed_split_calculate_formula (sxed, s, vars,
|
|
||||||
"sx-credit-formula",
|
|
||||||
tcds))
|
|
||||||
return FALSE;
|
|
||||||
if (!gnc_sxed_split_calculate_formula (sxed, s, vars,
|
|
||||||
"sx-debit-formula",
|
|
||||||
tcds))
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_hash_table_foreach (txns, check_credit_debit_balance, &unbalanceable);
|
g_hash_table_foreach (txns, check_credit_debit_balance, &unbalanceable);
|
||||||
}
|
}
|
||||||
@ -807,7 +883,7 @@ gnc_sxed_check_consistent( GncSxEditorDialog *sxed )
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (!gnc_sxed_check_autocreate (sxed, ttVarCount,
|
if (!gnc_sxed_check_autocreate (sxed, ttVarCount,
|
||||||
splitCount, multi_commodity))
|
splitCount, sd.multi_commodity))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (!gnc_sxed_check_endpoint (sxed))
|
if (!gnc_sxed_check_endpoint (sxed))
|
||||||
@ -819,7 +895,7 @@ gnc_sxed_check_consistent( GncSxEditorDialog *sxed )
|
|||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Saves the contents of the SX. This assumes that gnc_sxed_check_consistent
|
* Saves the contents of the SX. This assumes that gnc_sxed_check_consistent
|
||||||
* has returned true.
|
* has returned true.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
static void
|
static void
|
||||||
gnc_sxed_save_sx( GncSxEditorDialog *sxed )
|
gnc_sxed_save_sx( GncSxEditorDialog *sxed )
|
||||||
{
|
{
|
||||||
|
@ -791,10 +791,42 @@ gnc_sx_slr_tree_model_adapter_new(GncSxInstanceModel *instances)
|
|||||||
return rtn;
|
return rtn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
creation_error_dialog (GList **creation_errors)
|
||||||
|
{
|
||||||
|
GList *node = *creation_errors;
|
||||||
|
GtkWidget *dialog = NULL;
|
||||||
|
gchar *message = NULL;
|
||||||
|
if (*creation_errors == NULL) return;
|
||||||
|
for(; node != NULL; node = g_list_next (node))
|
||||||
|
{
|
||||||
|
gchar *new_msg = NULL;
|
||||||
|
if (message == NULL)
|
||||||
|
new_msg = g_strdup_printf ("%s", (gchar*)(node->data));
|
||||||
|
else
|
||||||
|
new_msg = g_strdup_printf("%s\n%s", message, (gchar*)(node->data));
|
||||||
|
g_free (message);
|
||||||
|
message = new_msg;
|
||||||
|
g_free(node->data);
|
||||||
|
}
|
||||||
|
g_list_free (*creation_errors);
|
||||||
|
creation_errors = NULL;
|
||||||
|
dialog = gtk_message_dialog_new (NULL, 0,
|
||||||
|
GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
|
||||||
|
"\t%s\t", _("Invalid Transactions"));
|
||||||
|
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
|
||||||
|
"%s", message);
|
||||||
|
g_signal_connect_swapped (dialog, "response",
|
||||||
|
G_CALLBACK(gtk_widget_destroy), dialog);
|
||||||
|
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||||
|
g_free (message);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gnc_sx_sxsincelast_book_opened(void)
|
gnc_sx_sxsincelast_book_opened(void)
|
||||||
{
|
{
|
||||||
GList *auto_created_txns = NULL;
|
GList *auto_created_txns = NULL;
|
||||||
|
GList *creation_errors = NULL;
|
||||||
GncSxInstanceModel *inst_model;
|
GncSxInstanceModel *inst_model;
|
||||||
GncSxSummary summary;
|
GncSxSummary summary;
|
||||||
|
|
||||||
@ -810,7 +842,8 @@ gnc_sx_sxsincelast_book_opened(void)
|
|||||||
inst_model = gnc_sx_get_current_instances();
|
inst_model = gnc_sx_get_current_instances();
|
||||||
gnc_sx_instance_model_summarize(inst_model, &summary);
|
gnc_sx_instance_model_summarize(inst_model, &summary);
|
||||||
gnc_sx_summary_print(&summary);
|
gnc_sx_summary_print(&summary);
|
||||||
gnc_sx_instance_model_effect_change(inst_model, TRUE, &auto_created_txns, NULL);
|
gnc_sx_instance_model_effect_change(inst_model, TRUE, &auto_created_txns,
|
||||||
|
&creation_errors);
|
||||||
|
|
||||||
if (summary.need_dialog)
|
if (summary.need_dialog)
|
||||||
{
|
{
|
||||||
@ -837,6 +870,8 @@ gnc_sx_sxsincelast_book_opened(void)
|
|||||||
}
|
}
|
||||||
g_list_free(auto_created_txns);
|
g_list_free(auto_created_txns);
|
||||||
g_object_unref(G_OBJECT(inst_model));
|
g_object_unref(G_OBJECT(inst_model));
|
||||||
|
if (creation_errors)
|
||||||
|
creation_error_dialog(&creation_errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1075,6 +1110,7 @@ dialog_destroy_cb(GtkWidget *object, GncSxSinceLastRunDialog *app_dialog)
|
|||||||
static void
|
static void
|
||||||
dialog_response_cb(GtkDialog *dialog, gint response_id, GncSxSinceLastRunDialog *app_dialog)
|
dialog_response_cb(GtkDialog *dialog, gint response_id, GncSxSinceLastRunDialog *app_dialog)
|
||||||
{
|
{
|
||||||
|
GList* creation_errors = NULL;
|
||||||
switch (response_id)
|
switch (response_id)
|
||||||
{
|
{
|
||||||
case GTK_RESPONSE_OK:
|
case GTK_RESPONSE_OK:
|
||||||
@ -1108,8 +1144,11 @@ dialog_response_cb(GtkDialog *dialog, gint response_id, GncSxSinceLastRunDialog
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
gnc_suspend_gui_refresh();
|
gnc_suspend_gui_refresh();
|
||||||
gnc_sx_slr_model_effect_change(app_dialog->editing_model, FALSE, &app_dialog->created_txns, NULL);
|
gnc_sx_slr_model_effect_change(app_dialog->editing_model, FALSE, &app_dialog->created_txns, &creation_errors);
|
||||||
gnc_resume_gui_refresh();
|
gnc_resume_gui_refresh();
|
||||||
|
if (creation_errors)
|
||||||
|
creation_error_dialog(&creation_errors);
|
||||||
|
|
||||||
if (gtk_toggle_button_get_active(app_dialog->review_created_txns_toggle)
|
if (gtk_toggle_button_get_active(app_dialog->review_created_txns_toggle)
|
||||||
&& g_list_length(app_dialog->created_txns) > 0)
|
&& g_list_length(app_dialog->created_txns) > 0)
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# CMakeLists.txt for src/import-export
|
# CMakeLists.txt for src/import-export
|
||||||
|
|
||||||
|
#ADD_SUBDIRECTORY(test)
|
||||||
|
|
||||||
# ############################################################
|
# ############################################################
|
||||||
IF (WITH_AQBANKING)
|
IF (WITH_AQBANKING)
|
||||||
ADD_SUBDIRECTORY(aqb)
|
ADD_SUBDIRECTORY(aqb)
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
ADD_SUBDIRECTORY(gschemas)
|
ADD_SUBDIRECTORY(gschemas)
|
||||||
|
#ADD_SUBDIRECTORY(test)
|
||||||
|
|
||||||
SET(csv_import_SOURCES
|
SET(csv_import_SOURCES
|
||||||
gncmod-csv-import.c
|
gncmod-csv-import.c
|
||||||
|
22
src/import-export/csv-imp/test/CMakeLists.txt
Normal file
22
src/import-export/csv-imp/test/CMakeLists.txt
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
SET(CSV_IMP_TEST_INCLUDE_DIRS
|
||||||
|
${CMAKE_BINARY_DIR}/src # for config.h
|
||||||
|
${CMAKE_SOURCE_DIR}/src
|
||||||
|
${CMAKE_SOURCE_DIR}/src/engine
|
||||||
|
${CMAKE_SOURCE_DIR}/src/test-core
|
||||||
|
${CMAKE_SOURCE_DIR}/src/libqof/qof
|
||||||
|
${CMAKE_SOURCE_DIR}/lib
|
||||||
|
${GLIB2_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
SET(CSV_IMP_TEST_LIBS gncmod-csv-import gncmod-engine gnc-qof test-core)
|
||||||
|
|
||||||
|
SET(test_csv_imp_SOURCES
|
||||||
|
test-csv-imp.c
|
||||||
|
utest-gnc-csv-model.c
|
||||||
|
)
|
||||||
|
|
||||||
|
GNC_ADD_TEST(test-csv-imp "${test_csv_imp_SOURCES}"
|
||||||
|
CSV_IMP_TEST_INCLUDE_DIRS CSV_IMP_TEST_LIBS
|
||||||
|
SRCDIR=${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
)
|
||||||
|
|
@ -1,4 +1,5 @@
|
|||||||
ADD_SUBDIRECTORY(gschemas)
|
ADD_SUBDIRECTORY(gschemas)
|
||||||
|
#ADD_SUBDIRECTORY(test)
|
||||||
|
|
||||||
SET(ofx_SOURCES
|
SET(ofx_SOURCES
|
||||||
gnc-ofx-import.c
|
gnc-ofx-import.c
|
||||||
@ -38,4 +39,4 @@ INSTALL(FILES ${ofx_UI} DESTINATION share/gnucash/ui)
|
|||||||
IF (GNC_BUILD_AS_INSTALL)
|
IF (GNC_BUILD_AS_INSTALL)
|
||||||
FILE(COPY ${ofx_UI}
|
FILE(COPY ${ofx_UI}
|
||||||
DESTINATION ${DATADIR_BUILD}/gnucash/ui)
|
DESTINATION ${DATADIR_BUILD}/gnucash/ui)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
8
src/import-export/ofx/test/CMakeLists.txt
Normal file
8
src/import-export/ofx/test/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
SET(OFX_TEST_INCLUDE_DIRS
|
||||||
|
${LIBOFX_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
SET(OFX_TEST_LIBS)
|
||||||
|
|
||||||
|
GNC_ADD_TEST(test-link-ofx test-link.c OFX_TEST_INCLUDE_DIRS OFX_TEST_LIBS)
|
@ -1,6 +1,7 @@
|
|||||||
# CMakeLists.txt for src/import_export/qif-imp
|
# CMakeLists.txt for src/import_export/qif-imp
|
||||||
|
|
||||||
ADD_SUBDIRECTORY(gschemas)
|
ADD_SUBDIRECTORY(gschemas)
|
||||||
|
#ADD_SUBDIRECTORY(test)
|
||||||
|
|
||||||
SET (qif_import_SOURCES
|
SET (qif_import_SOURCES
|
||||||
dialog-account-picker.c
|
dialog-account-picker.c
|
||||||
@ -87,4 +88,4 @@ IF (GNC_BUILD_AS_INSTALL)
|
|||||||
DESTINATION ${DATADIR_BUILD}/gnucash/ui)
|
DESTINATION ${DATADIR_BUILD}/gnucash/ui)
|
||||||
FILE(COPY ${qif_import_GLADE}
|
FILE(COPY ${qif_import_GLADE}
|
||||||
DESTINATION ${DATADIR_BUILD}/gnucash/gtkbuilder)
|
DESTINATION ${DATADIR_BUILD}/gnucash/gtkbuilder)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
6
src/import-export/qif-imp/test/CMakeLists.txt
Normal file
6
src/import-export/qif-imp/test/CMakeLists.txt
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
SET(QIF_IMP_TEST_INCLUDE_DIRS)
|
||||||
|
SET(QIF_IMP_TEST_LIBS)
|
||||||
|
|
||||||
|
GNC_ADD_TEST(test-link-qif-imp test-link.c QIF_IMP_TEST_INCLUDE_DIRS QIF_IMP_TEST_LIBS)
|
@ -1,4 +1,7 @@
|
|||||||
|
|
||||||
|
#Tests for this directory are not run.
|
||||||
|
##ADD_SUBDIRECTORY(test)
|
||||||
|
|
||||||
SET(qif_SOURCES
|
SET(qif_SOURCES
|
||||||
qif-context.c
|
qif-context.c
|
||||||
qif-defaults.c
|
qif-defaults.c
|
||||||
|
13
src/import-export/qif/test/CMakeLists.txt
Normal file
13
src/import-export/qif/test/CMakeLists.txt
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
SET(QIF_TEST_INCLUDE_DIRS
|
||||||
|
${CMAKE_BINARY_DIR}/src
|
||||||
|
${CMAKE_SOURCE_DIR}/src/import-export/qif
|
||||||
|
${CMAKE_SOURCE_DIR}/src/libqof/qof
|
||||||
|
${CMAKE_SOURCE_DIR}/src/test-core
|
||||||
|
${GLIB2_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
SET(QIF_TEST_LIBS gncmod-qif test-core)
|
||||||
|
|
||||||
|
GNC_ADD_TEST(test-link-qif test-link.c QIF_TEST_INCLUDE_DIRS QIF_TEST_LIBS)
|
||||||
|
GNC_ADD_TEST(test-qif test-qif.c QIF_TEST_INCLUDE_DIRS QIF_TEST_LIBS
|
||||||
|
GNC_TEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/test-files)
|
19
src/import-export/test/CMakeLists.txt
Normal file
19
src/import-export/test/CMakeLists.txt
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
SET(GENERIC_IMPORT_TEST_INCLUDE_DIRS
|
||||||
|
${CMAKE_BINARY_DIR}/src # for config.h
|
||||||
|
${CMAKE_SOURCE_DIR}/src/gnc-module
|
||||||
|
${CMAKE_SOURCE_DIR}/src/import-export
|
||||||
|
${CMAKE_SOURCE_DIR}/src/libqof/qof
|
||||||
|
${CMAKE_SOURCE_DIR}/src/test-core
|
||||||
|
${GLIB2_INCLUDE_DIRS}
|
||||||
|
${GUILE_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
SET(GENERIC_IMPORT_TEST_LIBS gncmod-generic-import gnc-qof test-core)
|
||||||
|
|
||||||
|
GNC_ADD_TEST_WITH_GUILE(test-import-parse test-import-parse.c
|
||||||
|
GENERIC_IMPORT_TEST_INCLUDE_DIRS GENERIC_IMPORT_TEST_LIBS
|
||||||
|
)
|
||||||
|
GNC_ADD_TEST(test-link-generic-import test-link.c
|
||||||
|
GENERIC_IMPORT_TEST_INCLUDE_DIRS GENERIC_IMPORT_TEST_LIBS
|
||||||
|
)
|
@ -1,5 +1,7 @@
|
|||||||
# CMakeLists.txt for src/libqof
|
# CMakeLists.txt for src/libqof
|
||||||
|
|
||||||
|
#ADD_SUBDIRECTORY(qof/test)
|
||||||
|
|
||||||
SET (gnc_qof_HEADERS
|
SET (gnc_qof_HEADERS
|
||||||
qof/gnc-aqbanking-templates.h
|
qof/gnc-aqbanking-templates.h
|
||||||
qof/gnc-date-p.h
|
qof/gnc-date-p.h
|
||||||
|
26
src/libqof/qof/test/CMakeLists.txt
Normal file
26
src/libqof/qof/test/CMakeLists.txt
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
SET(TEST_QOF_INCLUDE_DIRS
|
||||||
|
${CMAKE_BINARY_DIR}/src # for config.h
|
||||||
|
${CMAKE_SOURCE_DIR}/src/test-core # for unittest-support.h
|
||||||
|
${CMAKE_SOURCE_DIR}/src/libqof/qof # for qof.h
|
||||||
|
${GLIB2_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
SET(TEST_QOF_LIBS
|
||||||
|
gnc-qof test-core ${GLIB2_LDFLAGS} -lm
|
||||||
|
)
|
||||||
|
|
||||||
|
SET(test_qof_SOURCES
|
||||||
|
test-gnc-date.c
|
||||||
|
test-qof.c
|
||||||
|
test-qofbook.c
|
||||||
|
test-qofinstance.c
|
||||||
|
test-kvp_frame.c
|
||||||
|
test-qofobject.c
|
||||||
|
test-qofsession.c
|
||||||
|
test-qof-string-cache.c
|
||||||
|
${CMAKE_SOURCE_DIR}/src/test-core/unittest-support.c
|
||||||
|
)
|
||||||
|
|
||||||
|
GNC_ADD_TEST(test-qof "${test_qof_SOURCES}" TEST_QOF_INCLUDE_DIRS TEST_QOF_LIBS)
|
||||||
|
TARGET_COMPILE_DEFINITIONS(test-qof PRIVATE TESTPROG=test_qof)
|
@ -1,4 +1,5 @@
|
|||||||
|
|
||||||
|
#ADD_SUBDIRECTORY(test)
|
||||||
|
|
||||||
SET (ledger_core_SOURCES
|
SET (ledger_core_SOURCES
|
||||||
gnc-ledger-display.c
|
gnc-ledger-display.c
|
||||||
@ -40,4 +41,4 @@ INSTALL(TARGETS gncmod-ledger-core
|
|||||||
LIBRARY DESTINATION lib/gnucash
|
LIBRARY DESTINATION lib/gnucash
|
||||||
ARCHIVE DESTINATION lib/gnucash
|
ARCHIVE DESTINATION lib/gnucash
|
||||||
RUNTIME DESTINATION bin)
|
RUNTIME DESTINATION bin)
|
||||||
# No headers to install
|
# No headers to install
|
||||||
|
7
src/register/ledger-core/test/CMakeLists.txt
Normal file
7
src/register/ledger-core/test/CMakeLists.txt
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
SET(LEDGER_CORE_TEST_INCLUDE_DIRS "")
|
||||||
|
SET(LEDGER_CORE_TEST_LIBS)
|
||||||
|
|
||||||
|
GNC_ADD_TEST(test-link-module-ledger-core test-link-module.c
|
||||||
|
LEDGER_CORE_TEST_INCLUDE_DIRS LEDGER_CORE_TEST_LIBS
|
||||||
|
)
|
@ -1,4 +1,4 @@
|
|||||||
|
#ADD_SUBDIRECTORY(test)
|
||||||
|
|
||||||
SET (register_core_SOURCES
|
SET (register_core_SOURCES
|
||||||
gncmod-register-core.c
|
gncmod-register-core.c
|
||||||
@ -56,4 +56,4 @@ INSTALL(TARGETS gncmod-register-core
|
|||||||
ARCHIVE DESTINATION lib/gnucash
|
ARCHIVE DESTINATION lib/gnucash
|
||||||
RUNTIME DESTINATION bin)
|
RUNTIME DESTINATION bin)
|
||||||
|
|
||||||
INSTALL(FILES ${register_core_HEADERS} DESTINATION include/gnucash)
|
INSTALL(FILES ${register_core_HEADERS} DESTINATION include/gnucash)
|
||||||
|
7
src/register/register-core/test/CMakeLists.txt
Normal file
7
src/register/register-core/test/CMakeLists.txt
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
SET(REGISTER_CORE_TEST_INCLUDE_DIRS "")
|
||||||
|
SET(REGISTER_CORE_TEST_LIBS)
|
||||||
|
|
||||||
|
GNC_ADD_TEST(test-link-module-register-core test-link-module.c
|
||||||
|
REGISTER_CORE_TEST_INCLUDE_DIRS REGISTER_CORE_TEST_LIBS
|
||||||
|
)
|
@ -1,3 +1,4 @@
|
|||||||
|
#ADD_SUBDIRECTORY(test)
|
||||||
|
|
||||||
SET (register_gnome_SOURCES
|
SET (register_gnome_SOURCES
|
||||||
gncmod-register-gnome.c
|
gncmod-register-gnome.c
|
||||||
@ -55,4 +56,4 @@ INSTALL(TARGETS gncmod-register-gnome
|
|||||||
LIBRARY DESTINATION lib/gnucash
|
LIBRARY DESTINATION lib/gnucash
|
||||||
ARCHIVE DESTINATION lib/gnucash
|
ARCHIVE DESTINATION lib/gnucash
|
||||||
RUNTIME DESTINATION bin)
|
RUNTIME DESTINATION bin)
|
||||||
# No headers to install
|
# No headers to install
|
||||||
|
7
src/register/register-gnome/test/CMakeLists.txt
Normal file
7
src/register/register-gnome/test/CMakeLists.txt
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
SET(REGISTER_GNOME_TEST_INCLUDE_DIRS "")
|
||||||
|
SET(REGISTER_GNOME_TEST_LIBS)
|
||||||
|
|
||||||
|
GNC_ADD_TEST(test-link-module-register-gnome test-link-module.c
|
||||||
|
REGISTER_GNOME_TEST_INCLUDE_DIRS REGISTER_GNOME_TEST_LIBS
|
||||||
|
)
|
@ -1,4 +1,4 @@
|
|||||||
|
#ADD_SUBDIRECTORY(test)
|
||||||
|
|
||||||
SET(locale_reports_us_SOURCES
|
SET(locale_reports_us_SOURCES
|
||||||
gncmod-locale-reports-us.c
|
gncmod-locale-reports-us.c
|
||||||
@ -51,4 +51,4 @@ GNC_ADD_SCHEME_TARGETS(scm-report-locale-specific-2
|
|||||||
"${GUILE_LIBRARY_DIRS}"
|
"${GUILE_LIBRARY_DIRS}"
|
||||||
"scm-report-locale-specific-1;${GUILE_DEPENDS}"
|
"scm-report-locale-specific-1;${GUILE_DEPENDS}"
|
||||||
FALSE
|
FALSE
|
||||||
)
|
)
|
||||||
|
11
src/report/locale-specific/us/test/CMakeLists.txt
Normal file
11
src/report/locale-specific/us/test/CMakeLists.txt
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
SET(LOCALE_SPECIFIC_US_TEST_INCLUDE_DIRS "")
|
||||||
|
SET(LOCALE_SPECIFIC_US_TEST_LIBS)
|
||||||
|
|
||||||
|
GNC_ADD_TEST(test-link-module-report-locale-specific-us test-link-module.c
|
||||||
|
LOCALE_SPECIFIC_US_TEST_INCLUDE_DIRS LOCALE_SPECIFIC_US_TEST_LIBS
|
||||||
|
)
|
||||||
|
|
||||||
|
# This test not run in the autotools build.
|
||||||
|
#GNC_ADD_SCHEME_TEST(test-load-module-report-locale-specific-us
|
||||||
|
# test-load-module.in
|
||||||
|
#)
|
@ -1,4 +1,4 @@
|
|||||||
|
#ADD_SUBDIRECTORY(test)
|
||||||
|
|
||||||
SET (report_gnome_HEADERS
|
SET (report_gnome_HEADERS
|
||||||
dialog-report-column-view.h
|
dialog-report-column-view.h
|
||||||
@ -74,4 +74,4 @@ IF (GNC_BUILD_AS_INSTALL)
|
|||||||
DESTINATION ${DATADIR_BUILD}/gnucash/ui)
|
DESTINATION ${DATADIR_BUILD}/gnucash/ui)
|
||||||
FILE(COPY ${report_gnome_GLADE}
|
FILE(COPY ${report_gnome_GLADE}
|
||||||
DESTINATION ${DATADIR_BUILD}/gnucash/gtkbuilder)
|
DESTINATION ${DATADIR_BUILD}/gnucash/gtkbuilder)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
14
src/report/report-gnome/test/CMakeLists.txt
Normal file
14
src/report/report-gnome/test/CMakeLists.txt
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
SET(REPORT_GNOME_TEST_INCLUDE_DIRS
|
||||||
|
${CMAKE_SOURCE_DIR}/src/gnc-module
|
||||||
|
${GUILE_INCLUDE_DIRS}
|
||||||
|
|
||||||
|
)
|
||||||
|
SET(REPORT_GNOME_TEST_LIBS gnc-module)
|
||||||
|
|
||||||
|
GNC_ADD_TEST_WITH_GUILE(test-link-module-report-gnome test-link-module.c
|
||||||
|
REPORT_GNOME_TEST_INCLUDE_DIRS REPORT_GNOME_TEST_LIBS
|
||||||
|
)
|
||||||
|
|
||||||
|
GNC_ADD_SCHEME_TEST(test-load-module-report-gnome
|
||||||
|
test-load-module.in
|
||||||
|
)
|
@ -1,3 +1,4 @@
|
|||||||
|
#ADD_SUBDIRECTORY(test)
|
||||||
|
|
||||||
SET (report_system_HEADERS
|
SET (report_system_HEADERS
|
||||||
gnc-report.h
|
gnc-report.h
|
||||||
|
26
src/report/report-system/test/CMakeLists.txt
Normal file
26
src/report/report-system/test/CMakeLists.txt
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
SET(REPORT_SYSTEM_TEST_INCLUDE_DIRS
|
||||||
|
${CMAKE_SOURCE_DIR}/src/gnc-module
|
||||||
|
${GUILE_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
SET(REPORT_SYSTEM_TEST_LIBS gnc-module)
|
||||||
|
|
||||||
|
GNC_ADD_TEST_WITH_GUILE(test-link-module-report-system test-link-module.c
|
||||||
|
REPORT_SYSTEM_TEST_INCLUDE_DIRS REPORT_SYSTEM_TEST_LIBS
|
||||||
|
)
|
||||||
|
|
||||||
|
GNC_ADD_SCHEME_TEST(test-load-module-report-system test-load-module.in)
|
||||||
|
GNC_ADD_SCHEME_TEST(test-collectors test-collectors.scm)
|
||||||
|
GNC_ADD_SCHEME_TEST(test-list-extras test-list-extras.scm)
|
||||||
|
GNC_ADD_SCHEME_TEST(test-report-utilities test-report-utilities.scm)
|
||||||
|
# This test is not run in the autotools build.
|
||||||
|
#GNC_ADD_SCHEME_TEST(test-test-extras test-test-extras.scm)
|
||||||
|
|
||||||
|
GNC_ADD_SCHEME_TARGETS(scm-test-report-system
|
||||||
|
test-extras.scm
|
||||||
|
gnucash/report/report-system/test
|
||||||
|
""
|
||||||
|
""
|
||||||
|
""
|
||||||
|
"scm-gnc-module;scm-test-engine;scm-report-system-3"
|
||||||
|
FALSE
|
||||||
|
)
|
@ -1,4 +1,6 @@
|
|||||||
|
|
||||||
|
#ADD_SUBDIRECTORY(test)
|
||||||
|
|
||||||
SET(standard_reports_SOURCES gncmod-standard-reports.c)
|
SET(standard_reports_SOURCES gncmod-standard-reports.c)
|
||||||
|
|
||||||
ADD_LIBRARY (gncmod-standard-reports ${standard_reports_SOURCES})
|
ADD_LIBRARY (gncmod-standard-reports ${standard_reports_SOURCES})
|
||||||
@ -81,4 +83,4 @@ FILE(MAKE_DIRECTORY ${STD_RPT_DIR})
|
|||||||
FILE(COPY standard-reports.scm DESTINATION ${STD_RPT_DIR})
|
FILE(COPY standard-reports.scm DESTINATION ${STD_RPT_DIR})
|
||||||
|
|
||||||
FILE(MAKE_DIRECTORY ${STD_RPT_DIR}/standard-reports)
|
FILE(MAKE_DIRECTORY ${STD_RPT_DIR}/standard-reports)
|
||||||
FILE(COPY ${standard_reports_SCHEME_2} DESTINATION ${STD_RPT_DIR}/standard-reports)
|
FILE(COPY ${standard_reports_SCHEME_2} DESTINATION ${STD_RPT_DIR}/standard-reports)
|
||||||
|
22
src/report/standard-reports/test/CMakeLists.txt
Normal file
22
src/report/standard-reports/test/CMakeLists.txt
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
GNC_ADD_SCHEME_TEST(test-cash-flow test-cash-flow.scm)
|
||||||
|
GNC_ADD_SCHEME_TEST(test-standard-category-report test-standard-category-report.scm)
|
||||||
|
GNC_ADD_SCHEME_TEST(test-standard-net-barchart test-standard-net-barchart.scm)
|
||||||
|
GNC_ADD_SCHEME_TEST(test-standard-net-linechart test-standard-net-linechart.scm)
|
||||||
|
GNC_ADD_SCHEME_TEST(test-load-module-report-standard-reports test-load-module.in)
|
||||||
|
|
||||||
|
SET(scm_test_standard_reports_SOURCES
|
||||||
|
test-generic-category-report.scm
|
||||||
|
test-generic-net-barchart.scm
|
||||||
|
test-generic-net-linechart.scm
|
||||||
|
)
|
||||||
|
|
||||||
|
GNC_ADD_SCHEME_TARGETS(scm-test-standard-reports
|
||||||
|
"${scm_test_standard_reports_SOURCES}"
|
||||||
|
gnucash/report/standard-reports/test
|
||||||
|
""
|
||||||
|
""
|
||||||
|
""
|
||||||
|
"scm-gnc-module;scm-test-report-system"
|
||||||
|
FALSE
|
||||||
|
)
|
@ -1,3 +1,4 @@
|
|||||||
|
#ADD_SUBDIRECTORY(test)
|
||||||
|
|
||||||
SET(stylesheets_SOURCES
|
SET(stylesheets_SOURCES
|
||||||
gnc-plugin-stylesheets.c
|
gnc-plugin-stylesheets.c
|
||||||
|
4
src/report/stylesheets/test/CMakeLists.txt
Normal file
4
src/report/stylesheets/test/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
GNC_ADD_SCHEME_TEST(test-load-module-report-stylesheets
|
||||||
|
test-load-module.in
|
||||||
|
)
|
@ -1,4 +1,4 @@
|
|||||||
|
#ADD_SUBDIRECTORY(test)
|
||||||
|
|
||||||
SET(utility_reports_SOURCES
|
SET(utility_reports_SOURCES
|
||||||
gncmod-utility-reports.c
|
gncmod-utility-reports.c
|
||||||
|
4
src/report/utility-reports/test/CMakeLists.txt
Normal file
4
src/report/utility-reports/test/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
GNC_ADD_SCHEME_TEST(test-load-module-report-utility-reports
|
||||||
|
test-load-module.in
|
||||||
|
)
|
@ -1,3 +1,5 @@
|
|||||||
|
#ADD_SUBDIRECTORY(test)
|
||||||
|
|
||||||
SET(tax_us_SOURCES gncmod-tax-us.c)
|
SET(tax_us_SOURCES gncmod-tax-us.c)
|
||||||
|
|
||||||
# Add dependency on config.h
|
# Add dependency on config.h
|
||||||
|
9
src/tax/us/test/CMakeLists.txt
Normal file
9
src/tax/us/test/CMakeLists.txt
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
SET(TAX_US_TEST_INCLUDE_DIRS "")
|
||||||
|
SET(TAX_US_TEST_LIBS "")
|
||||||
|
|
||||||
|
GNC_ADD_TEST(test-link-module-tax-us test-link-module.c
|
||||||
|
TAX_US_TEST_INCLUDE_DIRS TAX_US_TEST_LIBS
|
||||||
|
)
|
||||||
|
|
||||||
|
# This test not run in autotools build.
|
||||||
|
#GNC_ADD_SCHEME_TEST(test-load-module-tax-us test-load-module.in)
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
SET(test_core_SOURCES
|
SET(test_core_SOURCES
|
||||||
test-stuff.c
|
test-stuff.c
|
||||||
unittest-support.c
|
unittest-support.c
|
||||||
@ -19,8 +18,11 @@ INCLUDE_DIRECTORIES(
|
|||||||
${GUILE_INCLUDE_DIRS}
|
${GUILE_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_LIBRARY(test-core ${test_core_SOURCES} ${test_core_noinst_HEADERS})
|
ADD_LIBRARY(test-core STATIC ${test_core_SOURCES} ${test_core_noinst_HEADERS})
|
||||||
TARGET_LINK_LIBRARIES(test-core gnc-qof ${GLIB2_LDFLAGS})
|
TARGET_LINK_LIBRARIES(test-core gncmod-engine gnc-qof ${GLIB2_LDFLAGS})
|
||||||
|
IF (UNIX)
|
||||||
|
TARGET_COMPILE_OPTIONS(test-core PRIVATE -fPIC)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
SET (SWIG_UNITTEST_SUPPORT_GUILE_C ${CMAKE_CURRENT_BINARY_DIR}/swig-unittest-support-guile.c)
|
SET (SWIG_UNITTEST_SUPPORT_GUILE_C ${CMAKE_CURRENT_BINARY_DIR}/swig-unittest-support-guile.c)
|
||||||
GNC_ADD_SWIG_COMMAND (${SWIG_UNITTEST_SUPPORT_GUILE_C}
|
GNC_ADD_SWIG_COMMAND (${SWIG_UNITTEST_SUPPORT_GUILE_C}
|
||||||
@ -41,7 +43,7 @@ SET(GUILE_LIBRARY_DIRS src/test-core src/libqof)
|
|||||||
SET(GUILE_DEPENDS test-core-guile)
|
SET(GUILE_DEPENDS test-core-guile)
|
||||||
|
|
||||||
|
|
||||||
GNC_ADD_SCHEME_TARGETS(scm_test_core
|
GNC_ADD_SCHEME_TARGETS(scm-test-core
|
||||||
${test_core_SCHEME}
|
${test_core_SCHEME}
|
||||||
${GUILE_OUTPUT_DIR}
|
${GUILE_OUTPUT_DIR}
|
||||||
"${GUILE_MODULES}"
|
"${GUILE_MODULES}"
|
||||||
@ -51,4 +53,4 @@ GNC_ADD_SCHEME_TARGETS(scm_test_core
|
|||||||
FALSE
|
FALSE
|
||||||
)
|
)
|
||||||
|
|
||||||
INSTALL(FILES unittest-support.h DESTINATION libexec/gnucash/src/libqof/qof/test)
|
INSTALL(FILES unittest-support.h DESTINATION libexec/gnucash/src/libqof/qof/test)
|
||||||
|
Loading…
Reference in New Issue
Block a user