mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 20:55:18 -07:00
oldtest: support for running by filename (#11473)
Follow-up to 8969efca8
(Vim patch 8.1.0723)
NOTE: This changes the main entrypoint for running single oldtest files
to not use/require the ".res" extension anymore. But it is handled for
B/C.
Adds a phony rule to run oldtest by filename.
Not going through "$(MAKE)" avoids GNUmakefile being used then (which I
use for WIP things), and it seems like SINGLE_MAKE should be used anyway
probably.
This commit is contained in:
parent
7d66a02b88
commit
0b7a7b23cc
11
Makefile
11
Makefile
@ -119,8 +119,13 @@ oldtest: | nvim build/runtime/doc/tags
|
|||||||
ifeq ($(strip $(TEST_FILE)),)
|
ifeq ($(strip $(TEST_FILE)),)
|
||||||
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" $(MAKEOVERRIDES)
|
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" $(MAKEOVERRIDES)
|
||||||
else
|
else
|
||||||
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" SCRIPTS= $(MAKEOVERRIDES) $(TEST_FILE)
|
@# Handle TEST_FILE=test_foo{,.res,.vim}.
|
||||||
|
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" SCRIPTS= $(MAKEOVERRIDES) $(patsubst %.vim,%,$(patsubst %.res,%,$(TEST_FILE)))
|
||||||
endif
|
endif
|
||||||
|
# Build oldtest by specifying the relative .vim filename.
|
||||||
|
.PHONY: phony_force
|
||||||
|
src/nvim/testdir/%.vim: phony_force
|
||||||
|
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" SCRIPTS= $(MAKEOVERRIDES) $(patsubst src/nvim/testdir/%.vim,%,$@)
|
||||||
|
|
||||||
build/runtime/doc/tags helptags: | nvim
|
build/runtime/doc/tags helptags: | nvim
|
||||||
+$(BUILD_CMD) -C build runtime/doc/tags
|
+$(BUILD_CMD) -C build runtime/doc/tags
|
||||||
@ -201,10 +206,10 @@ lint: check-single-includes clint lualint _opt_pylint _opt_shlint
|
|||||||
# Generic pattern rules, allowing for `make build/bin/nvim` etc.
|
# Generic pattern rules, allowing for `make build/bin/nvim` etc.
|
||||||
# Does not work with "Unix Makefiles".
|
# Does not work with "Unix Makefiles".
|
||||||
ifeq ($(BUILD_TYPE),Ninja)
|
ifeq ($(BUILD_TYPE),Ninja)
|
||||||
build/%:
|
build/%: phony_force
|
||||||
$(BUILD_CMD) -C build $(patsubst build/%,%,$@)
|
$(BUILD_CMD) -C build $(patsubst build/%,%,$@)
|
||||||
|
|
||||||
$(DEPS_BUILD_DIR)/%:
|
$(DEPS_BUILD_DIR)/%: phony_force
|
||||||
$(BUILD_CMD) -C $(DEPS_BUILD_DIR) $(patsubst $(DEPS_BUILD_DIR)/%,%,$@)
|
$(BUILD_CMD) -C $(DEPS_BUILD_DIR) $(patsubst $(DEPS_BUILD_DIR)/%,%,$@)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -34,22 +34,23 @@ SCRIPTS ?= $(SCRIPTS_DEFAULT)
|
|||||||
|
|
||||||
# Tests using runtest.vim.
|
# Tests using runtest.vim.
|
||||||
NEW_TESTS_ALOT := test_alot_utf8 test_alot
|
NEW_TESTS_ALOT := test_alot_utf8 test_alot
|
||||||
NEW_TESTS_IN_ALOT := $(shell sed '/^source/ s/^source //;s/\.vim$$//' test_alot*.vim)
|
NEW_TESTS_IN_ALOT := $(shell sed -n '/^source/ s/^source //; s/\.vim$$//p' $(addsuffix .vim,$(NEW_TESTS_ALOT)))
|
||||||
|
NEW_TESTS_IN_ALOT_LATIN := $(shell sed -n '/^source/ s/^source //; s/\.vim$$//p' test_alot_latin.vim)
|
||||||
# Ignored tests.
|
# Ignored tests.
|
||||||
# test_alot_latin: Nvim does not allow setting encoding.
|
# test_alot_latin: Nvim does not allow setting encoding.
|
||||||
# test_autochdir: ported to Lua, but kept for easier merging.
|
# test_autochdir: ported to Lua, but kept for easier merging.
|
||||||
# test_eval_func: used as include in old-style test (test_eval.in).
|
# test_eval_func: used as include in old-style test (test_eval.in).
|
||||||
# test_listlbr: Nvim does not allow setting encoding.
|
# test_listlbr: Nvim does not allow setting encoding.
|
||||||
# test_largefile: uses too much resources to run on CI.
|
# test_largefile: uses too much resources to run on CI.
|
||||||
NEW_TESTS_IGNORE := $(NEW_TESTS_IN_ALOT) $(NEW_TESTS_ALOT) \
|
NEW_TESTS_IGNORE := \
|
||||||
test_alot_latin \
|
test_alot_latin $(NEW_TESTS_IN_ALOT_LATIN) \
|
||||||
test_autochdir \
|
test_autochdir \
|
||||||
test_eval_func \
|
test_eval_func \
|
||||||
test_listlbr \
|
test_listlbr \
|
||||||
test_largefile \
|
test_largefile \
|
||||||
|
|
||||||
NEW_TESTS ?= $(sort $(filter-out $(NEW_TESTS_IGNORE),$(basename $(notdir $(wildcard test_*.vim))))) $(NEW_TESTS_ALOT)
|
NEW_TESTS := $(sort $(basename $(notdir $(wildcard test_*.vim))))
|
||||||
NEW_TESTS_RES ?= $(addsuffix .res,$(NEW_TESTS))
|
NEW_TESTS_RES := $(addsuffix .res,$(filter-out $(NEW_TESTS_ALOT) $(NEW_TESTS_IN_ALOT) $(NEW_TESTS_IGNORE),$(NEW_TESTS)) $(NEW_TESTS_ALOT))
|
||||||
|
|
||||||
|
|
||||||
ifdef VALGRIND_GDB
|
ifdef VALGRIND_GDB
|
||||||
|
@ -77,11 +77,14 @@ To run all legacy Vim tests:
|
|||||||
|
|
||||||
make oldtest
|
make oldtest
|
||||||
|
|
||||||
To run a *single* legacy test set `TEST_FILE`, for example:
|
To run a *single* legacy test file you can use either:
|
||||||
|
|
||||||
TEST_FILE=test_syntax.res make oldtest
|
make oldtest TEST_FILE=test_syntax.vim
|
||||||
|
|
||||||
|
or:
|
||||||
|
|
||||||
|
make src/nvim/testdir/test_syntax.vim
|
||||||
|
|
||||||
- The `.res` extension (instead of `.vim`) is required.
|
|
||||||
- Specify only the test file name, not the full path.
|
- Specify only the test file name, not the full path.
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user