mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Convert shell-executed scheme tests to run directly from Guile.
I.e., remove the shell invocation and with it the need to set the shebang. Surprisingly this required some build-system modifications particularly for cmake in order to correctly set the environment.
This commit is contained in:
parent
f412795ef2
commit
6c01e54042
@ -162,7 +162,7 @@ FUNCTION(GNC_ADD_SCHEME_TARGETS _TARGET _SOURCE_FILES _OUTPUT_DIR _GUILE_DEPENDS
|
||||
${GUILE_EXECUTABLE} -e '\(@@ \(guild\) main\)' -s ${GUILD_EXECUTABLE} compile -o ${output_file} ${source_file_abs_path}
|
||||
DEPENDS ${guile_depends}
|
||||
MAIN_DEPENDENCY ${source_file_abs_path}
|
||||
)
|
||||
)
|
||||
ENDFOREACH(source_file)
|
||||
IF (__DEBUG)
|
||||
MESSAGE("TARGET_FILES are ${_TARGET_FILES}")
|
||||
|
@ -44,7 +44,6 @@ SET(COPY_FROM_BUILD
|
||||
libgnucash/app-utils/migratable-prefs.xml
|
||||
libgnucash/app-utils/swig-app-utils-guile.c
|
||||
libgnucash/app-utils/swig-app-utils-python.c
|
||||
libgnucash/app-utils/test/test-load-module
|
||||
libgnucash/backend/xml/test/test-real-data.sh
|
||||
gnucash/gnucash.rc
|
||||
gnucash/overrides/gnucash-make-guids
|
||||
@ -55,31 +54,18 @@ SET(COPY_FROM_BUILD
|
||||
libgnucash/doc/design/gnucash-design.info
|
||||
libgnucash/engine/iso-4217-currencies.c
|
||||
libgnucash/engine/swig-engine.c
|
||||
libgnucash/engine/test/test-create-account
|
||||
libgnucash/engine/test/test-scm-query-import
|
||||
libgnucash/gnc-module/swig-gnc-module.c
|
||||
libgnucash/gnc-module/test/mod-bar/swig-bar.c
|
||||
libgnucash/gnc-module/test/mod-baz/swig-baz.c
|
||||
libgnucash/gnc-module/test/mod-foo/swig-foo.c
|
||||
libgnucash/gnc-module/test/test-gwrapped-c
|
||||
libgnucash/gnc-module/test/test-load-deps
|
||||
libgnucash/gnc-module/test/test-load-scm
|
||||
libgnucash/gnc-module/test/test-scm-dynload
|
||||
libgnucash/gnc-module/test/test-scm-init
|
||||
libgnucash/gnc-module/test/test-scm-module
|
||||
libgnucash/gnc-module/test/test-scm-multi
|
||||
gnucash/gnome/gnucash.desktop.in
|
||||
gnucash/gnome/swig-gnome.c
|
||||
gnucash/gnome-utils/gnc-warnings.c
|
||||
gnucash/gnome-utils/swig-gnome-utils.c
|
||||
gnucash/gnome-utils/test/test-load-module
|
||||
gnucash/html/swig-gnc-html.c
|
||||
bindings/python/gnucash_core.c
|
||||
gnucash/report/report-gnome/swig-report-gnome.c
|
||||
gnucash/report/report-gnome/test/test-load-module
|
||||
gnucash/report/report-system/swig-report-system.c
|
||||
gnucash/report/report-system/test/test-load-module
|
||||
gnucash/report/stylesheets/test/test-load-module
|
||||
libgnucash/scm/build-config.scm
|
||||
common/swig-runtime.h
|
||||
common/test-core/swig-unittest-support-guile.c
|
||||
|
32
configure.ac
32
configure.ac
@ -1777,42 +1777,10 @@ AC_CONFIG_FILES(
|
||||
dnl # init-commands go here
|
||||
)
|
||||
dnl # Shell scripts, to have their shells set
|
||||
AC_CONFIG_FILES([libgnucash/app-utils/test/test-load-module],
|
||||
[chmod +x libgnucash/app-utils/test/test-load-module])
|
||||
AC_CONFIG_FILES([libgnucash/backend/xml/test/test-real-data.sh],
|
||||
[chmod +x libgnucash/backend/xml/test/test-real-data.sh])
|
||||
AC_CONFIG_FILES([gnucash/test/test-version],
|
||||
[chmod +x gnucash/test/test-version])
|
||||
AC_CONFIG_FILES([libgnucash/engine/test/test-create-account],
|
||||
[chmod +x libgnucash/engine/test/test-create-account])
|
||||
AC_CONFIG_FILES([libgnucash/engine/test/test-scm-query-import],
|
||||
[chmod +x libgnucash/engine/test/test-scm-query-import])
|
||||
AC_CONFIG_FILES([libgnucash/gnc-module/test/test-gwrapped-c],
|
||||
[chmod +x libgnucash/gnc-module/test/test-gwrapped-c])
|
||||
AC_CONFIG_FILES([libgnucash/gnc-module/test/test-load-deps],
|
||||
[chmod +x libgnucash/gnc-module/test/test-load-deps])
|
||||
AC_CONFIG_FILES([libgnucash/gnc-module/test/test-load-scm],
|
||||
[chmod +x libgnucash/gnc-module/test/test-load-scm])
|
||||
AC_CONFIG_FILES([libgnucash/gnc-module/test/test-scm-dynload],
|
||||
[chmod +x libgnucash/gnc-module/test/test-scm-dynload])
|
||||
AC_CONFIG_FILES([libgnucash/gnc-module/test/test-scm-init],
|
||||
[chmod +x libgnucash/gnc-module/test/test-scm-init])
|
||||
AC_CONFIG_FILES([libgnucash/gnc-module/test/test-scm-module],
|
||||
[chmod +x libgnucash/gnc-module/test/test-scm-module])
|
||||
AC_CONFIG_FILES([libgnucash/gnc-module/test/test-scm-multi],
|
||||
[chmod +x libgnucash/gnc-module/test/test-scm-multi])
|
||||
AC_CONFIG_FILES([gnucash/gnome-utils/test/test-load-module],
|
||||
[chmod +x gnucash/gnome-utils/test/test-load-module])
|
||||
AC_CONFIG_FILES([gnucash/report/locale-specific/us/test/test-load-module],
|
||||
[chmod +x gnucash/report/locale-specific/us/test/test-load-module])
|
||||
AC_CONFIG_FILES([gnucash/report/report-gnome/test/test-load-module],
|
||||
[chmod +x gnucash/report/report-gnome/test/test-load-module])
|
||||
AC_CONFIG_FILES([gnucash/report/report-system/test/test-load-module],
|
||||
[chmod +x gnucash/report/report-system/test/test-load-module])
|
||||
AC_CONFIG_FILES([gnucash/report/stylesheets/test/test-load-module],
|
||||
[chmod +x gnucash/report/stylesheets/test/test-load-module])
|
||||
AC_CONFIG_FILES([libgnucash/tax/us/test/test-load-module],
|
||||
[chmod +x libgnucash/tax/us/test/test-load-module])
|
||||
|
||||
# A few files need extra actions at creation time
|
||||
AC_CONFIG_FILES([gnucash/overrides/gnucash-make-guids], [chmod u+x gnucash/overrides/gnucash-make-guids])
|
||||
|
@ -27,9 +27,22 @@ SET(GNOME_UTILS_GUI_TEST_LIBS
|
||||
# GNOME_UTILS_GUI_TEST_INCLUDE_DIRS
|
||||
# GNOME_UTILS_GUI_TEST_LIBS
|
||||
#
|
||||
SET(GUILE_DEPENDS
|
||||
test-core
|
||||
gncmod-test-engine
|
||||
gncmod-app-utils
|
||||
gnc-core-utils
|
||||
gncmod-engine
|
||||
)
|
||||
|
||||
GNC_ADD_SCHEME_TEST(test-load-module-gnome-utils test-load-module.in)
|
||||
GNC_ADD_SCHEME_TARGETS(scm-test-load-gnome-utils-module
|
||||
"test-load-gnome-utils-module.scm"
|
||||
"gnucash/reports"
|
||||
"${GUILE_DEPENDS}"
|
||||
FALSE
|
||||
)
|
||||
|
||||
CONFIGURE_FILE(test-load-module.in test-load-module @ONLY)
|
||||
GNC_ADD_SCHEME_TESTS(test-load-gnome-utils-module.scm)
|
||||
|
||||
SET_DIST_LIST(test_gnome_utils_DIST CMakeLists.txt Makefile.am test-gnc-recurrence.c test-link-module.c test-load-module.in)
|
||||
|
||||
SET_DIST_LIST(test_gnome_utils_DIST CMakeLists.txt Makefile.am test-gnc-recurrence.c test-link-module.c test-load-report-gnome-module.scm)
|
||||
|
@ -1,5 +1,5 @@
|
||||
TESTS = \
|
||||
test-link-module test-load-module
|
||||
test-link-module ${SCM_TESTS}
|
||||
|
||||
# The following tests are nice, but have absolutely no place in an
|
||||
# automated testing system.
|
||||
@ -67,8 +67,17 @@ test_link_module_LDADD = \
|
||||
${GLIB_LIBS} \
|
||||
${top_builddir}/libgnucash/gnc-module/libgnc-module.la
|
||||
|
||||
SCM_TESTS = test-load-gnome-utils-module
|
||||
SCM_TEST_SRCS = $(SCM_TESTS:%=%.scm)
|
||||
|
||||
$(SCM_TESTS): %: $(srcdir)/%.scm Makefile
|
||||
echo 'export GNC_BUILDDIR="${abs_top_builddir}";' > $@
|
||||
echo 'export GNC_UNINSTALLED=yes;' >> $@
|
||||
echo '${GUILE} --debug -l $(srcdir)/$*.scm -c "(exit (run-test))"' >> $@
|
||||
chmod a+x $@
|
||||
|
||||
EXTRA_DIST = \
|
||||
test-load-module \
|
||||
${SCM_TEST_SRCS} \
|
||||
CMakeLists.txt
|
||||
|
||||
testit:
|
||||
|
@ -1,7 +1,3 @@
|
||||
#! @SHELL@
|
||||
exec ${GUILE} -s $0
|
||||
!#
|
||||
|
||||
(setenv "GNC_UNINSTALLED" "1")
|
||||
(use-modules (gnucash gnc-module))
|
||||
(gnc:module-system-init)
|
@ -1,6 +1,5 @@
|
||||
TESTS = \
|
||||
test-link-module
|
||||
# test-load-module
|
||||
|
||||
#GNC_TEST_DEPS := \
|
||||
#
|
||||
@ -19,6 +18,5 @@ test_link_module_LDADD=\
|
||||
../libgncmod-register-core.la
|
||||
|
||||
EXTRA_DIST = CMakeLists.txt
|
||||
# test-load-module
|
||||
|
||||
AM_CPPFLAGS = ${GLIB_CFLAGS} -I${top_srcdir}/common/test-core -I..
|
||||
|
@ -1,6 +1,5 @@
|
||||
TESTS = \
|
||||
test-link-module
|
||||
# test-load-module
|
||||
|
||||
#GNC_TEST_DEPS := \
|
||||
#
|
||||
@ -19,6 +18,5 @@ test_link_module_LDADD = \
|
||||
../libgncmod-register-gnome.la
|
||||
|
||||
EXTRA_DIST = CMakeLists.txt
|
||||
# test-load-module
|
||||
|
||||
AM_CPPFLAGS = -I${top_srcdir}/common/test-core -I.. ${GLIB_CFLAGS}
|
||||
|
@ -6,8 +6,19 @@ GNC_ADD_TEST(test-link-module-report-locale-specific-us test-link-module.c
|
||||
)
|
||||
|
||||
# This test not run in the autotools build.
|
||||
#GNC_ADD_SCHEME_TEST(test-load-module-report-locale-specific-us
|
||||
# test-load-module.in
|
||||
#SET(GUILE_DEPENDS
|
||||
# gncmod-app-utils
|
||||
# gnc-core-utils
|
||||
# gnc-module
|
||||
# gncmod-engine
|
||||
#)
|
||||
#
|
||||
#GNC_ADD_SCHEME_TARGETS(test-load-report-locale-specific-module
|
||||
# "test-load-report-locale-specific-module.scm"
|
||||
# "gnucash/report"
|
||||
# "${GUILE_DEPENDS}"
|
||||
# FALSE
|
||||
# )
|
||||
#GNC_ADD_SCHEME_TESTS(test-load-report-locale-specific-us-module.scm)
|
||||
|
||||
SET_DIST_LIST(test_locale_specific_us_DIST CMakeLists.txt Makefile.am test-link-module.c test-load-module.in)
|
||||
SET_DIST_LIST(test_locale_specific_us_DIST CMakeLists.txt Makefile.am test-link-module.c test-load-report-locale-specific-module.scm)
|
||||
|
@ -1,7 +1,3 @@
|
||||
#! @SHELL@
|
||||
exec ${GUILE} -s $0
|
||||
!#
|
||||
|
||||
(use-modules (gnucash gnc-module))
|
||||
(gnc:module-system-init)
|
||||
|
||||
@ -16,4 +12,3 @@ exec ${GUILE} -s $0
|
||||
(begin
|
||||
(display "failed\n")
|
||||
(exit -1)))
|
||||
|
@ -9,11 +9,21 @@ 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
|
||||
SET(GUILE_DEPENDS
|
||||
scm-app-utils
|
||||
gncmod-gnome-utils
|
||||
gnc-module
|
||||
gncmod-engine
|
||||
gncmod-report-gnome
|
||||
)
|
||||
|
||||
CONFIGURE_FILE(test-load-module.in test-load-module @ONLY)
|
||||
GNC_ADD_SCHEME_TARGETS(scm-test-load-report-gnome-module
|
||||
"test-load-report-gnome-module.scm"
|
||||
"gnucash/reports"
|
||||
"${GUILE_DEPENDS}"
|
||||
FALSE
|
||||
)
|
||||
GNC_ADD_SCHEME_TESTS(test-load-report-gnome-module.scm)
|
||||
|
||||
SET_DIST_LIST(test_report_gnome_DIST CMakeLists.txt Makefile.am test-link-module.c test-load-module.in)
|
||||
SET_DIST_LIST(test_report_gnome_DIST CMakeLists.txt Makefile.am test-link-module.c test-load-report-gnome-module.scm)
|
||||
|
||||
|
@ -18,7 +18,7 @@ LDADD = \
|
||||
|
||||
TESTS = \
|
||||
test-link-module \
|
||||
test-load-module
|
||||
${SCM_TESTS}
|
||||
|
||||
GNC_TEST_DEPS = --gnc-module-dir ${top_builddir}/libgnucash/engine \
|
||||
--gnc-module-dir ${top_builddir}/libgnucash/app-utils \
|
||||
@ -60,6 +60,15 @@ TESTS_ENVIRONMENT = \
|
||||
$(shell ${abs_top_srcdir}/common/gnc-test-env.pl --noexports ${GNC_TEST_DEPS})
|
||||
|
||||
|
||||
SCM_TESTS = test-load-report-gnome-module
|
||||
SCM_TEST_SRCS = $(SCM_TESTS:%=%.scm)
|
||||
|
||||
$(SCM_TESTS): %: $(srcdir)/%.scm Makefile
|
||||
echo 'export GNC_BUILDDIR="${abs_top_builddir}";' > $@
|
||||
echo 'export GNC_UNINSTALLED=yes;' >> $@
|
||||
echo '${GUILE} --debug -l $(srcdir)/$*.scm -c "(exit (run-test))"' >> $@
|
||||
chmod a+x $@
|
||||
|
||||
check_PROGRAMS = test-link-module
|
||||
|
||||
EXTRA_DIST = test-load-module CMakeLists.txt
|
||||
EXTRA_DIST = ${SCM_TEST_SRCS} CMakeLists.txt
|
||||
|
@ -10,6 +10,7 @@ GNC_ADD_TEST_WITH_GUILE(test-link-module-report-system test-link-module.c
|
||||
)
|
||||
|
||||
SET(scm_test_report_system_SOURCES
|
||||
test-load-report-system-module.scm
|
||||
test-collectors.scm
|
||||
test-list-extras.scm
|
||||
test-report-utilities.scm
|
||||
@ -17,7 +18,6 @@ SET(scm_test_report_system_SOURCES
|
||||
)
|
||||
|
||||
GNC_ADD_SCHEME_TESTS(${scm_test_report_system_SOURCES})
|
||||
GNC_ADD_SCHEME_TEST(test-load-module-report-system test-load-module.in)
|
||||
|
||||
GNC_ADD_SCHEME_TARGETS(scm-test-report-system
|
||||
"test-extras.scm"
|
||||
@ -33,7 +33,13 @@ GNC_ADD_SCHEME_TARGETS(scm-test-report-system-2
|
||||
FALSE
|
||||
)
|
||||
|
||||
CONFIGURE_FILE(test-load-module.in test-load-module @ONLY)
|
||||
|
||||
SET_DIST_LIST(test_report_system_DIST CMakeLists.txt Makefile.am test-collectors.scm test-extras.scm test-link-module.c
|
||||
test-load-module.in test-report-utilities.scm test-list-extras.scm)
|
||||
SET_DIST_LIST(test_report_system_DIST
|
||||
CMakeLists.txt
|
||||
Makefile.am
|
||||
test-collectors.scm
|
||||
test-extras.scm
|
||||
test-link-module.c
|
||||
test-report-utilities.scm
|
||||
test-list-extras.scm
|
||||
)
|
||||
|
@ -15,10 +15,10 @@ LDADD = \
|
||||
|
||||
TESTS = \
|
||||
test-link-module \
|
||||
test-load-module \
|
||||
$(SCM_TESTS)
|
||||
|
||||
SCM_TESTS = \
|
||||
test-load-report-system-module \
|
||||
test-collectors \
|
||||
test-list-extras \
|
||||
test-report-utilities
|
||||
@ -74,7 +74,6 @@ check_PROGRAMS = test-link-module
|
||||
SCM_TEST_HELPERS = test-extras.scm
|
||||
|
||||
EXTRA_DIST = \
|
||||
test-load-module \
|
||||
$(SCM_TEST_HELPERS) \
|
||||
$(SCM_TEST_SRCS) \
|
||||
CMakeLists.txt
|
||||
|
@ -1,7 +1,3 @@
|
||||
#! @SHELL@
|
||||
exec ${GUILE} -s "$0"
|
||||
!#
|
||||
|
||||
(debug-enable 'debug)
|
||||
(debug-enable 'backtrace)
|
||||
|
||||
@ -23,7 +19,3 @@ exec ${GUILE} -s "$0"
|
||||
(begin
|
||||
(display "failed\n")
|
||||
(exit -1)))
|
||||
|
||||
|
||||
|
||||
|
@ -1,17 +1,30 @@
|
||||
SET(scm_test_standard_reports_SOURCES
|
||||
test-cash-flow.scm
|
||||
test-cashflow-barchart.scm
|
||||
test-standard-category-report.scm
|
||||
test-standard-net-barchart.scm
|
||||
test-standard-net-linechart.scm
|
||||
)
|
||||
|
||||
SET(scm_test_report_SUPPORT
|
||||
test-generic-category-report.scm
|
||||
test-generic-net-barchart.scm
|
||||
test-generic-net-linechart.scm
|
||||
)
|
||||
)
|
||||
|
||||
GNC_ADD_SCHEME_TESTS(${scm_test_standard_reports_SOURCES})
|
||||
|
||||
GNC_ADD_SCHEME_TESTS("${scm_test_standard_reports_SOURCES}")
|
||||
|
||||
GNC_ADD_SCHEME_TARGETS(scm-test-standard-support
|
||||
"${scm_test_report_SUPPORT}"
|
||||
"gnucash/report/standard-reports/test"
|
||||
"scm-gnc-module;scm-test-report-system;scm-standard-reports;scm-report-stylesheets-2"
|
||||
FALSE
|
||||
)
|
||||
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;scm-standard-reports;scm-report-stylesheets-2"
|
||||
scm-test-standard-support
|
||||
FALSE
|
||||
)
|
||||
|
||||
|
@ -7,6 +7,10 @@ SCM_TESTS = \
|
||||
test-standard-net-barchart \
|
||||
test-standard-net-linechart
|
||||
|
||||
# test-generic-category-report.scm,test-generic-net-barchart, and
|
||||
# test-generic-net-linechart are support files used by the respective
|
||||
# test-standard-*
|
||||
|
||||
SCM_TEST_SRCS = $(SCM_TESTS:%=%.scm)
|
||||
|
||||
GNC_TEST_DEPS = \
|
||||
|
@ -1,6 +1,24 @@
|
||||
CONFIGURE_FILE(test-load-module.in test-load-module @ONLY)
|
||||
GNC_ADD_SCHEME_TEST(test-load-module-report-stylesheets
|
||||
test-load-module.in
|
||||
SET(GUILE_DEPENDS
|
||||
test-core
|
||||
gncmod-app-utils
|
||||
gnc-core-utils
|
||||
gnc-module
|
||||
gncmod-engine
|
||||
gncmod-backend-xml
|
||||
gncmod-backend-xml
|
||||
gncmod-gnome-utils
|
||||
gncmod-html
|
||||
gncmod-report-system
|
||||
gncmod-report-gnome
|
||||
)
|
||||
|
||||
SET_DIST_LIST(test_stylesheets_DIST CMakeLists.txt Makefile.am test-load-module.in)
|
||||
GNC_ADD_SCHEME_TARGETS(scm-test-load-report-stylesheets-module
|
||||
"test-load-report-stylesheets-module.scm"
|
||||
"gnucash/report"
|
||||
"${GUILE_DEPENDS}"
|
||||
FALSE
|
||||
)
|
||||
|
||||
GNC_ADD_SCHEME_TESTS("test-load-report-stylesheets-module.scm")
|
||||
|
||||
SET_DIST_LIST(test_stylesheets_DIST CMakeLists.txt Makefile.am test-load-report-stylesheets-module.scm)
|
||||
|
@ -1,4 +1,4 @@
|
||||
TESTS=test-load-module
|
||||
TESTS = ${SCM_TESTS}
|
||||
|
||||
GNC_TEST_DEPS = --gnc-module-dir ${top_builddir}/libgnucash/engine \
|
||||
--gnc-module-dir ${top_builddir}/libgnucash/app-utils \
|
||||
@ -35,4 +35,15 @@ TESTS_ENVIRONMENT = \
|
||||
GNC_BUILDDIR="${abs_top_builddir}" \
|
||||
$(shell ${abs_top_srcdir}/common/gnc-test-env.pl --noexports ${GNC_TEST_DEPS})
|
||||
|
||||
EXTRA_DIST = test-load-module CMakeLists.txt
|
||||
SCM_TESTS = test-load-report-stylesheets-module
|
||||
SCM_TEST_SRCS = $(SCM_TESTS:%=%.scm)
|
||||
|
||||
$(SCM_TESTS): %: $(srcdir)/%.scm Makefile
|
||||
echo 'export GNC_BUILDDIR="${abs_top_builddir}";' > $@
|
||||
echo 'export GNC_UNINSTALLED=yes;' >> $@
|
||||
echo '${GUILE} --debug -l $(srcdir)/$*.scm -c "(exit (run-test))"' >> $@
|
||||
chmod a+x $@
|
||||
|
||||
EXTRA_DIST = \
|
||||
${SCM_TEST_SRCS} \
|
||||
CMakeLists.txt
|
||||
|
@ -1,7 +1,3 @@
|
||||
#! @SHELL@
|
||||
exec ${GUILE} -s "$0"
|
||||
!#
|
||||
|
||||
(setenv "GNC_UNINSTALLED" "1")
|
||||
(display " testing stylesheet module load ... ")
|
||||
(use-modules (gnucash unittest-support))
|
||||
@ -17,15 +13,11 @@ exec ${GUILE} -s "$0"
|
||||
(gnc:module-system-init)
|
||||
|
||||
(if (gnc:module-load "gnucash/report/stylesheets" 0)
|
||||
(begin
|
||||
(begin
|
||||
(g-log-remove-handler log-domain handler)
|
||||
(display "ok\n")
|
||||
(exit 0))
|
||||
(begin
|
||||
(begin
|
||||
(g-log-remove-handler log-domain handler)
|
||||
(display "failed\n")
|
||||
(exit -1)))
|
||||
|
||||
|
||||
|
||||
|
@ -27,11 +27,34 @@ GNC_ADD_TEST_WITH_GUILE(test-scm-query-string test-scm-query-string.cpp
|
||||
)
|
||||
ADD_APP_UTILS_TEST(test-sx test-sx.cpp)
|
||||
|
||||
GNC_ADD_SCHEME_TEST(scm-test-load-module-app-utils test-load-module.in)
|
||||
SET(GUILE_DEPENDS
|
||||
scm-app-utils
|
||||
gnc-core-utils
|
||||
gnc-module
|
||||
gncmod-engine
|
||||
gncmod-backend-xml
|
||||
gncmod-backend-xml
|
||||
)
|
||||
|
||||
GNC_ADD_SCHEME_TARGETS(scm-test-load-app-utils-module
|
||||
"test-load-app-utils-module.scm"
|
||||
"gnucash/reports"
|
||||
"${GUILE_DEPENDS}"
|
||||
FALSE
|
||||
)
|
||||
|
||||
GNC_ADD_SCHEME_TESTS("test-load-app-utils-module.scm")
|
||||
# Doesn't work yet:
|
||||
GNC_ADD_TEST_WITH_GUILE(test-app-utils "${test_app_utils_SOURCES}" APP_UTILS_TEST_INCLUDE_DIRS APP_UTILS_TEST_LIBS)
|
||||
|
||||
CONFIGURE_FILE(test-load-module.in test-load-module @ONLY)
|
||||
|
||||
SET_DIST_LIST(test_app_utils_DIST CMakeLists.txt Makefile.am test-exp-parser.c test-link-module.c test-load-module.in
|
||||
test-print-parse-amount.cpp test-print-queries.cpp test-scm-query-string.cpp test-sx.cpp ${test_app_utils_SOURCES})
|
||||
SET_DIST_LIST(test_app_utils_DIST
|
||||
CMakeLists.txt
|
||||
Makefile.am
|
||||
test-exp-parser.c
|
||||
test-link-module.c
|
||||
test-print-parse-amount.cpp
|
||||
test-print-queries.cpp
|
||||
test-scm-query-string.cpp
|
||||
test-sx.cpp
|
||||
${test_app_utils_SOURCES}
|
||||
)
|
||||
|
@ -9,8 +9,8 @@ check_PROGRAMS = \
|
||||
test-app-utils
|
||||
|
||||
TESTS = \
|
||||
test-load-module \
|
||||
${check_PROGRAMS}
|
||||
${check_PROGRAMS} \
|
||||
${SCM_TESTS}
|
||||
|
||||
test_scm_query_string_SOURCES = test-scm-query-string.cpp
|
||||
test_sx_SOURCES = test-sx.cpp
|
||||
@ -47,8 +47,8 @@ LDADD = \
|
||||
${GUILE_LIBS}
|
||||
|
||||
EXTRA_DIST += \
|
||||
test-load-module \
|
||||
test-print-queries.cpp \
|
||||
${SCM_TEST_SRCS} \
|
||||
CMakeLists.txt
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
@ -73,3 +73,12 @@ test_app_utils_CXXFLAGS = \
|
||||
-I${top_srcdir}/${MODULEPATH}/ \
|
||||
-DTESTPROG=test_app_utils \
|
||||
${GLIB_CFLAGS}
|
||||
|
||||
SCM_TESTS = test-load-app-utils-module
|
||||
SCM_TEST_SRCS = $(SCM_TESTS:%=%.scm)
|
||||
|
||||
$(SCM_TESTS): %: $(srcdir)/%.scm Makefile
|
||||
echo 'export GNC_BUILDDIR="${abs_top_builddir}";' > $@
|
||||
echo 'export GNC_UNINSTALLED=yes;' >> $@
|
||||
echo '${GUILE} --debug -l $(srcdir)/$*.scm -c "(exit (run-test))"' >> $@
|
||||
chmod a+x $@
|
||||
|
@ -1,7 +1,3 @@
|
||||
#! @SHELL@
|
||||
exec ${GUILE} -s "$0"
|
||||
!#
|
||||
|
||||
(define exit-code 0)
|
||||
(setenv "GNC_UNINSTALLED" "1")
|
||||
(use-modules (gnucash gnc-module))
|
@ -15,8 +15,6 @@ MACRO(ADD_ENGINE_TEST _TARGET _SOURCE_FILES)
|
||||
GNC_ADD_TEST(${_TARGET} "${_SOURCE_FILES}" ENGINE_TEST_INCLUDE_DIRS ENGINE_TEST_LIBS)
|
||||
ENDMACRO()
|
||||
|
||||
CONFIGURE_FILE(test-scm-query-import.in test-scm-query-import @ONLY)
|
||||
CONFIGURE_FILE(test-create-account.in test-create-account @ONLY)
|
||||
# Not via macro because of unique link requirements
|
||||
|
||||
ADD_EXECUTABLE(test-link EXCLUDE_FROM_ALL test-link.c)
|
||||
@ -210,23 +208,34 @@ GNC_ADD_TEST(test-import-map "${test_import_map_SOURCES}"
|
||||
GNC_ADD_TEST_WITH_GUILE(test-scm-query test-scm-query.cpp 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(engine_test_SCHEME
|
||||
test-account.scm
|
||||
test-create-account.scm
|
||||
test-test-extras.scm
|
||||
test-split.scm
|
||||
test-test-extras.scm
|
||||
)
|
||||
|
||||
#LIST(APPEND engine_test_SCHEME test-scm-query-import.scm) Fails
|
||||
|
||||
SET(GUILE_DEPENDS scm-app-utils scm-scm)
|
||||
|
||||
GNC_ADD_SCHEME_TARGETS(scm-test-engine
|
||||
"${engine_test_SCHEME}"
|
||||
gnucash/engine/test
|
||||
GNC_ADD_SCHEME_TARGETS(scm-test-engine-extras
|
||||
"test-extras.scm"
|
||||
"gnucash/engine/test/"
|
||||
"${GUILE_DEPENDS}"
|
||||
FALSE
|
||||
)
|
||||
)
|
||||
|
||||
GNC_ADD_SCHEME_TARGETS(scm-test-engine
|
||||
"${engine_test_SCHEME}"
|
||||
""
|
||||
"${GUILE_DEPENDS};scm-test-engine-extras"
|
||||
FALSE
|
||||
)
|
||||
|
||||
GNC_ADD_SCHEME_TESTS("${engine_test_SCHEME}")
|
||||
|
||||
SET(test_engine_SOURCES_DIST
|
||||
dummy.cpp
|
||||
@ -292,8 +301,6 @@ SET(test_engine_SCHEME_DIST
|
||||
|
||||
SET(test_engine_EXTRA_DIST
|
||||
README
|
||||
test-create-account.in
|
||||
test-scm-query-import.in
|
||||
)
|
||||
|
||||
SET_DIST_LIST(test_engine_DIST CMakeLists.txt Makefile.am
|
||||
|
@ -56,9 +56,11 @@ TEST_GROUP_2 = \
|
||||
test-vendor
|
||||
|
||||
SCM_TESTS = \
|
||||
test-create-account \
|
||||
test-test-extras \
|
||||
test-account \
|
||||
test-split
|
||||
# test-scm-query-import \ Fails
|
||||
|
||||
SCM_TEST_SRCS = $(SCM_TESTS:%=%.scm)
|
||||
|
||||
@ -107,7 +109,7 @@ TESTS_ENVIRONMENT = \
|
||||
|
||||
check_PROGRAMS = ${TEST_GROUP_1} ${TEST_GROUP_2}
|
||||
|
||||
TESTS = ${TEST_GROUP_1} test-create-account ${TEST_GROUP_2} ${SCM_TESTS}
|
||||
TESTS = ${TEST_GROUP_1} ${TEST_GROUP_2} ${SCM_TESTS}
|
||||
|
||||
test_link_SOURCES = test-link.c
|
||||
test_link_LDADD = ../libgncmod-engine.la \
|
||||
@ -120,10 +122,6 @@ endif
|
||||
SCM_TEST_HELPERS = test-extras.scm
|
||||
|
||||
EXTRA_DIST += \
|
||||
test-create-account \
|
||||
test-create-account.scm \
|
||||
test-scm-query-import \
|
||||
test-scm-query-import.scm \
|
||||
$(SCM_TEST_HELPERS) \
|
||||
$(SCM_TEST_SRCS) \
|
||||
CMakeLists.txt
|
||||
|
@ -1,2 +0,0 @@
|
||||
#!@SHELL@
|
||||
${GUILE} -l $SRCDIR/test-create-account.scm -c "(exit (run-test))"
|
@ -1,2 +0,0 @@
|
||||
#!@SHELL@
|
||||
${GUILE} -l $SRCDIR/test-scm-query-import.scm -c "(exit (run-test))"
|
@ -54,7 +54,7 @@ SET(GUILE_DEPENDS gnc-module)
|
||||
|
||||
GNC_ADD_SCHEME_TARGETS(scm-gnc-module
|
||||
"${gnc_module_SCHEME}"
|
||||
${GUILE_OUTPUT_DIR}
|
||||
${GUILE_OUTPUT_DIR}
|
||||
"${GUILE_DEPENDS}"
|
||||
FALSE
|
||||
)
|
||||
|
@ -34,16 +34,6 @@ ENDFUNCTION()
|
||||
|
||||
GNC_ADD_TEST_WITH_GUILE(test-load-c test-load-c.c GNC_MODULE_TEST_INCLUDE_DIRS GNC_MODULE_TEST_LIBS "GNC_MODULE_PATH=${CMAKE_BINARY_DIR}/lib/gnucash/test")
|
||||
|
||||
RUN_TEST_WITH_GUILE(test-load-scm ${CMAKE_CURRENT_SOURCE_DIR}/test-load-scm.in)
|
||||
|
||||
RUN_TEST_WITH_GUILE(test-load-deps ${CMAKE_CURRENT_SOURCE_DIR}/test-load-deps.in)
|
||||
|
||||
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)
|
||||
|
||||
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
|
||||
)
|
||||
@ -64,31 +54,36 @@ GNC_ADD_TEST(test-dynload test-dynload.c
|
||||
LIBDIR=${_LIBDIR}
|
||||
)
|
||||
|
||||
SET(GUILE ${GUILE_EXECUTABLE})
|
||||
CONFIGURE_FILE(test-gwrapped-c.in test-gwrapped-c @ONLY)
|
||||
CONFIGURE_FILE(test-scm-module.in test-scm-module @ONLY)
|
||||
CONFIGURE_FILE(test-load-deps.in test-load-deps @ONLY)
|
||||
CONFIGURE_FILE(test-load-scm.in test-load-scm @ONLY)
|
||||
CONFIGURE_FILE(test-scm-dynload.in test-scm-dynload @ONLY)
|
||||
CONFIGURE_FILE(test-scm-init.in test-scm-init @ONLY)
|
||||
CONFIGURE_FILE(test-scm-multi.in test-scm-multi @ONLY)
|
||||
|
||||
FUNCTION(RUN_GUILE_SHELL_TEST _TARGET _SOURCE_FILE)
|
||||
GET_GUILE_ENV()
|
||||
SET(CMAKE_COMMAND_TMP "")
|
||||
IF (${CMAKE_VERSION} VERSION_GREATER 3.1)
|
||||
SET(CMAKE_COMMAND_TMP ${CMAKE_COMMAND} -E env "${GUILE_ENV};GNC_MODULE_PATH=${CMAKE_BINARY_DIR}/lib/gnucash/test")
|
||||
ENDIF()
|
||||
ADD_TEST(NAME ${_TARGET}
|
||||
COMMAND ${CMAKE_COMMAND_TMP}
|
||||
${SHELL} ${_SOURCE_FILE}
|
||||
SET(test_gnc_module_SCHEME
|
||||
test-gnc-module-scm-init.scm
|
||||
test-gnc-module-load-scm.scm
|
||||
test-gnc-module-swigged-c.scm
|
||||
test-gnc-module-load-deps.scm
|
||||
test-gnc-module-scm-dynload.scm
|
||||
test-gnc-module-scm-module.scm
|
||||
test-gnc-module-scm-multi.scm
|
||||
)
|
||||
SET_TESTS_PROPERTIES(${_TARGET} PROPERTIES ENVIRONMENT "${GUILE_ENV};GNC_MODULE_PATH=${CMAKE_BINARY_DIR}/lib/gnucash/test")
|
||||
ENDFUNCTION()
|
||||
|
||||
RUN_GUILE_SHELL_TEST(test-gwrapped-c ${CMAKE_CURRENT_BINARY_DIR}/test-gwrapped-c)
|
||||
SET(GUILE_DEPENDS gnc-module scm-test-core scm-mod-foo scm-mod-baz)
|
||||
|
||||
RUN_GUILE_SHELL_TEST(test-scm-module ${CMAKE_CURRENT_BINARY_DIR}/test-scm-module)
|
||||
GNC_ADD_SCHEME_TARGETS(test-gnc-modules-scm
|
||||
"${test_gnc_module_SCHEME}"
|
||||
"gnucash/gnc-modules/test"
|
||||
"${GUILE_DEPENDS}"
|
||||
TRUE
|
||||
)
|
||||
|
||||
GNC_ADD_SCHEME_TESTS("${test_gnc_module_SCHEME}")
|
||||
IF(NOT WIN32)
|
||||
# This little dance is needed because gnc_module_init will assert if
|
||||
# it finds libgncmod_futuremod.so outside of a test that expects it.
|
||||
GET_GUILE_ENV()
|
||||
SET(_GNC_MODULE_PATH "${CMAKE_BINARY_DIR}/lib:${CMAKE_BINARY_DIR}/lib/gnucash:${CMAKE_BINARY_DIR}/lib/gnucash/test")
|
||||
FOREACH(test_file ${test_gnc_module_SCHEME})
|
||||
GET_FILENAME_COMPONENT(basename ${test_file} NAME_WE)
|
||||
SET_TESTS_PROPERTIES(${basename} PROPERTIES ENVIRONMENT "${GUILE_ENV};GNC_MODULE_PATH=${_GNC_MODULE_PATH}")
|
||||
ENDFOREACH()
|
||||
ENDIF()
|
||||
|
||||
SET(test_gnc_module_SOURCE_DIST
|
||||
test-agedver.c
|
||||
@ -100,13 +95,7 @@ SET(test_gnc_module_SOURCE_DIST
|
||||
|
||||
SET(test_gnc_module_EXTRA_DIST
|
||||
README
|
||||
test-gwrapped-c.in
|
||||
test-load-deps.in
|
||||
test-load-scm.in
|
||||
test-scm-dynload.in
|
||||
test-scm-init.in
|
||||
test-scm-module.in
|
||||
test-scm-multi.in
|
||||
${test_gnc_module_SCHEME}
|
||||
)
|
||||
|
||||
SET_LOCAL_DIST(test_gnc_module_DIST_local CMakeLists.txt Makefile.am README ${test_gnc_module_SOURCE_DIST} ${test_gnc_module_EXTRA_DIST})
|
||||
|
@ -14,17 +14,22 @@ AM_CPPFLAGS = \
|
||||
|
||||
TESTS = \
|
||||
test-load-c \
|
||||
test-load-scm \
|
||||
test-gwrapped-c \
|
||||
test-scm-module \
|
||||
test-scm-multi \
|
||||
test-load-deps \
|
||||
test-modsysver \
|
||||
test-incompatdep \
|
||||
test-agedver \
|
||||
test-dynload \
|
||||
test-scm-dynload \
|
||||
test-scm-init
|
||||
${SCM_TESTS}
|
||||
|
||||
SCM_TESTS = \
|
||||
test-gnc-module-load-scm \
|
||||
test-gnc-module-swigged-c \
|
||||
test-gnc-module-scm-module \
|
||||
test-gnc-module-scm-multi \
|
||||
test-gnc-module-load-deps \
|
||||
test-gnc-module-scm-dynload \
|
||||
test-gnc-module-scm-init
|
||||
|
||||
SCM_TEST_SRCS = $(SCM_TESTS:%=%.scm)
|
||||
|
||||
GNC_TEST_DEPS = \
|
||||
--gnc-module-dir ${top_builddir}/libgnucash/gnc-module \
|
||||
@ -58,14 +63,14 @@ check_PROGRAMS = \
|
||||
|
||||
test_dynload_LDFLAGS = ${GUILE_LIBS}
|
||||
|
||||
$(SCM_TESTS): %: $(srcdir)/%.scm Makefile
|
||||
echo 'export GNC_BUILDDIR="${abs_top_builddir}";' > $@
|
||||
echo 'export GNC_UNINSTALLED=yes;' >> $@
|
||||
echo '${GUILE} --debug -l $(srcdir)/$*.scm -c "(exit (run-test))"' >> $@
|
||||
chmod a+x $@
|
||||
|
||||
EXTRA_DIST = \
|
||||
test-gwrapped-c \
|
||||
test-load-deps \
|
||||
test-load-scm \
|
||||
test-scm-dynload \
|
||||
test-scm-init \
|
||||
test-scm-module \
|
||||
test-scm-multi \
|
||||
${SCM_TEST_SRCS} \
|
||||
CMakeLists.txt
|
||||
|
||||
foo:
|
||||
|
@ -27,6 +27,13 @@ TARGET_INCLUDE_DIRECTORIES(gncmodbaz PRIVATE
|
||||
${GUILE_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
GNC_ADD_SCHEME_TARGETS(scm-mod-baz
|
||||
gnucash/baz.scm
|
||||
"gnucash"
|
||||
gncmodbaz
|
||||
TRUE
|
||||
)
|
||||
|
||||
SET_TARGET_PROPERTIES(baz gncmodbaz PROPERTIES
|
||||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/gnucash/test
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/gnucash/test
|
||||
|
@ -21,6 +21,13 @@ TARGET_INCLUDE_DIRECTORIES(gncmodfoo PRIVATE
|
||||
${GUILE_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
GNC_ADD_SCHEME_TARGETS(scm-mod-foo
|
||||
gnucash/foo.scm
|
||||
"gnucash"
|
||||
gncmodfoo
|
||||
TRUE
|
||||
)
|
||||
|
||||
SET_TARGET_PROPERTIES(foo gncmodfoo PROPERTIES
|
||||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/gnucash/test
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/gnucash/test
|
||||
|
@ -1,8 +1,3 @@
|
||||
#! @SHELL@
|
||||
exec ${GUILE} -s $0 "$@"
|
||||
!#
|
||||
;; test-load-deps.scm : load gnc-mod-baz, which depends on gnc-mod-foo
|
||||
|
||||
(use-modules (gnucash unittest-support))
|
||||
(define log-domain "gnc.module")
|
||||
(define check (new-TestErrorStruct))
|
||||
@ -25,7 +20,3 @@ exec ${GUILE} -s $0 "$@"
|
||||
(g-log-remove-handler log-domain handler)
|
||||
|
||||
(exit 0)
|
||||
|
||||
;; Local Variables:
|
||||
;; mode: scheme
|
||||
;; End:
|
@ -1,7 +1,3 @@
|
||||
#! @SHELL@
|
||||
exec ${GUILE} -s $0 "$@"
|
||||
!#
|
||||
|
||||
(use-modules (gnucash unittest-support))
|
||||
(define log-domain "gnc.module")
|
||||
(define check (new-TestErrorStruct))
|
||||
@ -15,6 +11,4 @@ exec ${GUILE} -s $0 "$@"
|
||||
(gnc:module-system-init)
|
||||
(gnc:module-load "gnucash/foo" 0)
|
||||
(g-log-remove-handler log-domain handler)
|
||||
;; Local Variables:
|
||||
;; mode: scheme
|
||||
;; End:
|
||||
(exit 0)
|
5
libgnucash/gnc-module/test/test-gnc-module-scm-dynload.scm
Executable file
5
libgnucash/gnc-module/test/test-gnc-module-scm-dynload.scm
Executable file
@ -0,0 +1,5 @@
|
||||
(if (or (string=? (version) "1.3")
|
||||
(string=? (version) "1.3.4"))
|
||||
(dynamic-link "libgnc-module.so")
|
||||
(dynamic-link "libgnc-module"))
|
||||
(exit 0)
|
@ -1,8 +1,3 @@
|
||||
#! @SHELL@
|
||||
echo " test-scm-init: testing Scheme-only module system init. ";
|
||||
exec ${GUILE} -s $0 "$@"
|
||||
!#
|
||||
|
||||
(use-modules (gnucash unittest-support))
|
||||
(define log-domain "gnc.module")
|
||||
(define check (new-TestErrorStruct))
|
||||
@ -17,7 +12,4 @@ exec ${GUILE} -s $0 "$@"
|
||||
(gnc:module-system-init)
|
||||
|
||||
(g-log-remove-handler log-domain handler)
|
||||
|
||||
;; LocalVariables:
|
||||
;; mode: scheme
|
||||
;; End:
|
||||
(exit 0)
|
14
libgnucash/gnc-module/test/test-gnc-module-scm-module.scm
Executable file
14
libgnucash/gnc-module/test/test-gnc-module-scm-module.scm
Executable file
@ -0,0 +1,14 @@
|
||||
(use-modules (gnucash unittest-support))
|
||||
(define log-domain "gnc.module")
|
||||
(define check (new-TestErrorStruct))
|
||||
(define log-level (G-LOG-LEVEL-WARNING))
|
||||
(define msg "Module '../../../libgnucash/gnc-module/test/misc-mods/.libs/libgncmod_futuremodsys.so' requires newer module system\n")
|
||||
(TestErrorStruct-log-domain-set check log-domain)
|
||||
(TestErrorStruct-log-level-set check log-level)
|
||||
(TestErrorStruct-msg-set check msg)
|
||||
(define handler (test-set-checked-handler log-domain log-level check))
|
||||
(use-modules (gnucash gnc-module))
|
||||
(gnc:module-system-init)
|
||||
(if (not (gnc:module-load "gnucash/foo" 0)) (exit -1))
|
||||
(exit (foo:scheme-hello))
|
||||
(g-log-remove-handler log-domain handler)
|
@ -1,6 +1,3 @@
|
||||
#! @SHELL@
|
||||
exec ${GUILE} -s $0 "$@"
|
||||
!#
|
||||
(use-modules (gnucash unittest-support))
|
||||
(define log-domain "gnc.module")
|
||||
(define check (new-TestErrorStruct))
|
||||
@ -12,7 +9,7 @@ exec ${GUILE} -s $0 "$@"
|
||||
(define handler (test-set-checked-handler log-domain log-level check))
|
||||
|
||||
(use-modules (gnucash gnc-module))
|
||||
(gnc:module-system-init)
|
||||
(gnc:module-system-init)
|
||||
(gnc:module-load "gnucash/foo" 0)
|
||||
(foo-hello)
|
||||
(foo:scheme-hello)
|
||||
@ -23,7 +20,4 @@ exec ${GUILE} -s $0 "$@"
|
||||
(bar:scheme-hello)
|
||||
|
||||
(g-log-remove-handler log-domain handler)
|
||||
|
||||
;; Local Variables:
|
||||
;; mode: scheme
|
||||
;; End:
|
||||
(exit 0)
|
14
libgnucash/gnc-module/test/test-gnc-module-swigged-c.scm
Executable file
14
libgnucash/gnc-module/test/test-gnc-module-swigged-c.scm
Executable file
@ -0,0 +1,14 @@
|
||||
(use-modules (gnucash unittest-support))
|
||||
(define log-domain "gnc.module")
|
||||
(define check (new-TestErrorStruct))
|
||||
(define log-level (G-LOG-LEVEL-WARNING))
|
||||
(define msg "Module '../../../libgnucash/gnc-module/test/misc-mods/.libs/libgncmod_futuremodsys.so' requires newer module system\n")
|
||||
(TestErrorStruct-log-domain-set check log-domain)
|
||||
(TestErrorStruct-log-level-set check log-level)
|
||||
(TestErrorStruct-msg-set check msg)
|
||||
(define handler (test-set-checked-handler log-domain log-level check))
|
||||
(use-modules (gnucash gnc-module))
|
||||
(gnc:module-system-init)
|
||||
(gnc:module-load "gnucash/foo" 0)
|
||||
(exit (eq? 10 (foo-hello)))
|
||||
(g-log-remove-handler log-domain handler)
|
@ -1,15 +0,0 @@
|
||||
#! @SHELL@
|
||||
${GUILE} -c "(use-modules (gnucash unittest-support))
|
||||
(define log-domain \"gnc.module\")
|
||||
(define check (new-TestErrorStruct))
|
||||
(define log-level (G-LOG-LEVEL-WARNING))
|
||||
(define msg \"Module '../../../libgnucash/gnc-module/test/misc-mods/.libs/libgncmod_futuremodsys.so' requires newer module system\n\")
|
||||
(TestErrorStruct-log-domain-set check log-domain)
|
||||
(TestErrorStruct-log-level-set check log-level)
|
||||
(TestErrorStruct-msg-set check msg)
|
||||
(define handler (test-set-checked-handler log-domain log-level check))
|
||||
(use-modules (gnucash gnc-module))
|
||||
(gnc:module-system-init)
|
||||
(gnc:module-load \"gnucash/foo\" 0)
|
||||
(exit (eq? 10 (foo-hello)))
|
||||
(g-log-remove-handler log-domain handler)"
|
@ -1,15 +0,0 @@
|
||||
#! @SHELL@
|
||||
echo " test-scm-dynload: testing dynamic-link of libgnc-module from Scheme.";
|
||||
exec ${GUILE} -s $0 "$@"
|
||||
!#
|
||||
|
||||
(if (or (string=? (version) "1.3")
|
||||
(string=? (version) "1.3.4"))
|
||||
(dynamic-link "libgnc-module.so")
|
||||
(dynamic-link "libgnc-module"))
|
||||
|
||||
;; LocalVariables:
|
||||
;; mode: scheme
|
||||
;; End:
|
||||
|
||||
|
@ -1,15 +0,0 @@
|
||||
#! @SHELL@
|
||||
${GUILE} -c "(use-modules (gnucash unittest-support))
|
||||
(define log-domain \"gnc.module\")
|
||||
(define check (new-TestErrorStruct))
|
||||
(define log-level (G-LOG-LEVEL-WARNING))
|
||||
(define msg \"Module '../../../libgnucash/gnc-module/test/misc-mods/.libs/libgncmod_futuremodsys.so' requires newer module system\n\")
|
||||
(TestErrorStruct-log-domain-set check log-domain)
|
||||
(TestErrorStruct-log-level-set check log-level)
|
||||
(TestErrorStruct-msg-set check msg)
|
||||
(define handler (test-set-checked-handler log-domain log-level check))
|
||||
(use-modules (gnucash gnc-module))
|
||||
(gnc:module-system-init)
|
||||
(if (not (gnc:module-load \"gnucash/foo\" 0)) (exit -1))
|
||||
(exit (foo:scheme-hello))
|
||||
(g-log-remove-handler log-domain handler)"
|
@ -6,6 +6,17 @@ GNC_ADD_TEST(test-link-module-tax-us test-link-module.c
|
||||
)
|
||||
|
||||
# This test not run in autotools build.
|
||||
#GNC_ADD_SCHEME_TEST(test-load-module-tax-us test-load-module.in)
|
||||
#SET(GUILE_DEPENDS
|
||||
# gnc-core-utils
|
||||
# gnc-module
|
||||
#)
|
||||
#
|
||||
#GNC_ADD_SCHEME_TARGETS(scm-test-load-tax-us-module
|
||||
# "test-load-tax-us-module.scm"
|
||||
# "gnucash/reports"
|
||||
# "${GUILE_DEPENDS}"
|
||||
# FALSE
|
||||
#)
|
||||
#GNC_ADD_SCHEME_TEST(test-load-tax-us-module.scm)
|
||||
|
||||
SET_DIST_LIST(test_tax_us_DIST CMakeLists.txt Makefile.am test-link-module.c test-load-module.in)
|
||||
SET_DIST_LIST(test_tax_us_DIST CMakeLists.txt Makefile.am test-link-module.c test-load-tax-us-module.scm)
|
||||
|
@ -1,7 +1,3 @@
|
||||
#! @SHELL@
|
||||
exec ${GUILE} -s "$0"
|
||||
!#
|
||||
|
||||
(display " testing US tax info module load ... ")
|
||||
(use-modules (gnucash gnc-module))
|
||||
(gnc:module-system-init)
|
@ -13,6 +13,7 @@ gnucash/gnome-utils/gnc-tree-model-selection.c
|
||||
|
||||
libgnucash/app-utils/gnucash/app-utils.scm
|
||||
libgnucash/app-utils/gnucash/gettext.scm
|
||||
libgnucash/app-utils/test/test-load-app-utils-module.scm
|
||||
libgnucash/core-utils/gnucash/core-utils.scm
|
||||
libgnucash/engine/gnucash/business-core.scm
|
||||
libgnucash/engine/gnucash/engine.scm
|
||||
|
Loading…
Reference in New Issue
Block a user