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:
Geert Janssens
2019-05-18 14:06:57 +02:00
parent 06bc064379
commit d35eabd636
6 changed files with 20 additions and 7 deletions

View File

@@ -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}")