diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-03-27 23:02:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-27 23:02:27 +0200 |
commit | 3f3de9b1a95d273463a87516365510dbffcaf3d2 (patch) | |
tree | c5a1d424bc596b0b49c7b0f801c1c1bb864d0e84 | |
parent | 8d5a46e77b1e0c77296f1d0d192e7906dd37c0d7 (diff) | |
parent | 393935c32d48c3a1a02a78df03ea8c67e0a8fb20 (diff) | |
download | rneovim-3f3de9b1a95d273463a87516365510dbffcaf3d2.tar.gz rneovim-3f3de9b1a95d273463a87516365510dbffcaf3d2.tar.bz2 rneovim-3f3de9b1a95d273463a87516365510dbffcaf3d2.zip |
Merge #8183 'build/msvc: Fix functional tests'
MSBuild still returns a non-zero exit code because it detects the word "error" in the stdout which is caused by some of the test names such as api/buf {get,set,del}_line get_line : out-of-bounds is an error.
CMake mailing list thread:
https://cmake.org/pipermail/cmake-developers/2015-October/026775.html
There isn't any good solution for it, so I modified the build script to detect the error message printed by RunTests.cmake.
-rw-r--r-- | appveyor.yml | 5 | ||||
-rw-r--r-- | ci/build.ps1 | 21 | ||||
-rw-r--r-- | test/functional/legacy/077_mf_hash_grow_spec.lua | 3 | ||||
-rw-r--r-- | third-party/patches/libvterm-Remove-VLAs-for-MSVC.patch | 4 |
4 files changed, 22 insertions, 11 deletions
diff --git a/appveyor.yml b/appveyor.yml index 957efc0e47..75ca74d0d5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,14 +3,13 @@ environment: APPVEYOR_CACHE_ENTRY_ZIP_ARGS: "-t7z -m0=lzma -mx=9" image: Visual Studio 2017 configuration: +- MSVC_64 +- MSVC_32 - MINGW_64 - MINGW_32 -- MSVC_64 -# - MSVC_32 - MINGW_64-gcov matrix: allow_failures: - - configuration: MSVC_64 - configuration: MINGW_64-gcov install: [] before_build: diff --git a/ci/build.ps1 b/ci/build.ps1 index 7075775bcd..df70b44458 100644 --- a/ci/build.ps1 +++ b/ci/build.ps1 @@ -11,7 +11,6 @@ $depsCmakeVars = @{ $nvimCmakeVars = @{ CMAKE_BUILD_TYPE = $cmakeBuildType; BUSTED_OUTPUT_TYPE = 'nvim'; - GPERF_PRG = 'C:\msys64\usr\bin\gperf.exe'; } function exitIfFailed() { @@ -39,12 +38,10 @@ if ($compiler -eq 'MINGW') { # Add MinGW to the PATH $env:PATH = "C:\msys64\mingw$bits\bin;$env:PATH" - # Remove the Git sh.exe from the PATH - $env:PATH = $env:PATH.Replace('C:\Program Files\Git\usr\bin', '') # Build third-party dependencies C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm -Su" ; exitIfFailed - C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm --needed -S mingw-w64-$arch-cmake mingw-w64-$arch-perl mingw-w64-$arch-diffutils mingw-w64-$arch-unibilium gperf" ; exitIfFailed + C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm --needed -S mingw-w64-$arch-cmake mingw-w64-$arch-perl mingw-w64-$arch-diffutils mingw-w64-$arch-unibilium" ; exitIfFailed } elseif ($compiler -eq 'MSVC') { $cmakeGeneratorArgs = '/verbosity:normal' @@ -56,6 +53,9 @@ elseif ($compiler -eq 'MSVC') { } } +# Remove Git Unix utilities from the PATH +$env:PATH = $env:PATH.Replace('C:\Program Files\Git\usr\bin', '') + # Setup python (use AppVeyor system python) C:\Python27\python.exe -m pip install neovim ; exitIfFailed C:\Python35\python.exe -m pip install neovim ; exitIfFailed @@ -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.'" diff --git a/test/functional/legacy/077_mf_hash_grow_spec.lua b/test/functional/legacy/077_mf_hash_grow_spec.lua index c692127213..4719a3ecbf 100644 --- a/test/functional/legacy/077_mf_hash_grow_spec.lua +++ b/test/functional/legacy/077_mf_hash_grow_spec.lua @@ -18,7 +18,8 @@ describe('mf_hash_grow()', function() setup(clear) -- Check to see if cksum exists, otherwise skip the test - if os.execute('which cksum 2>&1 > /dev/null') ~= 0 then + local null = helpers.iswin() and 'nul' or '/dev/null' + if os.execute('cksum --help >' .. null .. ' 2>&1') ~= 0 then pending('was not tested because cksum was not found', function() end) else it('is working', function() diff --git a/third-party/patches/libvterm-Remove-VLAs-for-MSVC.patch b/third-party/patches/libvterm-Remove-VLAs-for-MSVC.patch index 3fb18351be..e999c0fa9b 100644 --- a/third-party/patches/libvterm-Remove-VLAs-for-MSVC.patch +++ b/third-party/patches/libvterm-Remove-VLAs-for-MSVC.patch @@ -23,7 +23,7 @@ index 84299df..f9aabb3 100644 // We'll have at most len codepoints - uint32_t codepoints[len]; -+ uint32_t* codepoints = _alloca(len); ++ uint32_t* codepoints = _alloca(len * sizeof(uint32_t)); int npoints = 0; size_t eaten = 0; @@ -32,7 +32,7 @@ index 84299df..f9aabb3 100644 int width = 0; - uint32_t chars[glyph_ends - glyph_starts + 1]; -+ uint32_t* chars = _alloca(glyph_ends - glyph_starts + 1); ++ uint32_t* chars = _alloca((glyph_ends - glyph_starts + 1) * sizeof(uint32_t)); for( ; i < glyph_ends; i++) { chars[i - glyph_starts] = codepoints[i]; |