mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
test: skip_fragile(), TEST_SKIP_FRAGILE
Let build systems define TEST_SKIP_FRAGILE to skip tests that are known to be resource-intensive (unreliable on slow systems). References https://github.com/neovim/neovim/pull/5488#issuecomment-265622113
This commit is contained in:
parent
f4d326cf10
commit
e03b43bd07
@ -11,6 +11,12 @@ describe("CTRL-C (mapped)", function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it("interrupts :global", function()
|
it("interrupts :global", function()
|
||||||
|
if helpers.skip_fragile(pending,
|
||||||
|
(os.getenv("TRAVIS") and os.getenv("CLANG_SANITIZER") == "ASAN_UBSAN"))
|
||||||
|
then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
source([[
|
source([[
|
||||||
set nomore nohlsearch undolevels=-1
|
set nomore nohlsearch undolevels=-1
|
||||||
nnoremap <C-C> <NOP>
|
nnoremap <C-C> <NOP>
|
||||||
|
@ -520,12 +520,12 @@ local function create_callindex(func)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Helper to skip tests. Returns true in Windows systems.
|
-- Helper to skip tests. Returns true in Windows systems.
|
||||||
-- pending_func is pending() from busted
|
-- pending_fn is pending() from busted
|
||||||
local function pending_win32(pending_func)
|
local function pending_win32(pending_fn)
|
||||||
clear()
|
clear()
|
||||||
if uname() == 'Windows' then
|
if uname() == 'Windows' then
|
||||||
if pending_func ~= nil then
|
if pending_fn ~= nil then
|
||||||
pending_func('FIXME: Windows', function() end)
|
pending_fn('FIXME: Windows', function() end)
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
@ -533,6 +533,22 @@ local function pending_win32(pending_func)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Calls pending() and returns `true` if the system is too slow to
|
||||||
|
-- run fragile or expensive tests. Else returns `false`.
|
||||||
|
local function skip_fragile(pending_fn, cond)
|
||||||
|
if pending_fn == nil or type(pending_fn) ~= type(function()end) then
|
||||||
|
error("invalid pending_fn")
|
||||||
|
end
|
||||||
|
if cond then
|
||||||
|
pending_fn("skipped (test is fragile on this system)", function() end)
|
||||||
|
return true
|
||||||
|
elseif os.getenv("TEST_SKIP_FRAGILE") then
|
||||||
|
pending_fn("skipped (TEST_SKIP_FRAGILE)", function() end)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
local funcs = create_callindex(nvim_call)
|
local funcs = create_callindex(nvim_call)
|
||||||
local meths = create_callindex(nvim)
|
local meths = create_callindex(nvim)
|
||||||
local uimeths = create_callindex(ui)
|
local uimeths = create_callindex(ui)
|
||||||
@ -601,6 +617,7 @@ return function(after_each)
|
|||||||
curwinmeths = curwinmeths,
|
curwinmeths = curwinmeths,
|
||||||
curtabmeths = curtabmeths,
|
curtabmeths = curtabmeths,
|
||||||
pending_win32 = pending_win32,
|
pending_win32 = pending_win32,
|
||||||
|
skip_fragile = skip_fragile,
|
||||||
tmpname = tmpname,
|
tmpname = tmpname,
|
||||||
NIL = mpack.NIL,
|
NIL = mpack.NIL,
|
||||||
}
|
}
|
||||||
|
@ -153,9 +153,10 @@ describe('Mouse input', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('in tabline to the left moves tab left', function()
|
it('in tabline to the left moves tab left', function()
|
||||||
if os.getenv("TRAVIS") and (helpers.os_name() == "osx"
|
if helpers.skip_fragile(pending,
|
||||||
or os.getenv("CLANG_SANITIZER") == "ASAN_UBSAN") then
|
os.getenv("TRAVIS") and (helpers.os_name() == "osx"
|
||||||
pending("[Fails on Travis macOS, ASAN_UBSAN. #4874]", function() end)
|
or os.getenv("CLANG_SANITIZER") == "ASAN_UBSAN")) -- #4874
|
||||||
|
then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -257,9 +258,10 @@ describe('Mouse input', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('out of tabline to the left moves tab left', function()
|
it('out of tabline to the left moves tab left', function()
|
||||||
if os.getenv("TRAVIS") and (helpers.os_name() == "osx"
|
if helpers.skip_fragile(pending,
|
||||||
or os.getenv("CLANG_SANITIZER") == "ASAN_UBSAN") then
|
os.getenv("TRAVIS") and (helpers.os_name() == "osx"
|
||||||
pending("[Fails on Travis macOS, ASAN_UBSAN. #4874]", function() end)
|
or os.getenv("CLANG_SANITIZER") == "ASAN_UBSAN")) -- #4874
|
||||||
|
then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user