diff options
| author | watiko <service@mail.watiko.net> | 2015-12-13 12:19:54 +0900 |
|---|---|---|
| committer | watiko <service@mail.watiko.net> | 2016-01-10 09:01:30 +0900 |
| commit | 593df501b3a3687abb14a84299716bcd328b6ff8 (patch) | |
| tree | 5b9b9a381ea8f25d60e35a3be65f483703a33a7b /src/nvim/testdir/Makefile | |
| parent | 50db0312f941ba489466d7d6b21088f1870429ee (diff) | |
| download | rneovim-593df501b3a3687abb14a84299716bcd328b6ff8.tar.gz rneovim-593df501b3a3687abb14a84299716bcd328b6ff8.tar.bz2 rneovim-593df501b3a3687abb14a84299716bcd328b6ff8.zip | |
vim-patch:7.4.944
Problem: Writing tests for Vim script is hard.
Solution: Add assertEqual(), assertFalse() and assertTrue() functions. Add
the v:errors variable. Add the runtest script. Add a first new
style test script.
https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Diffstat (limited to 'src/nvim/testdir/Makefile')
| -rw-r--r-- | src/nvim/testdir/Makefile | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile index 1a414a8847..57d356705e 100644 --- a/src/nvim/testdir/Makefile +++ b/src/nvim/testdir/Makefile @@ -31,6 +31,8 @@ SCRIPTS := test_eval.out \ test_command_count.out \ test_cdo.out \ +NEW_TESTS = test_assert.res + SCRIPTS_GUI := test16.out @@ -62,9 +64,9 @@ ifdef TESTNUM SCRIPTS := test$(TESTNUM).out endif -nongui: nolog $(SCRIPTS) report +nongui: nolog $(SCRIPTS) newtests report -gui: nolog $(SCRIPTS) $(SCRIPTS_GUI) report +gui: nolog $(SCRIPTS) $(SCRIPTS_GUI) newtests report .gdbinit: echo 'set $$_exitcode = -1\nrun\nif $$_exitcode != -1\n quit\nend' > .gdbinit @@ -91,6 +93,7 @@ RUN_VIM := VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(TOOL) $(VIMPROG) clean: -rm -rf *.out \ *.failed \ + *.res \ *.rej \ *.orig \ test.log \ @@ -147,3 +150,14 @@ test49.out: test49.vim nolog: -rm -f test.log + + +# 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 = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(VALGRIND) $(VIMPROG) -u unix.vim -U NONE --noplugin + +newtests: $(NEW_TESTS) + +%.res: %.vim .gdbinit + $(RUN_VIMTEST) -u runtest.vim $*.vim |