mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
ci(tests): don't skip parsers on functionaltest
Treesitter parsers are now a mandatory part of the installation and should be tested on all platforms. Remove `pending_c_parser` helper.
This commit is contained in:
parent
905dd49fec
commit
6254b0fd3b
2
.github/workflows/env.sh
vendored
2
.github/workflows/env.sh
vendored
@ -57,7 +57,7 @@ EOF
|
||||
functionaltest-lua)
|
||||
BUILD_FLAGS="$BUILD_FLAGS -DPREFER_LUA=ON"
|
||||
FUNCTIONALTEST=functionaltest-lua
|
||||
DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF -DUSE_BUNDLED_TS_PARSERS=OFF"
|
||||
DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
|
@ -755,16 +755,6 @@ function module.pending_win32(pending_fn)
|
||||
end
|
||||
end
|
||||
|
||||
function module.pending_c_parser(pending_fn)
|
||||
local status, _ = unpack(module.exec_lua([[ return {pcall(vim.treesitter.require_language, 'c')} ]]))
|
||||
if not status then
|
||||
pending_fn 'no C parser, skipping'
|
||||
return true
|
||||
end
|
||||
module.exec_lua [[vim._ts_remove_language 'c']]
|
||||
return false
|
||||
end
|
||||
|
||||
-- Calls pending() and returns `true` if the system is too slow to
|
||||
-- run fragile or expensive tests. Else returns `false`.
|
||||
function module.skip_fragile(pending_fn, cond)
|
||||
|
@ -5,7 +5,6 @@ local clear = helpers.clear
|
||||
local insert = helpers.insert
|
||||
local exec_lua = helpers.exec_lua
|
||||
local feed = helpers.feed
|
||||
local pending_c_parser = helpers.pending_c_parser
|
||||
local command = helpers.command
|
||||
local meths = helpers.meths
|
||||
local eq = helpers.eq
|
||||
@ -111,8 +110,6 @@ describe('treesitter highlighting', function()
|
||||
end)
|
||||
|
||||
it('is updated with edits', function()
|
||||
if pending_c_parser(pending) then return end
|
||||
|
||||
insert(hl_text)
|
||||
screen:expect{grid=[[
|
||||
/// Schedule Lua callback on main loop's event queue |
|
||||
@ -276,8 +273,6 @@ describe('treesitter highlighting', function()
|
||||
end)
|
||||
|
||||
it('is updated with :sort', function()
|
||||
if pending_c_parser(pending) then return end
|
||||
|
||||
insert(test_text)
|
||||
exec_lua [[
|
||||
local parser = vim.treesitter.get_parser(0, "c")
|
||||
@ -351,8 +346,6 @@ describe('treesitter highlighting', function()
|
||||
end)
|
||||
|
||||
it("supports with custom parser", function()
|
||||
if pending_c_parser(pending) then return end
|
||||
|
||||
screen:set_default_attr_ids {
|
||||
[1] = {bold = true, foreground = Screen.colors.SeaGreen4};
|
||||
}
|
||||
@ -417,8 +410,6 @@ describe('treesitter highlighting', function()
|
||||
end)
|
||||
|
||||
it("supports injected languages", function()
|
||||
if pending_c_parser(pending) then return end
|
||||
|
||||
insert([[
|
||||
int x = INT_MAX;
|
||||
#define READ_STRING(x, y) (char_u *)read_string((x), (size_t)(y))
|
||||
@ -479,8 +470,6 @@ describe('treesitter highlighting', function()
|
||||
end)
|
||||
|
||||
it("supports overriding queries, like ", function()
|
||||
if pending_c_parser(pending) then return end
|
||||
|
||||
insert([[
|
||||
int x = INT_MAX;
|
||||
#define READ_STRING(x, y) (char_u *)read_string((x), (size_t)(y))
|
||||
@ -520,8 +509,6 @@ describe('treesitter highlighting', function()
|
||||
end)
|
||||
|
||||
it("supports highlighting with custom highlight groups", function()
|
||||
if pending_c_parser(pending) then return end
|
||||
|
||||
insert(hl_text)
|
||||
|
||||
exec_lua [[
|
||||
@ -577,8 +564,6 @@ describe('treesitter highlighting', function()
|
||||
end)
|
||||
|
||||
it("supports highlighting with priority", function()
|
||||
if pending_c_parser(pending) then return end
|
||||
|
||||
insert([[
|
||||
int x = INT_MAX;
|
||||
#define READ_STRING(x, y) (char_u *)read_string((x), (size_t)(y))
|
||||
@ -625,8 +610,6 @@ describe('treesitter highlighting', function()
|
||||
end)
|
||||
|
||||
it("allows to use captures with dots (don't use fallback when specialization of foo exists)", function()
|
||||
if pending_c_parser(pending) then return end
|
||||
|
||||
insert([[
|
||||
char* x = "Will somebody ever read this?";
|
||||
]])
|
||||
@ -708,7 +691,6 @@ describe('treesitter highlighting', function()
|
||||
end)
|
||||
|
||||
it("supports conceal attribute", function()
|
||||
if pending_c_parser(pending) then return end
|
||||
insert(hl_text)
|
||||
|
||||
-- conceal can be empty or a single cchar.
|
||||
|
@ -6,7 +6,6 @@ local command = helpers.command
|
||||
local exec_lua = helpers.exec_lua
|
||||
local pcall_err = helpers.pcall_err
|
||||
local matches = helpers.matches
|
||||
local pending_c_parser = helpers.pending_c_parser
|
||||
local insert = helpers.insert
|
||||
|
||||
before_each(clear)
|
||||
@ -28,15 +27,11 @@ describe('treesitter language API', function()
|
||||
eq("Error executing lua: .../language.lua:0: no parser for 'borklang' language, see :help treesitter-parsers",
|
||||
pcall_err(exec_lua, "parser = vim.treesitter.inspect_language('borklang')"))
|
||||
|
||||
if not pending_c_parser(pending) then
|
||||
matches("Error executing lua: Failed to load parser: uv_dlsym: .+",
|
||||
pcall_err(exec_lua, 'vim.treesitter.require_language("c", nil, false, "borklang")'))
|
||||
end
|
||||
matches("Error executing lua: Failed to load parser: uv_dlsym: .+",
|
||||
pcall_err(exec_lua, 'vim.treesitter.require_language("c", nil, false, "borklang")'))
|
||||
end)
|
||||
|
||||
it('inspects language', function()
|
||||
if pending_c_parser(pending) then return end
|
||||
|
||||
local keys, fields, symbols = unpack(exec_lua([[
|
||||
local lang = vim.treesitter.inspect_language('c')
|
||||
local keys, symbols = {}, {}
|
||||
@ -76,7 +71,6 @@ describe('treesitter language API', function()
|
||||
end)
|
||||
|
||||
it('checks if vim.treesitter.get_parser tries to create a new parser on filetype change', function ()
|
||||
if pending_c_parser(pending) then return end
|
||||
command("set filetype=c")
|
||||
-- Should not throw an error when filetype is c
|
||||
eq('c', exec_lua("return vim.treesitter.get_parser(0):lang()"))
|
||||
@ -87,7 +81,6 @@ describe('treesitter language API', function()
|
||||
end)
|
||||
|
||||
it('retrieve the tree given a range', function ()
|
||||
if pending_c_parser(pending) then return end
|
||||
insert([[
|
||||
int main() {
|
||||
int x = 3;
|
||||
@ -102,7 +95,6 @@ describe('treesitter language API', function()
|
||||
end)
|
||||
|
||||
it('retrieve the node given a range', function ()
|
||||
if pending_c_parser(pending) then return end
|
||||
insert([[
|
||||
int main() {
|
||||
int x = 3;
|
||||
|
@ -4,7 +4,6 @@ local clear = helpers.clear
|
||||
local eq = helpers.eq
|
||||
local exec_lua = helpers.exec_lua
|
||||
local insert = helpers.insert
|
||||
local pending_c_parser = helpers.pending_c_parser
|
||||
|
||||
before_each(clear)
|
||||
|
||||
@ -15,10 +14,6 @@ end
|
||||
describe('treesitter node API', function()
|
||||
clear()
|
||||
|
||||
if pending_c_parser(pending) then
|
||||
return
|
||||
end
|
||||
|
||||
it('can move between siblings', function()
|
||||
insert([[
|
||||
int main(int x, int y, int z) {
|
||||
|
@ -5,13 +5,11 @@ local eq = helpers.eq
|
||||
local insert = helpers.insert
|
||||
local exec_lua = helpers.exec_lua
|
||||
local feed = helpers.feed
|
||||
local pending_c_parser = helpers.pending_c_parser
|
||||
|
||||
before_each(clear)
|
||||
|
||||
describe('treesitter parser API', function()
|
||||
clear()
|
||||
if pending_c_parser(pending) then return end
|
||||
|
||||
it('parses buffer', function()
|
||||
if helpers.pending_win32(pending) then return end
|
||||
@ -249,7 +247,6 @@ void ui_refresh(void)
|
||||
end)
|
||||
|
||||
it('supports getting text of multiline node', function()
|
||||
if pending_c_parser(pending) then return end
|
||||
insert(test_text)
|
||||
local res = exec_lua([[
|
||||
local parser = vim.treesitter.get_parser(0, "c")
|
||||
|
@ -4,7 +4,6 @@ local clear = helpers.clear
|
||||
local insert = helpers.insert
|
||||
local eq = helpers.eq
|
||||
local exec_lua = helpers.exec_lua
|
||||
local pending_c_parser = helpers.pending_c_parser
|
||||
|
||||
before_each(clear)
|
||||
|
||||
@ -12,7 +11,6 @@ describe('treesitter utils', function()
|
||||
before_each(clear)
|
||||
|
||||
it('can find an ancestor', function()
|
||||
if pending_c_parser(pending) then return end
|
||||
|
||||
insert([[
|
||||
int main() {
|
||||
|
Loading…
Reference in New Issue
Block a user