test: start test runners in Xtest_xdg dir (#37964)

This is a better way to prevent parallel tests from interfering with
each other, as there are many ways files can be created and deleted in
tests, so enforcing different file names is hard.

Using $TMPDIR can also work in most cases, but 'backipskip' etc. have
special defaults for $TMPDIR.

Symlink runtime/, src/, test/ and README.md to Xtest_xdg dir to make
tests more convenient (and symlinking test/ is required for busted).

Also, use README.md instead of test/README.md in the Ex mode inccommand
test, as test/README.md no longer contains 'N' char.
This commit is contained in:
zeertzjq
2026-02-20 06:53:33 +08:00
committed by GitHub
parent 785ac9f228
commit e3d46a6337
15 changed files with 79 additions and 39 deletions

View File

@@ -20,6 +20,9 @@ describe('executable()', function()
if is_os('win') then
it('exepath respects shellslash', function()
-- test/ cannot be a symlink in this test.
n.api.nvim_set_current_dir(t.paths.test_source_path)
command('let $PATH = fnamemodify("./test/functional/fixtures/bin", ":p")')
eq(
[[test\functional\fixtures\bin\null.CMD]],
@@ -33,6 +36,9 @@ describe('executable()', function()
end)
it('stdpath respects shellslash', function()
-- Needs to check paths relative to repo root dir.
n.api.nvim_set_current_dir(t.paths.test_source_path)
t.matches(
[[build\Xtest_xdg[%w_]*\share\nvim%-data]],
call('fnamemodify', call('stdpath', 'data'), ':.')