patch 9.1.0763: tests: cannot run single syntax tests
Problem: tests: cannot run single syntax tests
Solution: Support running a subset of syntax tests
(Aliaksei Budavei)
Two methods of assembling a subset of test filenames for
selection are provided:
* Filename and filetype Make targets will be generated, and
multiple such targets can be passed before the mandated
trailing "test" target, e.g. "make html markdown test".
* Filenames and their parts can be specified as a regular
expression that is assigned to a "VIM_SYNTAX_TEST_FILTER"
environment variable, and used with the test Make target,
e.g. "VIM_SYNTAX_TEST_FILTER=html\\\|markdown make test".
(This variable will be ignored and the whole suite will be
run when Make is GNU Make and a parent Makefile is used.)
Methods can be used alone or together, with the Make targets
having the higher precedence. Neither method will influence
the order of test execution.
closes: #15670
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
a9c6f90918
commit
ec0229414b
@ -63,12 +63,40 @@ script file will be sourced before any VIM_TEST_SETUP commands are executed.
|
||||
|
||||
Every line of a source file must not be longer than 1425 (19 x 75) characters.
|
||||
|
||||
If there is no further setup required, you can now run the tests:
|
||||
If there is no further setup required, you can now run all tests:
|
||||
|
||||
make test
|
||||
|
||||
The first time this will fail with an error for a missing screendump. The
|
||||
newly created screendumps will be "failed/java_00.dump",
|
||||
Or you can run the tests for a filetype only by passing its file extension as
|
||||
another target, e.g. "java", before "test":
|
||||
|
||||
make java test
|
||||
|
||||
Or you can run a test or two by passing their filenames as extra targets, e.g.
|
||||
"java_string.java" and "java_numbers.java", before "test", after listing all
|
||||
available syntax tests for Java:
|
||||
|
||||
ls testdir/input/java*
|
||||
make java_string.java java_numbers.java test
|
||||
|
||||
(Some interactive shells may attempt to perform word completion on arbitrary
|
||||
command arguments when you press certain keys, e.g. Tab or Ctrl-i.)
|
||||
|
||||
As an alternative, you can specify a subset of test filenames for running as
|
||||
a regular expression and assign it to a VIM_SYNTAX_TEST_FILTER environment
|
||||
variable; e.g. to run all tests whose base names contain "fold", use any of:
|
||||
|
||||
make test -e 'VIM_SYNTAX_TEST_FILTER = fold.*\..\+'
|
||||
make test VIM_SYNTAX_TEST_FILTER='fold.*\..\+'
|
||||
VIM_SYNTAX_TEST_FILTER='fold.*\..\+' make test
|
||||
|
||||
Consider quoting the variable value to avoid any interpretation by the shell.
|
||||
|
||||
Both Make targets and the variable may be used at the same time, the target
|
||||
names will be tried for matching before the variable value.
|
||||
|
||||
The first time testing "input/java.java" will fail with an error for a missing
|
||||
screendump. The newly created screendumps will be "failed/java_00.dump",
|
||||
"failed/java_01.dump", etc. You can inspect each with:
|
||||
|
||||
call term_dumpload('failed/java_00.dump')
|
||||
@ -206,5 +234,4 @@ screendumps will be shown with no difference between their versions):
|
||||
../../../src/vim --clean -S viewdumps.vim
|
||||
|
||||
|
||||
TODO: run test for one specific filetype
|
||||
TODO: test syncing by jumping around
|
||||
|
||||
Reference in New Issue
Block a user