build/msvc: Add workaround for false positive exit code from MSBuild

See https://cmake.org/pipermail/cmake-developers/2015-October/026775.html
This commit is contained in:
b-r-o-c-k 2018-03-26 10:54:44 -05:00
parent afd46b78c5
commit afe6b4881f

View File

@ -91,7 +91,18 @@ cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed
bin\nvim --version ; exitIfFailed
# Functional tests
cmake --build . --config $cmakeBuildType --target functionaltest -- $cmakeGeneratorArgs ; exitIfFailed
# The $LastExitCode from MSBuild can't be trusted
$failed = $false
# Temporarily turn off tracing to reduce log file output
Set-PSDebug -Off
cmake --build . --config $cmakeBuildType --target functionaltest -- $cmakeGeneratorArgs |
foreach { $failed = $failed -or
$_ -match 'Running functional tests failed with error'; $_ }
Set-PSDebug -Trace 1
if ($failed) {
exit $LastExitCode
}
if ($uploadToCodecov) {
C:\msys64\usr\bin\bash -lc "cd /c/projects/neovim; bash <(curl -s https://codecov.io/bash) -c -F functionaltest || echo 'codecov upload failed.'"