Merge #8378 from janlazo/win_functional_tests

This commit is contained in:
Justin M. Keyes
2018-11-01 10:00:35 +01:00
committed by GitHub
6 changed files with 23 additions and 29 deletions

View File

@@ -1,4 +1,5 @@
Set-PSDebug -Trace 1 $ErrorActionPreference = 'stop'
Set-PSDebug -Strict -Trace 1
$env:CONFIGURATION -match '^(?<compiler>\w+)_(?<bits>32|64)(?:-(?<option>\w+))?$' $env:CONFIGURATION -match '^(?<compiler>\w+)_(?<bits>32|64)(?:-(?<option>\w+))?$'
$compiler = $Matches.compiler $compiler = $Matches.compiler
@@ -12,6 +13,7 @@ $nvimCmakeVars = @{
CMAKE_BUILD_TYPE = $cmakeBuildType; CMAKE_BUILD_TYPE = $cmakeBuildType;
BUSTED_OUTPUT_TYPE = 'nvim'; BUSTED_OUTPUT_TYPE = 'nvim';
} }
$uploadToCodeCov = $false
# For pull requests, skip some build configurations to save time. # For pull requests, skip some build configurations to save time.
if ($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT -and $env:CONFIGURATION -match '^(MSVC_64|MINGW_32|MINGW_64-gcov)$') { if ($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT -and $env:CONFIGURATION -match '^(MSVC_64|MINGW_32|MINGW_64-gcov)$') {
@@ -20,6 +22,7 @@ if ($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT -and $env:CONFIGURATION -match '^(MSV
function exitIfFailed() { function exitIfFailed() {
if ($LastExitCode -ne 0) { if ($LastExitCode -ne 0) {
Set-PSDebug -Off
exit $LastExitCode exit $LastExitCode
} }
} }
@@ -38,15 +41,18 @@ if ($compiler -eq 'MINGW') {
# These are native MinGW builds, but they use the toolchain inside # These are native MinGW builds, but they use the toolchain inside
# MSYS2, this allows using all the dependencies and tools available # MSYS2, this allows using all the dependencies and tools available
# in MSYS2, but we cannot build inside the MSYS2 shell. # in MSYS2, but we cannot build inside the MSYS2 shell.
$cmakeGenerator = 'MinGW Makefiles' $cmakeGenerator = 'Ninja'
$cmakeGeneratorArgs = 'VERBOSE=1' $cmakeGeneratorArgs = '-v'
$mingwPackages = @('ninja', 'cmake', 'perl', 'diffutils', 'unibilium').ForEach({
"mingw-w64-$arch-$_"
})
# Add MinGW to the PATH # Add MinGW to the PATH
$env:PATH = "C:\msys64\mingw$bits\bin;$env:PATH" $env:PATH = "C:\msys64\mingw$bits\bin;$env:PATH"
# Build third-party dependencies # Build third-party dependencies
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm -Su" ; exitIfFailed 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" ; exitIfFailed C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm --needed -S $mingwPackages" ; exitIfFailed
} }
elseif ($compiler -eq 'MSVC') { elseif ($compiler -eq 'MSVC') {
$cmakeGeneratorArgs = '/verbosity:normal' $cmakeGeneratorArgs = '/verbosity:normal'
@@ -58,9 +64,6 @@ 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) # Setup python (use AppVeyor system python)
C:\Python27\python.exe -m pip install neovim ; exitIfFailed C:\Python27\python.exe -m pip install neovim ; exitIfFailed
C:\Python35\python.exe -m pip install neovim ; exitIfFailed C:\Python35\python.exe -m pip install neovim ; exitIfFailed
@@ -72,18 +75,20 @@ python -c "import neovim; print(str(neovim))" ; exitIfFailed
python3 -c "import neovim; print(str(neovim))" ; exitIfFailed python3 -c "import neovim; print(str(neovim))" ; exitIfFailed
$env:PATH = "C:\Ruby24\bin;$env:PATH" $env:PATH = "C:\Ruby24\bin;$env:PATH"
cmd /c gem.cmd install neovim ; exitIfFailed gem.cmd install neovim
where.exe neovim-ruby-host.bat ; exitIfFailed Get-Command -CommandType Application neovim-ruby-host.bat
cmd /c npm.cmd install -g neovim ; exitIfFailed npm.cmd install -g neovim
where.exe neovim-node-host.cmd ; exitIfFailed Get-Command -CommandType Application neovim-node-host.cmd
cmd /c npm link neovim npm.cmd link neovim
function convertToCmakeArgs($vars) { function convertToCmakeArgs($vars) {
return $vars.GetEnumerator() | foreach { "-D$($_.Key)=$($_.Value)" } return $vars.GetEnumerator() | foreach { "-D$($_.Key)=$($_.Value)" }
} }
if (-Not (Test-Path -PathType container .deps)) {
mkdir .deps mkdir .deps
}
cd .deps cd .deps
cmake -G $cmakeGenerator $(convertToCmakeArgs($depsCmakeVars)) ..\third-party\ ; exitIfFailed cmake -G $cmakeGenerator $(convertToCmakeArgs($depsCmakeVars)) ..\third-party\ ; exitIfFailed
cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed
@@ -104,10 +109,10 @@ Set-PSDebug -Off
cmake --build . --config $cmakeBuildType --target functionaltest -- $cmakeGeneratorArgs 2>&1 | cmake --build . --config $cmakeBuildType --target functionaltest -- $cmakeGeneratorArgs 2>&1 |
foreach { $failed = $failed -or foreach { $failed = $failed -or
$_ -match 'functional tests failed with error'; $_ } $_ -match 'functional tests failed with error'; $_ }
Set-PSDebug -Trace 1
if ($failed) { if ($failed) {
exit $LastExitCode exit $LastExitCode
} }
Set-PSDebug -Strict -Trace 1
if ($uploadToCodecov) { if ($uploadToCodecov) {

View File

@@ -538,10 +538,6 @@ describe('API: buffer events:', function()
end) end)
it('works with :diffput and :diffget', function() it('works with :diffput and :diffget', function()
if os.getenv("APPVEYOR") then
pending("Fails on appveyor for some reason.", function() end)
end
local b1, tick1 = editoriginal(true, {"AAA", "BBB"}) local b1, tick1 = editoriginal(true, {"AAA", "BBB"})
local channel = nvim('get_api_info')[1] local channel = nvim('get_api_info')[1]
command('diffthis') command('diffthis')

View File

@@ -841,10 +841,6 @@ describe('API', function()
end) end)
it('works for job channel', function() it('works for job channel', function()
if iswin() and os.getenv('APPVEYOR') ~= nil then
pending("jobstart(['cat']) unreliable on appveyor")
return
end
eq(3, eval("jobstart(['cat'], {'rpc': v:true})")) eq(3, eval("jobstart(['cat'], {'rpc': v:true})"))
local info = { local info = {
stream='job', stream='job',

View File

@@ -192,7 +192,6 @@ describe('channels', function()
end) end)
it('can use buffered output mode', function() it('can use buffered output mode', function()
if helpers.pending_win32(pending) then return end
source([[ source([[
let g:job_opts = { let g:job_opts = {
\ 'on_stdout': function('OnEvent'), \ 'on_stdout': function('OnEvent'),
@@ -225,7 +224,6 @@ describe('channels', function()
end) end)
it('can use buffered output mode with no stream callback', function() it('can use buffered output mode with no stream callback', function()
if helpers.pending_win32(pending) then return end
source([[ source([[
function! OnEvent(id, data, event) dict function! OnEvent(id, data, event) dict
call rpcnotify(1, a:event, a:id, a:data, self.stdout) call rpcnotify(1, a:event, a:id, a:data, self.stdout)

View File

@@ -18,6 +18,7 @@ local clear, feed_command, expect, eq, neq, dedent, write_file, feed =
helpers.clear, helpers.feed_command, helpers.expect, helpers.eq, helpers.neq, helpers.clear, helpers.feed_command, helpers.expect, helpers.eq, helpers.neq,
helpers.dedent, helpers.write_file, helpers.feed helpers.dedent, helpers.write_file, helpers.feed
local iswin = helpers.iswin local iswin = helpers.iswin
local read_file = helpers.read_file
local function has_gzip() local function has_gzip()
local null = iswin() and 'nul' or '/dev/null' local null = iswin() and 'nul' or '/dev/null'
@@ -60,7 +61,7 @@ describe('file reading, writing and bufnew and filter autocommands', function()
os.remove('test.out') os.remove('test.out')
end) end)
if iswin() or not has_gzip() then if not has_gzip() then
pending('skipped (missing `gzip` utility)', function() end) pending('skipped (missing `gzip` utility)', function() end)
else else
@@ -77,7 +78,7 @@ describe('file reading, writing and bufnew and filter autocommands', function()
it('BufReadPre, BufReadPost (using gzip)', function() it('BufReadPre, BufReadPost (using gzip)', function()
prepare_gz_file('Xtestfile', text1) prepare_gz_file('Xtestfile', text1)
local gzip_data = io.open('Xtestfile.gz'):read('*all') local gzip_data = read_file('Xtestfile.gz')
feed_command('let $GZIP = ""') feed_command('let $GZIP = ""')
-- Setup autocommands to decompress before reading and re-compress afterwards. -- Setup autocommands to decompress before reading and re-compress afterwards.
feed_command("au BufReadPre *.gz exe '!gzip -d ' . shellescape(expand('<afile>'))") feed_command("au BufReadPre *.gz exe '!gzip -d ' . shellescape(expand('<afile>'))")
@@ -91,7 +92,7 @@ describe('file reading, writing and bufnew and filter autocommands', function()
-- Expect the decompressed file in the buffer. -- Expect the decompressed file in the buffer.
expect(text1) expect(text1)
-- Expect the original file to be unchanged. -- Expect the original file to be unchanged.
eq(gzip_data, io.open('Xtestfile.gz'):read('*all')) eq(gzip_data, read_file('Xtestfile.gz'))
end) end)
-- luacheck: ignore 621 (Indentation) -- luacheck: ignore 621 (Indentation)
@@ -142,7 +143,6 @@ describe('file reading, writing and bufnew and filter autocommands', function()
end) end)
it('FilterReadPre, FilterReadPost', function() it('FilterReadPre, FilterReadPost', function()
if helpers.pending_win32(pending) then return end
-- Write a special input file for this test block. -- Write a special input file for this test block.
write_file('test.out', dedent([[ write_file('test.out', dedent([[
startstart startstart

View File

@@ -2301,7 +2301,6 @@ describe('plugin/shada.vim', function()
describe('event FileWriteCmd', function() describe('event FileWriteCmd', function()
it('works', function() it('works', function()
if helpers.pending_win32(pending) then return end
nvim('set_var', 'shada#add_own_header', 0) nvim('set_var', 'shada#add_own_header', 0)
curbuf('set_lines', 0, 1, true, { curbuf('set_lines', 0, 1, true, {
'Jump with timestamp ' .. epoch .. ':', 'Jump with timestamp ' .. epoch .. ':',