Commit fcdef9a8 authored by Administrator's avatar Administrator Committed by Florian Uhlig
Browse files

Add new test stage in CTest configuration

Installl CbmRoot and remove part of the source directory

Add code which tests if the installtion of CbmRoot works and if the installed
version is functional. Test the "make install" target and run some macros from
teh installation directory.

To be able to test the CbmRoot installation it is necessary that no header
files are accessible in the source directory since this is the fallback for
ROOT when compiling a macro. To achieve this the directories containing any
headers are removed from the source directory.
This is a dangerous operation when executed in a source directory used for
active development. The installation test should only be used when running
the CI/CD workflow.
parent 47214c71
......@@ -130,8 +130,27 @@ If(NOT _RETVAL)
EndIf()
EndIf()
If(EXTRA_FLAGS MATCHES "INSTALL_PREFIX" AND EXTRA_FLAGS MATCHES "CBM_TEST_INSTALL" AND NOT _ctest_test_ret_val)
Message("Testing Installation")
execute_process(COMMAND ${BUILD_COMMAND} install -j$ENV{number_of_processors} WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY}
RESULTS_VARIABLE _install_ret_value
)
if (NOT _install_ret_value)
execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E rm -R MQ algo analysis core external fles mvd reco sim
WORKING_DIRECTORY ${CTEST_SOURCE_DIRECTORY}
)
message("executing test suite in ${CTEST_BINARY_DIRECTORY}/install")
execute_process(COMMAND ${CTEST_SOURCE_DIRECTORY}/cmake/scripts/execute_installation_test.sh ${CTEST_BINARY_DIRECTORY}/install
RESULTS_VARIABLE _install_ret_value
)
endif()
Else()
# if installation isn't tested the return value should be 0
set(_install_ret_value false)
EndIf()
# Pipeline should fail also in case of failed tests
if (_ctest_test_ret_val)
if (_ctest_test_ret_val OR _install_ret_value)
If(${CMAKE_VERSION} VERSION_LESS 3.14.0)
Else()
message(STATUS " ")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment