mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-09-03 20:53:02 -05: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:
@@ -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 $@
|
||||
|
||||
-4
@@ -1,7 +1,3 @@
|
||||
#! @SHELL@
|
||||
exec ${GUILE} -s "$0"
|
||||
!#
|
||||
|
||||
(define exit-code 0)
|
||||
(setenv "GNC_UNINSTALLED" "1")
|
||||
(use-modules (gnucash gnc-module))
|
||||
Reference in New Issue
Block a user