Commit b6292f8e authored by Antoine Regimbeau's avatar Antoine Regimbeau
Browse files

Add log in case of failure

No related merge requests found
Showing with 28 additions and 4 deletions
+28 -4
......@@ -161,6 +161,11 @@ ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}"
RETURN_VALUE _configure_rv
CAPTURE_CMAKE_ERROR _configure_error
)
# Configure log
file ( WRITE
"${OTB_SOURCE_DIR}/configure_return_value_log.txt" "${_configure_rv}")
file ( WRITE
"${OTB_SOURCE_DIR}/configure_cmake_error_log.txt" "${_configure_error}")
if ( NOT _configure_rv EQUAL 0 )
ctest_submit()
......@@ -172,6 +177,14 @@ ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}"
CAPTURE_CMAKE_ERROR _build_error
)
# Build log
file ( WRITE
"${OTB_SOURCE_DIR}/build_return_value_log.txt" "${_build_rv}")
file ( WRITE
"${OTB_SOURCE_DIR}/build_cmake_error_log.txt" "${_build_error}")
# SEND_ERROR if build error
# FATAL_ERROR if build error?
if ( NOT _build_rv EQUAL 0 )
message( SEND_ERROR "An error occurs during ctest_build.")
endif()
......@@ -182,6 +195,12 @@ ctest_test(PARALLEL_LEVEL 8
CAPTURE_CMAKE_ERROR _test_error
)
# Test log
file ( WRITE
"${OTB_SOURCE_DIR}/test_return_value_log.txt" "${_test_rv}")
file ( WRITE
"${OTB_SOURCE_DIR}/test_cmake_error_log.txt" "${_test_error}")
if ( NOT _test_rv EQUAL 0 )
message( WARNING "Some tests have failed.")
endif()
......@@ -193,7 +212,7 @@ set ( MAKE_COMMAND "make")
execute_process(
COMMAND ${MAKE_COMMAND} "install"
WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY}
RESULT_VARIABLE install_res
RESULT_VARIABLE install_rv
OUTPUT_VARIABLE install_out
ERROR_VARIABLE install_err
)
......@@ -205,7 +224,12 @@ if ( DEBUG )
message( "install_err = ${install_err}" )
endif()
# Artifacts can only be in project dir...
# file ( COPY "${XDK_PATH}" DESTINATION "${OTB_SOURCE_DIR}/install")
# Install log
file ( WRITE
"${OTB_SOURCE_DIR}/install_out_log.txt" "${install_out}")
file ( WRITE
"${OTB_SOURCE_DIR}/install_error_log.txt" "${install_err}")
# include ( "${CMAKE_CURRENT_LIST_DIR}/main_packages.cmake" )
if ( NOT install_rv EQUAL 0 )
message( SEND_ERROR "Install have failed.")
endif()
Supports Markdown
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