mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Prevent autocompilation of the guile test scripts
There were several issues: - we store the compiled test*.go files in a tests subdirectory, but this is not on the GUILE_LOAD_COMPILED_PATH. Added this directory to the path. - guile was looking for 'script.scm.go' while we create 'script.go'. This is due to how we invoke the scripts: guile -l path-to-script.scm -c (something) we can replace this with -l path-to-script (without extension) as -l won't add the extension. So I've rewrittin the test command to invoke (load-from-path). - the test modules foo.scm, bar.scm and baz.scm should go in tests/gnucash as they are defined as modules (gnucash foo), (gnucash bar) and (gnucash baz) respectively. - find html.scm/go on the load path instead of using a relative path.
This commit is contained in:
parent
06bc064379
commit
d35eabd636
@ -32,7 +32,7 @@ function(get_guile_env)
|
||||
list(APPEND env "GUILE=${GUILE_EXECUTABLE}")
|
||||
|
||||
if (NOT WIN32)
|
||||
list(APPEND env "GUILE_LOAD_COMPILED_PATH=${LIBDIR_BUILD}/gnucash/scm/ccache/${GUILE_EFFECTIVE_VERSION}")
|
||||
list(APPEND env "GUILE_LOAD_COMPILED_PATH=${LIBDIR_BUILD}/gnucash/scm/ccache/${GUILE_EFFECTIVE_VERSION}:${LIBDIR_BUILD}/gnucash/scm/ccache/${GUILE_EFFECTIVE_VERSION}/tests")
|
||||
endif()
|
||||
set(guile_load_paths "")
|
||||
list(APPEND guile_load_paths ${CMAKE_CURRENT_SOURCE_DIR}/mod-foo)
|
||||
@ -102,7 +102,7 @@ function(gnc_add_scheme_test _TARGET _SOURCE_FILE)
|
||||
set(CMAKE_COMMAND_TMP ${CMAKE_COMMAND} -E env)
|
||||
endif()
|
||||
add_test(${_TARGET} ${CMAKE_COMMAND_TMP}
|
||||
${GUILE_EXECUTABLE} --debug -l ${CMAKE_CURRENT_SOURCE_DIR}/${_SOURCE_FILE} -c "(exit (run-test))"
|
||||
${GUILE_EXECUTABLE} --debug -c "(load-from-path \"${_TARGET}\")(exit (run-test))"
|
||||
)
|
||||
get_guile_env()
|
||||
set_tests_properties(${_TARGET} PROPERTIES ENVIRONMENT "${GUILE_ENV};${ARGN}")
|
||||
|
@ -1,6 +1,6 @@
|
||||
(use-modules (srfi srfi-64))
|
||||
(use-modules (tests srfi64-extras))
|
||||
(load "../html-fonts.scm")
|
||||
(load "html-fonts")
|
||||
|
||||
(setlocale LC_ALL "C")
|
||||
|
||||
|
@ -43,6 +43,12 @@ if (HAVE_SRFI64)
|
||||
|
||||
gnc_add_scheme_tests("${scm_test_with_srfi64_SOURCES}")
|
||||
if (HAVE_TEXT_PORTS)
|
||||
gnc_add_scheme_test_targets(scm-test-reports-standard-tp
|
||||
"${scm_test_with_textual_ports_SOURCES}"
|
||||
"tests"
|
||||
"${GUILE_DEPENDS};scm-srfi64-extras"
|
||||
FALSE
|
||||
)
|
||||
gnc_add_scheme_tests("${scm_test_with_textual_ports_SOURCES}")
|
||||
endif (HAVE_TEXT_PORTS)
|
||||
endif (HAVE_SRFI64)
|
||||
|
@ -19,6 +19,13 @@ target_include_directories(gncmod-bar PRIVATE
|
||||
${GUILE_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
gnc_add_scheme_test_targets(scm-mod-bar
|
||||
gnucash/bar.scm
|
||||
"tests/gnucash"
|
||||
gncmod-bar
|
||||
FALSE
|
||||
)
|
||||
|
||||
set_target_properties(bar gncmod-bar PROPERTIES
|
||||
LIBRARY_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
|
||||
|
@ -27,9 +27,9 @@ target_include_directories(gncmod-baz PRIVATE
|
||||
|
||||
gnc_add_scheme_test_targets(scm-mod-baz
|
||||
gnucash/baz.scm
|
||||
"tests"
|
||||
"tests/gnucash"
|
||||
gncmod-baz
|
||||
TRUE
|
||||
FALSE
|
||||
)
|
||||
|
||||
set_target_properties(baz gncmod-baz PROPERTIES
|
||||
|
@ -21,9 +21,9 @@ target_include_directories(gncmod-foo PRIVATE
|
||||
|
||||
gnc_add_scheme_test_targets(scm-mod-foo
|
||||
gnucash/foo.scm
|
||||
"tests"
|
||||
"tests/gnucash"
|
||||
gncmod-foo
|
||||
TRUE
|
||||
FALSE
|
||||
)
|
||||
|
||||
set_target_properties(foo gncmod-foo PROPERTIES
|
||||
|
Loading…
Reference in New Issue
Block a user