mirror of
https://github.com/neovim/neovim.git
synced 2026-07-21 00:21:38 +00:00
test: replace busted with local harness
Replace the busted-based Lua test runner with a repo-local harness.
The new harness runs spec files directly under `nvim -ll`, ships its own
reporter and lightweight `luassert` shim, and keeps the helper/preload
flow used by the functional and unit test suites.
Keep the file boundary model shallow and busted-like by restoring `_G`,
`package.loaded`, `package.preload`, `arg`, and the process environment
between files, without carrying extra reset APIs or custom assertion
machinery.
Update the build and test entrypoints to use the new runner, add
black-box coverage for the harness itself, and drop the bundled
busted/luacheck dependency path.
AI-assisted: Codex
(cherry picked from commit 55f9c2136e)
This commit is contained in:
committed by
Justin M. Keyes
parent
0039785724
commit
11d0e7e5fc
@@ -4,8 +4,7 @@ local Set = require('test.unit.set')
|
||||
local Preprocess = require('test.unit.preprocess')
|
||||
local t_global = require('test.testutil')
|
||||
local paths = t_global.paths
|
||||
local assert = require('luassert')
|
||||
local say = require('say')
|
||||
local assert = require('test.assert')
|
||||
|
||||
local check_cores = t_global.check_cores
|
||||
local dedent = t_global.dedent
|
||||
@@ -538,19 +537,6 @@ if os.getenv('NVIM_TEST_PRINT_SYSCALLS') == '1' then
|
||||
end
|
||||
end
|
||||
|
||||
local function just_fail(_)
|
||||
return false
|
||||
end
|
||||
say:set('assertion.just_fail.positive', '%s')
|
||||
say:set('assertion.just_fail.negative', '%s')
|
||||
assert:register(
|
||||
'assertion',
|
||||
'just_fail',
|
||||
just_fail,
|
||||
'assertion.just_fail.positive',
|
||||
'assertion.just_fail.negative'
|
||||
)
|
||||
|
||||
local hook_fnamelen = 30
|
||||
local hook_sfnamelen = 30
|
||||
local hook_numlen = 5
|
||||
@@ -769,7 +755,7 @@ local function check_child_err(rd)
|
||||
end
|
||||
end
|
||||
if err ~= '' then
|
||||
assert.just_fail(err)
|
||||
error(err, 0)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -810,7 +796,7 @@ local function gen_itp(it)
|
||||
end
|
||||
|
||||
-- Pre-emptively calculating error location, wasteful, ugh!
|
||||
-- But the way this code messes around with busted implies the real location is strictly
|
||||
-- But the way this code wraps the local harness means the real location is strictly
|
||||
-- not available in the parent when an actual error occurs. so we have to do this here.
|
||||
local location = debug.traceback()
|
||||
it(name, function()
|
||||
|
||||
Reference in New Issue
Block a user