2023-06-11 19:04:18 +01:00
|
|
|
" Runs all the syntax tests for which there is no "done/name" file.
|
|
|
|
"
|
|
|
|
" Current directory must be runtime/syntax.
|
|
|
|
|
2024-10-24 23:03:10 +02:00
|
|
|
" needed because of line-continuation lines
|
|
|
|
set cpo&vim
|
|
|
|
|
2023-06-11 19:04:18 +01:00
|
|
|
" Only do this with the +eval feature
|
|
|
|
if 1
|
|
|
|
|
2023-06-22 21:57:51 +01:00
|
|
|
" Remember the directory where we started. Will change to "testdir" below.
|
|
|
|
let syntaxDir = getcwd()
|
|
|
|
|
|
|
|
let s:messagesFname = fnameescape(syntaxDir .. '/testdir/messages')
|
|
|
|
|
|
|
|
let s:messages = []
|
|
|
|
|
2025-03-08 16:58:17 +01:00
|
|
|
" Erase the cursor line and do not advance the cursor. (Call the function
|
|
|
|
" after each passing test report.)
|
|
|
|
def EraseLineAndReturnCarriage(line: string)
|
2025-03-01 16:28:20 +01:00
|
|
|
const full_width: number = winwidth(0)
|
|
|
|
const half_width: number = full_width - (full_width + 1) / 2
|
2025-03-08 16:58:17 +01:00
|
|
|
if strlen(line) > half_width
|
2025-03-01 16:28:20 +01:00
|
|
|
echon "\r" .. repeat("\x20", full_width) .. "\r"
|
|
|
|
else
|
|
|
|
echon repeat("\x20", half_width) .. "\r"
|
|
|
|
endif
|
|
|
|
enddef
|
|
|
|
|
2023-06-22 21:57:51 +01:00
|
|
|
" Add one message to the list of messages
|
|
|
|
func Message(msg)
|
|
|
|
echomsg a:msg
|
|
|
|
call add(s:messages, a:msg)
|
|
|
|
endfunc
|
|
|
|
|
|
|
|
" Report a fatal message and exit
|
|
|
|
func Fatal(msg)
|
|
|
|
echoerr a:msg
|
|
|
|
call AppendMessages(a:msg)
|
|
|
|
qall!
|
|
|
|
endfunc
|
|
|
|
|
|
|
|
" Append s:messages to the messages file and make it empty.
|
|
|
|
func AppendMessages(header)
|
2025-03-01 16:28:20 +01:00
|
|
|
silent exe 'split ' .. s:messagesFname
|
2023-06-22 21:57:51 +01:00
|
|
|
call append(line('$'), '')
|
|
|
|
call append(line('$'), a:header)
|
|
|
|
call append(line('$'), s:messages)
|
|
|
|
let s:messages = []
|
2025-03-01 16:28:20 +01:00
|
|
|
silent wq
|
2023-06-22 21:57:51 +01:00
|
|
|
endfunc
|
|
|
|
|
|
|
|
" Relevant messages are written to the "messages" file.
|
|
|
|
" If the file already exists it is appended to.
|
2025-03-01 16:28:20 +01:00
|
|
|
silent exe 'split ' .. s:messagesFname
|
2023-06-22 21:57:51 +01:00
|
|
|
call append(line('$'), repeat('=-', 70))
|
|
|
|
call append(line('$'), '')
|
2023-06-22 22:38:54 +01:00
|
|
|
let s:test_run_message = 'Test run on ' .. strftime("%Y %b %d %H:%M:%S")
|
|
|
|
call append(line('$'), s:test_run_message)
|
2025-03-01 16:28:20 +01:00
|
|
|
silent wq
|
2023-06-22 21:57:51 +01:00
|
|
|
|
|
|
|
if syntaxDir !~ '[/\\]runtime[/\\]syntax\>'
|
|
|
|
call Fatal('Current directory must be "runtime/syntax"')
|
2023-06-11 19:04:18 +01:00
|
|
|
endif
|
|
|
|
if !isdirectory('testdir')
|
2023-06-22 21:57:51 +01:00
|
|
|
call Fatal('"testdir" directory not found')
|
2023-06-11 19:04:18 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
" Use the script for source code screendump testing. It sources other scripts,
|
|
|
|
" therefore we must "cd" there.
|
|
|
|
cd ../../src/testdir
|
|
|
|
source screendump.vim
|
2023-06-22 21:57:51 +01:00
|
|
|
exe 'cd ' .. fnameescape(syntaxDir)
|
2023-06-11 19:04:18 +01:00
|
|
|
|
|
|
|
" For these tests we need to be able to run terminal Vim with 256 colors. On
|
|
|
|
" MS-Windows the console only has 16 colors and the GUI can't run in a
|
|
|
|
" terminal.
|
|
|
|
if !CanRunVimInTerminal()
|
2023-06-22 21:57:51 +01:00
|
|
|
call Fatal('Cannot make screendumps, aborting')
|
2023-06-11 19:04:18 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
cd testdir
|
2025-03-08 16:58:17 +01:00
|
|
|
|
2023-06-11 19:04:18 +01:00
|
|
|
if !isdirectory('done')
|
|
|
|
call mkdir('done')
|
|
|
|
endif
|
|
|
|
|
2025-03-08 16:58:17 +01:00
|
|
|
if !isdirectory('failed')
|
|
|
|
call mkdir('failed')
|
|
|
|
endif
|
|
|
|
|
2023-06-11 19:04:18 +01:00
|
|
|
set nocp
|
|
|
|
set nowrapscan
|
|
|
|
set report=9999
|
|
|
|
set modeline
|
|
|
|
set debug=throw
|
|
|
|
set nomore
|
|
|
|
|
|
|
|
au! SwapExists * call HandleSwapExists()
|
|
|
|
func HandleSwapExists()
|
|
|
|
" Ignore finding a swap file for the test input, the user might be editing
|
|
|
|
" it and that's OK.
|
|
|
|
if expand('<afile>') =~ 'input[/\\].*\..*'
|
|
|
|
let v:swapchoice = 'e'
|
|
|
|
endif
|
|
|
|
endfunc
|
|
|
|
|
2025-03-01 16:28:20 +01:00
|
|
|
" Trace ruler liveness on demand.
|
|
|
|
if !empty($VIM_SYNTAX_TEST_LOG) && filewritable($VIM_SYNTAX_TEST_LOG)
|
|
|
|
def s:TraceRulerLiveness(context: string, times: number, tail: string)
|
|
|
|
writefile([printf('%s: %4d: %s', context, times, tail)],
|
|
|
|
$VIM_SYNTAX_TEST_LOG,
|
|
|
|
'a')
|
|
|
|
enddef
|
|
|
|
else
|
|
|
|
def s:TraceRulerLiveness(_: string, _: number, _: string)
|
|
|
|
enddef
|
|
|
|
endif
|
|
|
|
|
|
|
|
" See ":help 'ruler'".
|
|
|
|
def s:CannotSeeLastLine(ruler: list<string>): bool
|
|
|
|
return !(get(ruler, -1, '') ==# 'All' || get(ruler, -1, '') ==# 'Bot')
|
|
|
|
enddef
|
|
|
|
|
|
|
|
def s:CannotDumpNextPage(buf: number, prev_ruler: list<string>, ruler: list<string>): bool
|
|
|
|
return !(ruler !=# prev_ruler &&
|
|
|
|
len(ruler) == 2 &&
|
|
|
|
ruler[1] =~# '\%(\d%\|\<Bot\)$' &&
|
|
|
|
get(term_getcursor(buf), 0) != 20)
|
|
|
|
enddef
|
|
|
|
|
|
|
|
def s:CannotDumpFirstPage(buf: number, _: list<string>, ruler: list<string>): bool
|
|
|
|
return !(len(ruler) == 2 &&
|
|
|
|
ruler[1] =~# '\%(\<All\|\<Top\)$' &&
|
|
|
|
get(term_getcursor(buf), 0) != 20)
|
|
|
|
enddef
|
|
|
|
|
|
|
|
def s:CannotDumpShellFirstPage(buf: number, _: list<string>, ruler: list<string>): bool
|
|
|
|
return !(len(ruler) > 3 &&
|
|
|
|
get(ruler, -1, '') =~# '\%(\<All\|\<Top\)$' &&
|
|
|
|
get(term_getcursor(buf), 0) != 20)
|
|
|
|
enddef
|
|
|
|
|
|
|
|
" Poll for updates of the cursor position in the terminal buffer occupying the
|
|
|
|
" first window. (ALWAYS call the function or its equivalent before calling
|
|
|
|
" "VerifyScreenDump()" *and* after calling any number of "term_sendkeys()".)
|
|
|
|
def s:TermPollRuler(
|
|
|
|
CannotDumpPage: func, # (TYPE FOR LEGACY CONTEXT CALL SITES.)
|
|
|
|
buf: number,
|
|
|
|
in_name_and_out_name: string): list<string>
|
|
|
|
# Expect defaults from "term_util#RunVimInTerminal()".
|
2024-05-21 01:10:26 +03:00
|
|
|
if winwidth(1) != 75 || winheight(1) != 20
|
|
|
|
ch_log(printf('Aborting for %s: (75 x 20) != (%d x %d)',
|
|
|
|
in_name_and_out_name,
|
|
|
|
winwidth(1),
|
|
|
|
winheight(1)))
|
2025-03-01 16:28:20 +01:00
|
|
|
return ['0,0-1', 'All']
|
2024-05-21 01:10:26 +03:00
|
|
|
endif
|
2025-03-01 16:28:20 +01:00
|
|
|
# A two-fold role for redrawing:
|
|
|
|
# (*) in case the terminal buffer cannot redraw itself just yet;
|
|
|
|
# (*) to avoid extra "real estate" checks.
|
2024-05-21 01:10:26 +03:00
|
|
|
redraw
|
2025-03-01 16:28:20 +01:00
|
|
|
# The contents of "ruler".
|
|
|
|
var ruler: list<string> = []
|
|
|
|
# Attempts at most, targeting ASan-instrumented Vim builds.
|
|
|
|
var times: number = 2048
|
|
|
|
# Check "real estate" of the terminal buffer. Read and compare its ruler
|
|
|
|
# line and let "Xtestscript#s:AssertCursorForwardProgress()" do the rest.
|
|
|
|
# Note that the cursor ought to be advanced after each successive call of
|
|
|
|
# this function yet its relative position need not be changed (e.g. "0%").
|
|
|
|
while CannotDumpPage(ruler) && times > 0
|
|
|
|
ruler = split(term_getline(buf, 20))
|
|
|
|
sleep 1m
|
|
|
|
times -= 1
|
|
|
|
if times % 8 == 0
|
|
|
|
redraw
|
|
|
|
endif
|
|
|
|
endwhile
|
|
|
|
TraceRulerLiveness('P', (2048 - times), in_name_and_out_name)
|
|
|
|
return ruler
|
|
|
|
enddef
|
|
|
|
|
|
|
|
" Prevent "s:TermPollRuler()" from prematurely reading the cursor position,
|
|
|
|
" which is available at ":edit", after outracing the loading of syntax etc. in
|
|
|
|
" the terminal buffer. (Call the function before calling "VerifyScreenDump()"
|
|
|
|
" for the first time.)
|
|
|
|
def s:TermWaitAndPollRuler(buf: number, in_name_and_out_name: string): list<string>
|
|
|
|
# Expect defaults from "term_util#RunVimInTerminal()".
|
|
|
|
if winwidth(1) != 75 || winheight(1) != 20
|
|
|
|
ch_log(printf('Aborting for %s: (75 x 20) != (%d x %d)',
|
|
|
|
in_name_and_out_name,
|
|
|
|
winwidth(1),
|
|
|
|
winheight(1)))
|
|
|
|
return ['0,0-1', 'All']
|
|
|
|
endif
|
|
|
|
# The contents of "ruler".
|
|
|
|
var ruler: string = ''
|
|
|
|
# Attempts at most, targeting ASan-instrumented Vim builds.
|
|
|
|
var times: number = 32768
|
|
|
|
# Check "real estate" of the terminal buffer. Expect a known token to be
|
|
|
|
# rendered in the terminal buffer; its prefix must be "is_" so that buffer
|
|
|
|
# variables from "sh.vim" can be matched (see "Xtestscript#ShellInfo()").
|
|
|
|
# Verify that the whole line is available!
|
|
|
|
while ruler !~# '^is_.\+\s\%(All\|Top\)$' && times > 0
|
|
|
|
ruler = term_getline(buf, 20)
|
|
|
|
sleep 1m
|
|
|
|
times -= 1
|
|
|
|
if times % 16 == 0
|
|
|
|
redraw
|
|
|
|
endif
|
|
|
|
endwhile
|
|
|
|
TraceRulerLiveness('W', (32768 - times), in_name_and_out_name)
|
|
|
|
if strpart(ruler, 0, 8) !=# 'is_nonce'
|
|
|
|
# Retain any of "b:is_(bash|dash|kornshell|posix|sh)" entries and let
|
|
|
|
# "CannotDumpShellFirstPage()" win the cursor race.
|
|
|
|
return TermPollRuler(
|
|
|
|
function(CannotDumpShellFirstPage, [buf, []]),
|
|
|
|
buf,
|
|
|
|
in_name_and_out_name)
|
|
|
|
else
|
|
|
|
# Clear the "is_nonce" token and let "CannotDumpFirstPage()" win any
|
|
|
|
# race.
|
|
|
|
term_sendkeys(buf, ":redraw!\<CR>")
|
|
|
|
endif
|
|
|
|
return TermPollRuler(
|
|
|
|
function(CannotDumpFirstPage, [buf, []]),
|
|
|
|
buf,
|
|
|
|
in_name_and_out_name)
|
2024-05-21 01:10:26 +03:00
|
|
|
enddef
|
|
|
|
|
2024-02-28 21:24:25 +01:00
|
|
|
func RunTest()
|
2025-03-08 16:58:17 +01:00
|
|
|
let XTESTSCRIPT =<< trim END
|
|
|
|
" Track the cursor progress through a syntax test file so that any
|
|
|
|
" degenerate input can be reported. Each file will have its own cursor.
|
|
|
|
let s:cursor = 1
|
|
|
|
|
|
|
|
" extra info for shell variables
|
|
|
|
func ShellInfo()
|
|
|
|
let msg = ''
|
|
|
|
for [key, val] in items(b:)
|
|
|
|
if key =~ '^is_'
|
|
|
|
let msg ..= key .. ': ' .. val .. ', '
|
|
|
|
endif
|
|
|
|
endfor
|
|
|
|
if msg != ''
|
|
|
|
echomsg msg
|
|
|
|
endif
|
|
|
|
endfunc
|
|
|
|
|
|
|
|
au! SwapExists * call HandleSwapExists()
|
|
|
|
func HandleSwapExists()
|
|
|
|
" Ignore finding a swap file for the test input, the user might be
|
|
|
|
" editing it and that's OK.
|
|
|
|
if expand('<afile>') =~ 'input[/\\].*\..*'
|
|
|
|
let v:swapchoice = 'e'
|
|
|
|
endif
|
|
|
|
endfunc
|
|
|
|
|
|
|
|
func LoadFiletype(type)
|
|
|
|
for file in glob("ftplugin/" .. a:type .. "*.vim", 1, 1)
|
|
|
|
exe "source " .. file
|
|
|
|
endfor
|
|
|
|
redraw!
|
|
|
|
endfunc
|
|
|
|
|
|
|
|
func SetUpVim()
|
|
|
|
call cursor(1, 1)
|
|
|
|
" Defend against rogue VIM_TEST_SETUP commands.
|
|
|
|
for _ in range(20)
|
|
|
|
let lnum = search('\C\<VIM_TEST_SETUP\>', 'eW', 20)
|
|
|
|
if lnum < 1
|
|
|
|
break
|
|
|
|
endif
|
|
|
|
exe substitute(getline(lnum), '\C.*\<VIM_TEST_SETUP\>', '', '')
|
|
|
|
endfor
|
|
|
|
call cursor(1, 1)
|
|
|
|
" BEGIN [runtime/defaults.vim]
|
|
|
|
" Also, disable italic highlighting to avoid issues on some terminals.
|
|
|
|
set display=lastline ruler scrolloff=5 t_ZH= t_ZR=
|
|
|
|
syntax on
|
|
|
|
" END [runtime/defaults.vim]
|
|
|
|
redraw!
|
|
|
|
endfunc
|
|
|
|
|
|
|
|
def s:AssertCursorForwardProgress(): bool
|
|
|
|
const curnum: number = line('.')
|
|
|
|
if curnum <= cursor
|
|
|
|
# Use "actions/upload-artifact@v4" of ci.yml for delivery.
|
|
|
|
writefile([printf('No cursor progress: %d <= %d (%s). Please file an issue.',
|
|
|
|
curnum,
|
|
|
|
cursor,
|
|
|
|
bufname('%'))],
|
|
|
|
'failed/00-FIXME',
|
|
|
|
'a')
|
|
|
|
bwipeout!
|
|
|
|
endif
|
|
|
|
cursor = curnum
|
|
|
|
return true
|
|
|
|
enddef
|
|
|
|
|
|
|
|
def ScrollToSecondPage(estate: number, op_wh: number, op_so: number): bool
|
|
|
|
if line('.') != 1 || line('w$') >= line('$')
|
|
|
|
return AssertCursorForwardProgress()
|
|
|
|
endif
|
|
|
|
try
|
|
|
|
set scrolloff=0
|
|
|
|
# Advance mark "c"[ursor] along with the cursor.
|
|
|
|
norm! Lmc
|
|
|
|
if foldclosed('.') < 0 &&
|
|
|
|
(strdisplaywidth(getline('.')) + &l:fdc * winheight(1)) >= estate
|
|
|
|
# Make for an exit for a screenful long line.
|
|
|
|
norm! j^
|
|
|
|
return AssertCursorForwardProgress()
|
|
|
|
else
|
|
|
|
# Place the cursor on the actually last visible line.
|
|
|
|
while winline() < op_wh
|
|
|
|
const lastnum: number = winline()
|
|
|
|
norm! gjmc
|
|
|
|
if lastnum > winline()
|
|
|
|
break
|
|
|
|
endif
|
|
|
|
endwhile
|
|
|
|
norm! zt
|
|
|
|
endif
|
|
|
|
finally
|
|
|
|
# COMPATIBILITY: Scroll up around "scrolloff" lines.
|
|
|
|
&scrolloff = max([1, op_so])
|
|
|
|
endtry
|
|
|
|
norm! ^
|
|
|
|
return AssertCursorForwardProgress()
|
|
|
|
enddef
|
|
|
|
|
|
|
|
def ScrollToNextPage(estate: number, op_wh: number, op_so: number): bool
|
|
|
|
if line('.') == 1 || line('w$') >= line('$')
|
|
|
|
return AssertCursorForwardProgress()
|
|
|
|
endif
|
|
|
|
try
|
|
|
|
set scrolloff=0
|
|
|
|
# Advance mark "c"[ursor] along with the cursor.
|
|
|
|
norm! Lmc
|
|
|
|
if foldclosed('.') < 0 &&
|
|
|
|
(strdisplaywidth(getline('.')) + &l:fdc * winheight(1)) >= estate
|
|
|
|
# Make for an exit for a screenful long line.
|
|
|
|
norm! j^
|
|
|
|
return AssertCursorForwardProgress()
|
|
|
|
else
|
|
|
|
# Place the cursor on the actually last visible line.
|
|
|
|
while winline() < op_wh
|
|
|
|
const lastnum: number = winline()
|
|
|
|
norm! gjmc
|
|
|
|
if lastnum > winline()
|
|
|
|
break
|
|
|
|
endif
|
|
|
|
endwhile
|
|
|
|
endif
|
|
|
|
finally
|
|
|
|
# COMPATIBILITY: Scroll up/down around "scrolloff" lines.
|
|
|
|
&scrolloff = max([1, op_so])
|
|
|
|
endtry
|
|
|
|
norm! zt
|
|
|
|
const marknum: number = line("'c")
|
|
|
|
# Eschew &smoothscroll since line("`c") is not supported.
|
|
|
|
# Remember that "w0" can point to the first line of a _closed_ fold
|
|
|
|
# whereas the last line of a _closed_ fold can be marked.
|
|
|
|
if line('w0') > marknum
|
|
|
|
while line('w0') > marknum
|
|
|
|
exe "norm! \<C-y>"
|
|
|
|
endwhile
|
|
|
|
if line('w0') != marknum
|
|
|
|
exe "norm! \<C-e>H"
|
|
|
|
endif
|
|
|
|
# Handle non-wrapped lines.
|
|
|
|
elseif line('w0') < marknum
|
|
|
|
while line('w0') < marknum
|
|
|
|
exe "norm! \<C-e>"
|
|
|
|
endwhile
|
|
|
|
if line('w0') != marknum
|
|
|
|
exe "norm! \<C-y>H"
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
norm! ^
|
|
|
|
return AssertCursorForwardProgress()
|
|
|
|
enddef
|
|
|
|
END
|
|
|
|
let MAX_FAILED_COUNT = 5
|
2025-03-16 20:59:28 +01:00
|
|
|
let DUMP_OPTS = exists("$VIM_SYNTAX_TEST_WAIT_TIME") &&
|
|
|
|
\ !empty($VIM_SYNTAX_TEST_WAIT_TIME)
|
|
|
|
\ ? {'wait': max([1, str2nr($VIM_SYNTAX_TEST_WAIT_TIME)])}
|
|
|
|
\ : {}
|
|
|
|
lockvar DUMP_OPTS MAX_FAILED_COUNT XTESTSCRIPT
|
2024-02-28 21:24:25 +01:00
|
|
|
let ok_count = 0
|
runtime(syntax-tests): Do not ignore failed screendumps
The process of preparing and submitting syntax tests is
fraught with challenges that can turn away many aspiring
contributors from ever attempting it. (Out of 69 languages
introduced since v9.0.1627, there are only syntax tests for
Tera.)
After v9.1.1176~1, one visual clue for admitting syntax test
failures previously available with e.g. "git status" is gone
after all files under "failed/" have been made ignored for
Git and Mercurial. There isn't a single way to go about it:
some people may move files from "failed/" to "dumps/" after
each iteration; some people may only move "good" iteration
files; when a test file is refactored to a great extent,
some people may prefer deleting all test-related files under
"dumps/" before moving files from "failed/". The usability
of reporting, at any time, that there are some _untracked_
files under "failed/" cannot be overstated. Without it, the
chances are greater for pushing mismatched changesets. And
when tests fail then everyone but the author will be kept in
the dark about the cause: were some updated screendumps not
committed _or_ was a wrong version of the syntax plugin
committed?
Another file, "testdir/Xfilter" (v9.1.0763), that will be
created to establish communication from Make to Vim about
what subset of syntax tests is requested for running, should
also be not ignored but rather deleted once its contents are
read. Unless it is explicitly deleted _after test failure_,
the file may contain new *and* old test names when another
testing attempt is under way. And by virtue of it being
ignored, the reason for also running not requested tests
will be as ever puzzling.
Both Git and Mercurial support per-user configuration; such
wide-reaching settings hardly belong to clonable defaults.
Also, match literal dots in testname filters.
Also, discover and report _some_ disused screendump files
tracked under "dumps/".
References:
- https://git-scm.com/docs/gitignore
- https://www.mercurial-scm.org/help/topics/config#ui
closes: #16917
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-23 10:42:23 +01:00
|
|
|
let disused_pages = []
|
2024-02-28 21:24:25 +01:00
|
|
|
let failed_tests = []
|
|
|
|
let skipped_count = 0
|
2025-03-08 16:58:17 +01:00
|
|
|
let last_test_status = 'invalid'
|
runtime(syntax-tests): Do not ignore failed screendumps
The process of preparing and submitting syntax tests is
fraught with challenges that can turn away many aspiring
contributors from ever attempting it. (Out of 69 languages
introduced since v9.0.1627, there are only syntax tests for
Tera.)
After v9.1.1176~1, one visual clue for admitting syntax test
failures previously available with e.g. "git status" is gone
after all files under "failed/" have been made ignored for
Git and Mercurial. There isn't a single way to go about it:
some people may move files from "failed/" to "dumps/" after
each iteration; some people may only move "good" iteration
files; when a test file is refactored to a great extent,
some people may prefer deleting all test-related files under
"dumps/" before moving files from "failed/". The usability
of reporting, at any time, that there are some _untracked_
files under "failed/" cannot be overstated. Without it, the
chances are greater for pushing mismatched changesets. And
when tests fail then everyone but the author will be kept in
the dark about the cause: were some updated screendumps not
committed _or_ was a wrong version of the syntax plugin
committed?
Another file, "testdir/Xfilter" (v9.1.0763), that will be
created to establish communication from Make to Vim about
what subset of syntax tests is requested for running, should
also be not ignored but rather deleted once its contents are
read. Unless it is explicitly deleted _after test failure_,
the file may contain new *and* old test names when another
testing attempt is under way. And by virtue of it being
ignored, the reason for also running not requested tests
will be as ever puzzling.
Both Git and Mercurial support per-user configuration; such
wide-reaching settings hardly belong to clonable defaults.
Also, match literal dots in testname filters.
Also, discover and report _some_ disused screendump files
tracked under "dumps/".
References:
- https://git-scm.com/docs/gitignore
- https://www.mercurial-scm.org/help/topics/config#ui
closes: #16917
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-23 10:42:23 +01:00
|
|
|
let filter = ''
|
2024-03-05 22:34:36 +03:00
|
|
|
" Create a map of setup configuration filenames with their basenames as keys.
|
|
|
|
let setup = glob('input/setup/*.vim', 1, 1)
|
|
|
|
\ ->reduce({d, f -> extend(d, {fnamemodify(f, ':t:r'): f})}, {})
|
2024-10-06 16:57:33 +02:00
|
|
|
" Turn a subset of filenames etc. requested for testing into a pattern.
|
runtime(syntax-tests): Do not ignore failed screendumps
The process of preparing and submitting syntax tests is
fraught with challenges that can turn away many aspiring
contributors from ever attempting it. (Out of 69 languages
introduced since v9.0.1627, there are only syntax tests for
Tera.)
After v9.1.1176~1, one visual clue for admitting syntax test
failures previously available with e.g. "git status" is gone
after all files under "failed/" have been made ignored for
Git and Mercurial. There isn't a single way to go about it:
some people may move files from "failed/" to "dumps/" after
each iteration; some people may only move "good" iteration
files; when a test file is refactored to a great extent,
some people may prefer deleting all test-related files under
"dumps/" before moving files from "failed/". The usability
of reporting, at any time, that there are some _untracked_
files under "failed/" cannot be overstated. Without it, the
chances are greater for pushing mismatched changesets. And
when tests fail then everyone but the author will be kept in
the dark about the cause: were some updated screendumps not
committed _or_ was a wrong version of the syntax plugin
committed?
Another file, "testdir/Xfilter" (v9.1.0763), that will be
created to establish communication from Make to Vim about
what subset of syntax tests is requested for running, should
also be not ignored but rather deleted once its contents are
read. Unless it is explicitly deleted _after test failure_,
the file may contain new *and* old test names when another
testing attempt is under way. And by virtue of it being
ignored, the reason for also running not requested tests
will be as ever puzzling.
Both Git and Mercurial support per-user configuration; such
wide-reaching settings hardly belong to clonable defaults.
Also, match literal dots in testname filters.
Also, discover and report _some_ disused screendump files
tracked under "dumps/".
References:
- https://git-scm.com/docs/gitignore
- https://www.mercurial-scm.org/help/topics/config#ui
closes: #16917
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-23 10:42:23 +01:00
|
|
|
if filereadable('../testdir/Xfilter')
|
|
|
|
let filter = readfile('../testdir/Xfilter')
|
|
|
|
\ ->map({_, v -> '^' .. escape(substitute(v, '_$', '', ''), '.')})
|
2024-10-06 16:57:33 +02:00
|
|
|
\ ->join('\|')
|
runtime(syntax-tests): Do not ignore failed screendumps
The process of preparing and submitting syntax tests is
fraught with challenges that can turn away many aspiring
contributors from ever attempting it. (Out of 69 languages
introduced since v9.0.1627, there are only syntax tests for
Tera.)
After v9.1.1176~1, one visual clue for admitting syntax test
failures previously available with e.g. "git status" is gone
after all files under "failed/" have been made ignored for
Git and Mercurial. There isn't a single way to go about it:
some people may move files from "failed/" to "dumps/" after
each iteration; some people may only move "good" iteration
files; when a test file is refactored to a great extent,
some people may prefer deleting all test-related files under
"dumps/" before moving files from "failed/". The usability
of reporting, at any time, that there are some _untracked_
files under "failed/" cannot be overstated. Without it, the
chances are greater for pushing mismatched changesets. And
when tests fail then everyone but the author will be kept in
the dark about the cause: were some updated screendumps not
committed _or_ was a wrong version of the syntax plugin
committed?
Another file, "testdir/Xfilter" (v9.1.0763), that will be
created to establish communication from Make to Vim about
what subset of syntax tests is requested for running, should
also be not ignored but rather deleted once its contents are
read. Unless it is explicitly deleted _after test failure_,
the file may contain new *and* old test names when another
testing attempt is under way. And by virtue of it being
ignored, the reason for also running not requested tests
will be as ever puzzling.
Both Git and Mercurial support per-user configuration; such
wide-reaching settings hardly belong to clonable defaults.
Also, match literal dots in testname filters.
Also, discover and report _some_ disused screendump files
tracked under "dumps/".
References:
- https://git-scm.com/docs/gitignore
- https://www.mercurial-scm.org/help/topics/config#ui
closes: #16917
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-23 10:42:23 +01:00
|
|
|
call delete('../testdir/Xfilter')
|
|
|
|
endif
|
2024-10-06 16:57:33 +02:00
|
|
|
|
2025-03-16 20:59:28 +01:00
|
|
|
" Treat "^self-testing" as a string NOT as a regexp.
|
|
|
|
if filter ==# '^self-testing'
|
2024-05-24 19:14:16 +03:00
|
|
|
let dirpath = 'input/selftestdir/'
|
2024-08-12 18:37:15 +02:00
|
|
|
let fnames = readdir(dirpath, {fname -> fname !~ '^README\.txt$'})
|
2024-05-24 19:14:16 +03:00
|
|
|
else
|
|
|
|
let dirpath = 'input/'
|
2024-10-06 16:57:33 +02:00
|
|
|
let filter ..= exists("$VIM_SYNTAX_TEST_FILTER") &&
|
|
|
|
\ !empty($VIM_SYNTAX_TEST_FILTER)
|
|
|
|
\ ? (empty(filter) ? '' : '\|') .. $VIM_SYNTAX_TEST_FILTER
|
|
|
|
\ : ''
|
|
|
|
let fnames = readdir(dirpath,
|
|
|
|
\ {subset -> {fname -> fname !~ '\~$' && fname =~# subset}}(
|
|
|
|
\ empty(filter) ? '^.\+\..\+$' : filter))
|
2024-05-24 19:14:16 +03:00
|
|
|
endif
|
2024-02-28 21:24:25 +01:00
|
|
|
|
2024-05-24 19:14:16 +03:00
|
|
|
for fname in fnames
|
|
|
|
let root = fnamemodify(fname, ':r')
|
|
|
|
let fname = dirpath .. fname
|
2024-02-28 21:24:25 +01:00
|
|
|
|
|
|
|
" Execute the test if the "done" file does not exist or when the input file
|
|
|
|
" is newer.
|
|
|
|
let in_time = getftime(fname)
|
|
|
|
let out_time = getftime('done/' .. root)
|
|
|
|
if out_time < 0 || in_time > out_time
|
|
|
|
call ch_log('running tests for: ' .. fname)
|
2025-03-08 16:58:17 +01:00
|
|
|
let filetype = substitute(root, '\([^_.]*\)[_.].*', '\1', '')
|
|
|
|
let failed_root = 'failed/' .. root
|
2024-02-28 21:24:25 +01:00
|
|
|
|
runtime(syntax-tests): Do not ignore failed screendumps
The process of preparing and submitting syntax tests is
fraught with challenges that can turn away many aspiring
contributors from ever attempting it. (Out of 69 languages
introduced since v9.0.1627, there are only syntax tests for
Tera.)
After v9.1.1176~1, one visual clue for admitting syntax test
failures previously available with e.g. "git status" is gone
after all files under "failed/" have been made ignored for
Git and Mercurial. There isn't a single way to go about it:
some people may move files from "failed/" to "dumps/" after
each iteration; some people may only move "good" iteration
files; when a test file is refactored to a great extent,
some people may prefer deleting all test-related files under
"dumps/" before moving files from "failed/". The usability
of reporting, at any time, that there are some _untracked_
files under "failed/" cannot be overstated. Without it, the
chances are greater for pushing mismatched changesets. And
when tests fail then everyone but the author will be kept in
the dark about the cause: were some updated screendumps not
committed _or_ was a wrong version of the syntax plugin
committed?
Another file, "testdir/Xfilter" (v9.1.0763), that will be
created to establish communication from Make to Vim about
what subset of syntax tests is requested for running, should
also be not ignored but rather deleted once its contents are
read. Unless it is explicitly deleted _after test failure_,
the file may contain new *and* old test names when another
testing attempt is under way. And by virtue of it being
ignored, the reason for also running not requested tests
will be as ever puzzling.
Both Git and Mercurial support per-user configuration; such
wide-reaching settings hardly belong to clonable defaults.
Also, match literal dots in testname filters.
Also, discover and report _some_ disused screendump files
tracked under "dumps/".
References:
- https://git-scm.com/docs/gitignore
- https://www.mercurial-scm.org/help/topics/config#ui
closes: #16917
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-23 10:42:23 +01:00
|
|
|
for pagename in glob(failed_root .. '_\d*\.dump', 1, 1)
|
|
|
|
call delete(pagename)
|
2024-02-28 21:24:25 +01:00
|
|
|
endfor
|
|
|
|
call delete('done/' .. root)
|
2025-03-08 16:58:17 +01:00
|
|
|
call writefile(XTESTSCRIPT, 'Xtestscript')
|
2024-02-28 21:24:25 +01:00
|
|
|
|
|
|
|
" close all but the last window
|
|
|
|
while winnr('$') > 1
|
|
|
|
close
|
|
|
|
endwhile
|
|
|
|
|
|
|
|
" Redraw to make sure that messages are cleared and there is enough space
|
|
|
|
" for the terminal window.
|
|
|
|
redraw
|
|
|
|
|
2024-03-05 22:34:36 +03:00
|
|
|
" Let "Xtestscript#SetUpVim()" turn the syntax on.
|
2024-03-05 22:34:36 +03:00
|
|
|
let prefix = '-Nu NONE -S Xtestscript'
|
|
|
|
let path = get(setup, root, '')
|
|
|
|
" Source the found setup configuration file.
|
|
|
|
let args = !empty(path)
|
|
|
|
\ ? prefix .. ' -S ' .. path
|
|
|
|
\ : prefix
|
|
|
|
let buf = RunVimInTerminal(args, {})
|
2024-02-28 21:24:25 +01:00
|
|
|
" edit the file only after catching the SwapExists event
|
|
|
|
call term_sendkeys(buf, ":edit " .. fname .. "\<CR>")
|
2024-03-05 22:34:36 +03:00
|
|
|
" set up the testing environment
|
|
|
|
call term_sendkeys(buf, ":call SetUpVim()\<CR>")
|
2024-02-28 21:24:25 +01:00
|
|
|
" load filetype specific settings
|
|
|
|
call term_sendkeys(buf, ":call LoadFiletype('" .. filetype .. "')\<CR>")
|
|
|
|
|
2025-03-01 16:28:20 +01:00
|
|
|
" Make a synchronisation point between buffers by requesting to echo
|
|
|
|
" a known token in the terminal buffer and asserting its availability
|
|
|
|
" with "s:TermWaitAndPollRuler()".
|
2024-02-28 21:24:25 +01:00
|
|
|
if filetype == 'sh'
|
|
|
|
call term_sendkeys(buf, ":call ShellInfo()\<CR>")
|
2025-03-01 16:28:20 +01:00
|
|
|
else
|
|
|
|
call term_sendkeys(buf, ":echo 'is_nonce'\<CR>")
|
2024-02-28 21:24:25 +01:00
|
|
|
endif
|
2023-06-23 22:59:26 +01:00
|
|
|
|
2024-02-28 21:24:25 +01:00
|
|
|
let root_00 = root .. '_00'
|
2024-05-21 01:10:26 +03:00
|
|
|
let in_name_and_out_name = fname .. ': failed/' .. root_00 .. '.dump'
|
2025-03-01 16:28:20 +01:00
|
|
|
" Queue up all "term_sendkeys()"es and let them finish before returning
|
|
|
|
" from "s:TermWaitAndPollRuler()".
|
|
|
|
let ruler = s:TermWaitAndPollRuler(buf, in_name_and_out_name)
|
2024-05-21 01:10:26 +03:00
|
|
|
call ch_log('First screendump for ' .. in_name_and_out_name)
|
2025-03-01 16:28:20 +01:00
|
|
|
" Make a screendump at the start of the file: failed/root_00.dump
|
2025-03-16 20:59:28 +01:00
|
|
|
let fail = VerifyScreenDump(buf, root_00, DUMP_OPTS)
|
runtime(syntax-tests): Do not ignore failed screendumps
The process of preparing and submitting syntax tests is
fraught with challenges that can turn away many aspiring
contributors from ever attempting it. (Out of 69 languages
introduced since v9.0.1627, there are only syntax tests for
Tera.)
After v9.1.1176~1, one visual clue for admitting syntax test
failures previously available with e.g. "git status" is gone
after all files under "failed/" have been made ignored for
Git and Mercurial. There isn't a single way to go about it:
some people may move files from "failed/" to "dumps/" after
each iteration; some people may only move "good" iteration
files; when a test file is refactored to a great extent,
some people may prefer deleting all test-related files under
"dumps/" before moving files from "failed/". The usability
of reporting, at any time, that there are some _untracked_
files under "failed/" cannot be overstated. Without it, the
chances are greater for pushing mismatched changesets. And
when tests fail then everyone but the author will be kept in
the dark about the cause: were some updated screendumps not
committed _or_ was a wrong version of the syntax plugin
committed?
Another file, "testdir/Xfilter" (v9.1.0763), that will be
created to establish communication from Make to Vim about
what subset of syntax tests is requested for running, should
also be not ignored but rather deleted once its contents are
read. Unless it is explicitly deleted _after test failure_,
the file may contain new *and* old test names when another
testing attempt is under way. And by virtue of it being
ignored, the reason for also running not requested tests
will be as ever puzzling.
Both Git and Mercurial support per-user configuration; such
wide-reaching settings hardly belong to clonable defaults.
Also, match literal dots in testname filters.
Also, discover and report _some_ disused screendump files
tracked under "dumps/".
References:
- https://git-scm.com/docs/gitignore
- https://www.mercurial-scm.org/help/topics/config#ui
closes: #16917
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-23 10:42:23 +01:00
|
|
|
let nr = 0
|
2023-06-23 22:59:26 +01:00
|
|
|
|
2024-07-05 21:30:02 +03:00
|
|
|
" Accommodate the next code block to "buf"'s contingency for self
|
|
|
|
" wipe-out.
|
|
|
|
try
|
2025-03-01 16:28:20 +01:00
|
|
|
let keys_a = ":call ScrollToSecondPage((18 * 75 + 1), 19, 5) | redraw!\<CR>"
|
|
|
|
let keys_b = ":call ScrollToNextPage((18 * 75 + 1), 19, 5) | redraw!\<CR>"
|
|
|
|
while s:CannotSeeLastLine(ruler)
|
|
|
|
call term_sendkeys(buf, keys_a)
|
|
|
|
let keys_a = keys_b
|
2024-05-21 01:10:26 +03:00
|
|
|
let nr += 1
|
|
|
|
let root_next = printf('%s_%02d', root, nr)
|
|
|
|
let in_name_and_out_name = fname .. ': failed/' .. root_next .. '.dump'
|
2025-03-01 16:28:20 +01:00
|
|
|
let ruler = s:TermPollRuler(
|
|
|
|
\ function('s:CannotDumpNextPage', [buf, ruler]),
|
|
|
|
\ buf,
|
|
|
|
\ in_name_and_out_name)
|
|
|
|
call ch_log('Next screendump for ' .. in_name_and_out_name)
|
|
|
|
" Make a screendump of every 18 lines of the file: failed/root_NN.dump
|
2025-03-16 20:59:28 +01:00
|
|
|
let fail += VerifyScreenDump(buf, root_next, DUMP_OPTS)
|
2025-03-01 16:28:20 +01:00
|
|
|
endwhile
|
2024-07-05 21:30:02 +03:00
|
|
|
call StopVimInTerminal(buf)
|
|
|
|
finally
|
|
|
|
call delete('Xtestscript')
|
|
|
|
endtry
|
2024-02-28 21:24:25 +01:00
|
|
|
|
runtime(syntax-tests): Do not ignore failed screendumps
The process of preparing and submitting syntax tests is
fraught with challenges that can turn away many aspiring
contributors from ever attempting it. (Out of 69 languages
introduced since v9.0.1627, there are only syntax tests for
Tera.)
After v9.1.1176~1, one visual clue for admitting syntax test
failures previously available with e.g. "git status" is gone
after all files under "failed/" have been made ignored for
Git and Mercurial. There isn't a single way to go about it:
some people may move files from "failed/" to "dumps/" after
each iteration; some people may only move "good" iteration
files; when a test file is refactored to a great extent,
some people may prefer deleting all test-related files under
"dumps/" before moving files from "failed/". The usability
of reporting, at any time, that there are some _untracked_
files under "failed/" cannot be overstated. Without it, the
chances are greater for pushing mismatched changesets. And
when tests fail then everyone but the author will be kept in
the dark about the cause: were some updated screendumps not
committed _or_ was a wrong version of the syntax plugin
committed?
Another file, "testdir/Xfilter" (v9.1.0763), that will be
created to establish communication from Make to Vim about
what subset of syntax tests is requested for running, should
also be not ignored but rather deleted once its contents are
read. Unless it is explicitly deleted _after test failure_,
the file may contain new *and* old test names when another
testing attempt is under way. And by virtue of it being
ignored, the reason for also running not requested tests
will be as ever puzzling.
Both Git and Mercurial support per-user configuration; such
wide-reaching settings hardly belong to clonable defaults.
Also, match literal dots in testname filters.
Also, discover and report _some_ disused screendump files
tracked under "dumps/".
References:
- https://git-scm.com/docs/gitignore
- https://www.mercurial-scm.org/help/topics/config#ui
closes: #16917
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-23 10:42:23 +01:00
|
|
|
let nr += 1
|
|
|
|
let pagename = printf('dumps/%s_%02d.dump', root, nr)
|
|
|
|
|
|
|
|
while filereadable(pagename)
|
|
|
|
call add(disused_pages, pagename)
|
|
|
|
let nr += 1
|
|
|
|
let pagename = printf('dumps/%s_%02d.dump', root, nr)
|
|
|
|
endwhile
|
|
|
|
|
2024-02-28 21:24:25 +01:00
|
|
|
" redraw here to avoid the following messages to get mixed up with screen
|
|
|
|
" output.
|
|
|
|
redraw
|
|
|
|
|
|
|
|
" Add any assert errors to s:messages.
|
|
|
|
if len(v:errors) > 0
|
|
|
|
call extend(s:messages, v:errors)
|
2025-03-08 16:58:17 +01:00
|
|
|
if last_test_status == 'passed'
|
|
|
|
call EraseLineAndReturnCarriage('Test ' .. root .. ' OK')
|
|
|
|
else
|
|
|
|
echon "\n"
|
|
|
|
endif
|
2024-02-28 21:24:25 +01:00
|
|
|
" Echo the errors here, in case the script aborts or the "messages" file
|
|
|
|
" is not displayed later.
|
|
|
|
echomsg v:errors
|
|
|
|
let v:errors = []
|
|
|
|
let fail += 1
|
|
|
|
endif
|
2023-06-11 19:04:18 +01:00
|
|
|
|
2024-02-28 21:24:25 +01:00
|
|
|
if fail == 0
|
2025-03-08 16:58:17 +01:00
|
|
|
if last_test_status == 'skipped'
|
|
|
|
echon "\n"
|
|
|
|
endif
|
|
|
|
let last_test_status = 'passed'
|
|
|
|
let msg = "Test " .. root .. " OK"
|
|
|
|
call Message(msg)
|
|
|
|
call EraseLineAndReturnCarriage(msg)
|
2023-06-24 00:56:50 +01:00
|
|
|
|
2024-02-28 21:24:25 +01:00
|
|
|
call writefile(['OK'], 'done/' .. root)
|
2023-06-11 19:04:18 +01:00
|
|
|
|
2024-02-28 21:24:25 +01:00
|
|
|
let ok_count += 1
|
|
|
|
else
|
2025-03-08 16:58:17 +01:00
|
|
|
let last_test_status = 'failed'
|
2024-02-28 21:24:25 +01:00
|
|
|
call Message("Test " .. root .. " FAILED")
|
2025-03-08 16:58:17 +01:00
|
|
|
echon "\n"
|
2023-06-24 00:56:50 +01:00
|
|
|
|
2024-02-28 21:24:25 +01:00
|
|
|
call delete('done/' .. root)
|
2023-06-22 21:57:51 +01:00
|
|
|
|
2024-02-28 21:24:25 +01:00
|
|
|
eval failed_tests->add(root)
|
|
|
|
if len(failed_tests) > MAX_FAILED_COUNT
|
|
|
|
call Message('')
|
|
|
|
call Message('Too many errors, aborting')
|
|
|
|
endif
|
|
|
|
endif
|
2023-06-11 19:04:18 +01:00
|
|
|
else
|
2025-03-08 16:58:17 +01:00
|
|
|
if last_test_status == 'passed'
|
|
|
|
call EraseLineAndReturnCarriage('Test ' .. root .. ' OK')
|
|
|
|
endif
|
|
|
|
let last_test_status = 'skipped'
|
2024-02-28 21:24:25 +01:00
|
|
|
call Message("Test " .. root .. " skipped")
|
|
|
|
let skipped_count += 1
|
|
|
|
endif
|
2023-06-22 21:57:51 +01:00
|
|
|
|
2024-02-28 21:24:25 +01:00
|
|
|
" Append messages to the file "testdir/messages"
|
|
|
|
call AppendMessages('Input file ' .. fname .. ':')
|
2023-06-22 21:57:51 +01:00
|
|
|
|
2024-02-28 21:24:25 +01:00
|
|
|
if len(failed_tests) > MAX_FAILED_COUNT
|
|
|
|
break
|
2023-06-11 19:04:18 +01:00
|
|
|
endif
|
2024-02-28 21:24:25 +01:00
|
|
|
endfor
|
2023-06-22 21:57:51 +01:00
|
|
|
|
2025-03-08 16:58:17 +01:00
|
|
|
if last_test_status == 'passed' && exists('root')
|
|
|
|
call EraseLineAndReturnCarriage('Test ' .. root .. ' OK')
|
|
|
|
endif
|
|
|
|
|
2024-02-28 21:24:25 +01:00
|
|
|
call Message(s:test_run_message)
|
|
|
|
call Message('OK: ' .. ok_count)
|
|
|
|
call Message('FAILED: ' .. len(failed_tests) .. ': ' .. string(failed_tests))
|
|
|
|
call Message('skipped: ' .. skipped_count)
|
2024-08-12 18:37:15 +02:00
|
|
|
|
runtime(syntax-tests): Do not ignore failed screendumps
The process of preparing and submitting syntax tests is
fraught with challenges that can turn away many aspiring
contributors from ever attempting it. (Out of 69 languages
introduced since v9.0.1627, there are only syntax tests for
Tera.)
After v9.1.1176~1, one visual clue for admitting syntax test
failures previously available with e.g. "git status" is gone
after all files under "failed/" have been made ignored for
Git and Mercurial. There isn't a single way to go about it:
some people may move files from "failed/" to "dumps/" after
each iteration; some people may only move "good" iteration
files; when a test file is refactored to a great extent,
some people may prefer deleting all test-related files under
"dumps/" before moving files from "failed/". The usability
of reporting, at any time, that there are some _untracked_
files under "failed/" cannot be overstated. Without it, the
chances are greater for pushing mismatched changesets. And
when tests fail then everyone but the author will be kept in
the dark about the cause: were some updated screendumps not
committed _or_ was a wrong version of the syntax plugin
committed?
Another file, "testdir/Xfilter" (v9.1.0763), that will be
created to establish communication from Make to Vim about
what subset of syntax tests is requested for running, should
also be not ignored but rather deleted once its contents are
read. Unless it is explicitly deleted _after test failure_,
the file may contain new *and* old test names when another
testing attempt is under way. And by virtue of it being
ignored, the reason for also running not requested tests
will be as ever puzzling.
Both Git and Mercurial support per-user configuration; such
wide-reaching settings hardly belong to clonable defaults.
Also, match literal dots in testname filters.
Also, discover and report _some_ disused screendump files
tracked under "dumps/".
References:
- https://git-scm.com/docs/gitignore
- https://www.mercurial-scm.org/help/topics/config#ui
closes: #16917
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-23 10:42:23 +01:00
|
|
|
for pagename in disused_pages
|
|
|
|
call Message(printf('No input page found for "%s"', pagename))
|
|
|
|
endfor
|
|
|
|
|
2024-08-12 18:37:15 +02:00
|
|
|
if !empty(failed_tests)
|
|
|
|
call Message('')
|
|
|
|
call Message('View generated screendumps with "../../src/vim --clean -S testdir/viewdumps.vim"')
|
|
|
|
endif
|
|
|
|
|
2024-10-29 20:21:42 +01:00
|
|
|
call AppendMessages('== SUMMARY SYNTAX TESTS ==')
|
2023-06-22 21:57:51 +01:00
|
|
|
|
2024-02-28 21:24:25 +01:00
|
|
|
if len(failed_tests) > 0
|
|
|
|
" have make report an error
|
|
|
|
cquit
|
2023-06-11 19:04:18 +01:00
|
|
|
endif
|
2024-02-28 21:24:25 +01:00
|
|
|
endfunc
|
2023-06-22 21:57:51 +01:00
|
|
|
|
2024-02-28 21:24:25 +01:00
|
|
|
call RunTest()
|
2024-02-10 13:02:17 +01:00
|
|
|
|
|
|
|
" Matching "if 1" at the start.
|
|
|
|
endif
|
|
|
|
|
2023-06-11 19:04:18 +01:00
|
|
|
qall!
|
2024-02-28 21:24:25 +01:00
|
|
|
|
2025-03-01 16:28:20 +01:00
|
|
|
" vim:sw=2:ts=8:noet:
|