fix(oldtests): move useful settings from ignored unix.vim

the unix.vim file was probably accidentally ignored at some point.
An actual invokation of nvim-under-test would in practice look like

  ["/path/to/neovim/build/bin/nvim", "-u", "unix.vim", "-U", "NONE", "-i", "NONE", "--noplugin", "--headless", "-u", "NONE", "--cmd", "set shortmess-=F", "-S", "runtest.vim", "test_arabic.vim"]

but -u NONE cancels out the earlier -u unix.vim

By now, too many tests rely on specific behavior from "NONE", so copy in
the useful parts of unix.vim to the cmdline again. also, some tests
conflict with `directory=.` (or even `directory=Xtempswapdir`) so don't use that.

`-U NONE` is dead code in Nvim, remove it.
This commit is contained in:
bfredl
2026-04-02 12:16:59 +02:00
parent 65ef6cec1c
commit 0ce48e7a9c
2 changed files with 5 additions and 6 deletions

View File

@@ -76,11 +76,10 @@ report:
test1.out: $(NVIM_PRG)
NO_PLUGINS = --noplugin --headless
# In vim, if the -u command line option is specified, compatible is turned on
# and viminfo is not read. Unlike vim, neovim reads viminfo and requires the
# -i command line option.
NO_INITS = -U NONE -i NONE $(NO_PLUGINS)
NO_INITS = -u NONE -i NONE --noplugin --headless
# TODO: find a way to avoid changing the distributed files.
fixff:
@@ -146,7 +145,7 @@ nolog:
# New style of tests uses Vim script with assert calls. These are easier
# to write and a lot easier to read and debug.
# Limitation: Only works with the +eval feature.
RUN_VIMTEST = $(TOOL) $(NVIM_PRG) -u unix.vim
RUN_VIMTEST = $(TOOL) $(NVIM_PRG)
newtests: newtestssilent
@/bin/sh -c "if test -f messages && grep -q 'FAILED' messages; then \
@@ -158,7 +157,7 @@ newtestssilent: $(NEW_TESTS_RES)
GEN_OPT_DEPS = gen_opt_test.vim ../../../src/nvim/options.lua ../../../runtime/doc/options.txt
opt_test.vim: $(GEN_OPT_DEPS)
$(NVIM_PRG) -e -s -u NONE $(NO_INITS) -S $(GEN_OPT_DEPS)
$(NVIM_PRG) -e -s $(NO_INITS) -S $(GEN_OPT_DEPS)
@if test -f gen_opt_test.log; then \
cat gen_opt_test.log; \
exit 1; \
@@ -171,4 +170,4 @@ test_options_all.res: opt_test.vim
@echo "[OLDTEST] Running" $*
@rm -rf $*.failed test.ok $(RM_ON_RUN)
@mkdir -p $(TMPDIR)
@/bin/sh runnvim.sh $(ROOT) $(NVIM_PRG) $* $(RUN_VIMTEST) $(NO_INITS) -u NONE --cmd "set shortmess-=F" -S runtest.vim $*.vim
@/bin/sh runnvim.sh $(ROOT) $(NVIM_PRG) $* $(RUN_VIMTEST) $(NO_INITS) --cmd "set shortmess-=F backupdir=. undodir=. viewdir=." -S runtest.vim $*.vim

View File

@@ -12,4 +12,4 @@ endif
set encoding=utf-8
" Use safer defaults for various directories
set backupdir=. directory=. undodir=. viewdir=.
set backupdir=. undodir=. viewdir=.