Keep the test modules from gnc-module outside of the normal GNC_MODULE_PATH

They interfere with other tests and pollute the build logs in cmake.
This commit is contained in:
Geert Janssens 2017-08-16 11:59:27 +02:00
parent 723530a9bc
commit 53afd36de1
5 changed files with 28 additions and 7 deletions

View File

@ -22,7 +22,7 @@ FUNCTION(RUN_TEST_WITH_GUILE _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}")
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}
@ -32,7 +32,7 @@ FUNCTION(RUN_TEST_WITH_GUILE _TARGET _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)
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)
@ -52,6 +52,7 @@ GNC_ADD_TEST_WITH_GUILE(test-incompatdep test-incompatdep.c
)
GNC_ADD_TEST_WITH_GUILE(test-agedver test-agedver.c
GNC_MODULE_TEST_INCLUDE_DIRS GNC_MODULE_TEST_LIBS
"GNC_MODULE_PATH=${CMAKE_BINARY_DIR}/lib/gnucash/test"
)
SET(_LIBDIR ${CMAKE_BINARY_DIR}/lib)
@ -76,13 +77,13 @@ 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}")
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_TESTS_PROPERTIES(${_TARGET} PROPERTIES ENVIRONMENT "${GUILE_ENV}")
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)

View File

@ -13,4 +13,9 @@ 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})
SET_DIST_LIST(misc_mods_DIST CMakeLists.txt Makefile.am agedver.c futuremodsys.c incompatdep.c)
SET_TARGET_PROPERTIES(gncmod_agedver gncmod_futuremodsys gncmod_incompatdep PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/gnucash/test
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/gnucash/test
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
SET_DIST_LIST(misc_mods_DIST CMakeLists.txt Makefile.am agedver.c futuremodsys.c incompatdep.c)

View File

@ -21,4 +21,9 @@ TARGET_INCLUDE_DIRECTORIES(gncmodbar PRIVATE
${GUILE_INCLUDE_DIRS}
)
SET_DIST_LIST(mod_bar_DIST CMakeLists.txt Makefile.am bar.c gnucash/bar.scm bar.h bar.i gnc-mod-bar.c)
SET_TARGET_PROPERTIES(bar gncmodbar PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/gnucash/test
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/gnucash/test
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
SET_DIST_LIST(mod_bar_DIST CMakeLists.txt Makefile.am bar.c gnucash/bar.scm bar.h bar.i gnc-mod-bar.c)

View File

@ -27,4 +27,9 @@ TARGET_INCLUDE_DIRECTORIES(gncmodbaz PRIVATE
${GUILE_INCLUDE_DIRS}
)
SET_DIST_LIST(mod_baz_DIST CMakeLists.txt Makefile.am baz.c gnucash/baz.scm baz.h baz.i gnc-mod-baz.c)
SET_TARGET_PROPERTIES(baz gncmodbaz PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/gnucash/test
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/gnucash/test
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
SET_DIST_LIST(mod_baz_DIST CMakeLists.txt Makefile.am baz.c gnucash/baz.scm baz.h baz.i gnc-mod-baz.c)

View File

@ -21,4 +21,9 @@ TARGET_INCLUDE_DIRECTORIES(gncmodfoo PRIVATE
${GUILE_INCLUDE_DIRS}
)
SET_TARGET_PROPERTIES(foo gncmodfoo PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/gnucash/test
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/gnucash/test
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
SET_DIST_LIST(mod_foo_DIST CMakeLists.txt Makefile.am foo.i gnucash/foo.scm foo.c foo.h gnc-mod-foo.c)