diff --git a/.gitignore b/.gitignore index 420b3d90e9..aee4e9944c 100644 --- a/.gitignore +++ b/.gitignore @@ -96,9 +96,7 @@ src/json_test src/message_test src/kword_test -runtime/syntax/testdir/Xfilter runtime/syntax/testdir/done/ -runtime/syntax/testdir/failed/ runtime/syntax/testdir/messages runtime/syntax/testdir/testdeps.mk runtime/syntax/testdir/vimcmd diff --git a/.hgignore b/.hgignore index d7677be5d8..38388a5309 100644 --- a/.hgignore +++ b/.hgignore @@ -98,9 +98,7 @@ src/json_test src/message_test src/kword_test -runtime/syntax/testdir/Xfilter runtime/syntax/testdir/done/ -runtime/syntax/testdir/failed/ runtime/syntax/testdir/messages runtime/syntax/testdir/testdeps.mk runtime/syntax/testdir/vimcmd diff --git a/runtime/syntax/Makefile b/runtime/syntax/Makefile index b081cde78a..9392b8dc98 100644 --- a/runtime/syntax/Makefile +++ b/runtime/syntax/Makefile @@ -43,7 +43,6 @@ test: @#mkdir -p testdir/failed @#touch "$(VIM_SYNTAX_TEST_LOG)" VIMRUNTIME=$(VIMRUNTIME) $(ENVVARS) $(VIMPROG) --clean --not-a-term $(DEBUGLOG) -u testdir/runtest.vim > /dev/null - @rm -f testdir/Xfilter @# FIXME: Temporarily show the whole file to find out what goes wrong @#if [ -f testdir/messages ]; then tail -n 6 testdir/messages; fi @if [ -f testdir/messages ]; then cat testdir/messages; fi diff --git a/runtime/syntax/testdir/runtest.vim b/runtime/syntax/testdir/runtest.vim index 4152702c20..767510cb1d 100644 --- a/runtime/syntax/testdir/runtest.vim +++ b/runtime/syntax/testdir/runtest.vim @@ -389,18 +389,21 @@ func RunTest() \ : {} lockvar DUMP_OPTS MAX_FAILED_COUNT XTESTSCRIPT let ok_count = 0 + let disused_pages = [] let failed_tests = [] let skipped_count = 0 let last_test_status = 'invalid' + let filter = '' " 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})}, {}) " Turn a subset of filenames etc. requested for testing into a pattern. - let filter = filereadable('../testdir/Xfilter') - \ ? readfile('../testdir/Xfilter') - \ ->map({_, v -> '^' .. substitute(v, '_$', '', '')}) + if filereadable('../testdir/Xfilter') + let filter = readfile('../testdir/Xfilter') + \ ->map({_, v -> '^' .. escape(substitute(v, '_$', '', ''), '.')}) \ ->join('\|') - \ : '' + call delete('../testdir/Xfilter') + endif " Treat "^self-testing" as a string NOT as a regexp. if filter ==# '^self-testing' @@ -430,8 +433,8 @@ func RunTest() let filetype = substitute(root, '\([^_.]*\)[_.].*', '\1', '') let failed_root = 'failed/' .. root - for dumpname in glob(failed_root .. '_\d*\.dump', 1, 1) - call delete(dumpname) + for pagename in glob(failed_root .. '_\d*\.dump', 1, 1) + call delete(pagename) endfor call delete('done/' .. root) call writefile(XTESTSCRIPT, 'Xtestscript') @@ -477,11 +480,11 @@ func RunTest() call ch_log('First screendump for ' .. in_name_and_out_name) " Make a screendump at the start of the file: failed/root_00.dump let fail = VerifyScreenDump(buf, root_00, DUMP_OPTS) + let nr = 0 " Accommodate the next code block to "buf"'s contingency for self " wipe-out. try - let nr = 0 let keys_a = ":call ScrollToSecondPage((18 * 75 + 1), 19, 5) | redraw!\" let keys_b = ":call ScrollToNextPage((18 * 75 + 1), 19, 5) | redraw!\" while s:CannotSeeLastLine(ruler) @@ -503,6 +506,15 @@ func RunTest() call delete('Xtestscript') endtry + 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 + " redraw here to avoid the following messages to get mixed up with screen " output. redraw @@ -573,6 +585,10 @@ func RunTest() call Message('FAILED: ' .. len(failed_tests) .. ': ' .. string(failed_tests)) call Message('skipped: ' .. skipped_count) + for pagename in disused_pages + call Message(printf('No input page found for "%s"', pagename)) + endfor + if !empty(failed_tests) call Message('') call Message('View generated screendumps with "../../src/vim --clean -S testdir/viewdumps.vim"')