diff options
author | Daniel Hahler <git@thequod.de> | 2019-07-24 18:12:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-24 18:12:55 +0200 |
commit | 431cf56e2f5fd5a389bda481122ac62655d9193c (patch) | |
tree | 8bf4e0094348906ee52ff71e1eb8c0cd5793a933 /cmake | |
parent | 06547cdfc00c4a9c47ef7ea30412b2925816786f (diff) | |
download | rneovim-431cf56e2f5fd5a389bda481122ac62655d9193c.tar.gz rneovim-431cf56e2f5fd5a389bda481122ac62655d9193c.tar.bz2 rneovim-431cf56e2f5fd5a389bda481122ac62655d9193c.zip |
ci: RunTests: ensure that the logfile gets displayed (#10597)
This is meant to help with test failures where e.g. `busted` itself might
crash or get killed.
Ref: https://github.com/neovim/neovim/issues/10182#issuecomment-514450069
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/RunTests.cmake | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/cmake/RunTests.cmake b/cmake/RunTests.cmake index 16ac22ced4..f000004aec 100644 --- a/cmake/RunTests.cmake +++ b/cmake/RunTests.cmake @@ -1,6 +1,11 @@ # Set LC_ALL to meet expectations of some locale-sensitive tests. set(ENV{LC_ALL} "en_US.UTF-8") +if(POLICY CMP0012) + # Handle CI=true, without dev warnings. + cmake_policy(SET CMP0012 NEW) +endif() + set(ENV{VIMRUNTIME} ${WORKING_DIR}/runtime) set(ENV{NVIM_RPLUGIN_MANIFEST} ${BUILD_DIR}/Xtest_rplugin_manifest) set(ENV{XDG_CONFIG_HOME} ${BUILD_DIR}/Xtest_xdg/config) @@ -62,6 +67,20 @@ file(GLOB RM_FILES ${BUILD_DIR}/Xtest_*) file(REMOVE_RECURSE ${RM_FILES}) if(NOT res EQUAL 0) - message(STATUS "Output to stderr:\n${err}") + message(STATUS "Tests exited non-zero: ${res}") + if("${err}" STREQUAL "") + message(STATUS "No output to stderr.") + else() + message(STATUS "Output to stderr:\n${err}") + endif() + + # Dump the logfile on CI (if not displayed and moved already). + if($ENV{CI}) + if(EXISTS $ENV{NVIM_LOG_FILE} AND NOT EXISTS $ENV{NVIM_LOG_FILE}.displayed) + file(READ $ENV{NVIM_LOG_FILE} out) + message(STATUS "$NVIM_LOG_FILE: $ENV{NVIM_LOG_FILE}\n${out}") + endif() + endif() + message(FATAL_ERROR "${TEST_TYPE} tests failed with error: ${res}") endif() |