0
0
mirror of https://github.com/vim/vim.git synced 2025-07-04 23:07:33 -04:00

runtime(indent-test): MS-Windows: Add Makefile for running indent tests

A few more unrelated changes:
- fix Vim script style of indent test
- Change comments to complete sentences in Filelist

closes: #14198
This commit is contained in:
RestorerZ 2024-03-16 15:08:53 +01:00 committed by Christian Brabandt
parent d0c1b7723f
commit 8291e91c6b
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
4 changed files with 81 additions and 56 deletions

View File

@ -1,7 +1,7 @@
# List of distributed Vim files. # List of distributed Vim files.
# Used by Makefile. # Used by Makefile.
# source files for all source archives # Source files for all source archives.
SRC_ALL = \ SRC_ALL = \
.cirrus.yml \ .cirrus.yml \
.gitattributes \ .gitattributes \
@ -430,7 +430,7 @@ SRC_ALL = \
src/xdiff/xutils.h \ src/xdiff/xutils.h \
# source files for Unix only # Source files for Unix-like only.
SRC_UNIX = \ SRC_UNIX = \
Makefile \ Makefile \
Filelist \ Filelist \
@ -496,7 +496,7 @@ SRC_UNIX = \
src/which.sh \ src/which.sh \
src/xxd/Makefile \ src/xxd/Makefile \
# source files for both DOS and Unix # Source files for both MS Windows and Unix-like.
SRC_DOS_UNIX = \ SRC_DOS_UNIX = \
src/gui_xim.c \ src/gui_xim.c \
src/if_cscope.c \ src/if_cscope.c \
@ -522,7 +522,7 @@ SRC_DOS_UNIX = \
src/proto/if_tcl.pro \ src/proto/if_tcl.pro \
src/typemap \ src/typemap \
# source files for MS-Windows (also in the extra archive) # Source files for MS Windows (also in the extra archive).
SRC_DOS = \ SRC_DOS = \
src/GvimExt/*.mak \ src/GvimExt/*.mak \
src/GvimExt/GvimExt.reg \ src/GvimExt/GvimExt.reg \
@ -598,7 +598,7 @@ SRC_DOS = \
nsis/lang/*.nsi \ nsis/lang/*.nsi \
uninstall.txt \ uninstall.txt \
# source files for DOS without CR/LF translation (also in the extra archive) # Source files for MS Windows without CR/LF translation (also in the extra archive).
SRC_DOS_BIN = \ SRC_DOS_BIN = \
src/tearoff.bmp \ src/tearoff.bmp \
src/tools.bmp \ src/tools.bmp \
@ -615,10 +615,10 @@ SRC_DOS_BIN = \
runtime/bitmaps/vim.ico \ runtime/bitmaps/vim.ico \
nsis/icons.zip \ nsis/icons.zip \
# source files for Amiga, DOS, etc. (also in the extra archive) # Source files for Amiga, DOS, etc. (also in the extra archive).
SRC_AMI_DOS = \ SRC_AMI_DOS = \
# source files for Amiga (also in the extra archive) # Source files for Amiga (also in the extra archive).
SRC_AMI = \ SRC_AMI = \
README_amisrc.txt \ README_amisrc.txt \
README_amisrc.txt.info \ README_amisrc.txt.info \
@ -632,7 +632,7 @@ SRC_AMI = \
src/testdir/amiga.vim \ src/testdir/amiga.vim \
src/xxd/Make_amiga.mak \ src/xxd/Make_amiga.mak \
# source files for Haiku (also in the extra archive) # Source files for Haiku (also in the extra archive).
SRC_HAIKU = \ SRC_HAIKU = \
README_haiku.txt \ README_haiku.txt \
src/os_haiku.h \ src/os_haiku.h \
@ -641,7 +641,7 @@ SRC_HAIKU = \
src/gui_haiku.h \ src/gui_haiku.h \
src/proto/gui_haiku.pro \ src/proto/gui_haiku.pro \
# source files for the Mac (also in the extra archive) # Source files for the Mac (also in the extra archive).
SRC_MAC = \ SRC_MAC = \
src/INSTALLmac.txt \ src/INSTALLmac.txt \
src/os_mac.h \ src/os_mac.h \
@ -650,7 +650,7 @@ SRC_MAC = \
src/proto/os_mac_conv.pro \ src/proto/os_mac_conv.pro \
src/proto/os_macosx.pro \ src/proto/os_macosx.pro \
# source files for VMS (in the extra archive) # Source files for VMS (in the extra archive).
SRC_VMS = \ SRC_VMS = \
src/INSTALLvms.txt \ src/INSTALLvms.txt \
src/Make_vms.mms \ src/Make_vms.mms \
@ -664,7 +664,7 @@ SRC_VMS = \
src/xxd/Make_vms.mms \ src/xxd/Make_vms.mms \
vimtutor.com \ vimtutor.com \
# source files for QNX (in the extra archive) # Source files for QNX (in the extra archive).
SRC_QNX = \ SRC_QNX = \
src/os_qnx.c \ src/os_qnx.c \
src/os_qnx.h \ src/os_qnx.h \
@ -672,7 +672,7 @@ SRC_QNX = \
src/proto/gui_photon.pro \ src/proto/gui_photon.pro \
src/proto/os_qnx.pro \ src/proto/os_qnx.pro \
# source files for the extra archive (all sources that are not for Unix) # Source files for the extra archive (all sources that are not for Unix).
SRC_EXTRA = \ SRC_EXTRA = \
$(SRC_AMI) \ $(SRC_AMI) \
$(SRC_AMI_DOS) \ $(SRC_AMI_DOS) \
@ -687,7 +687,7 @@ SRC_EXTRA = \
src/os_vms_fix.com \ src/os_vms_fix.com \
src/toolbar.phi \ src/toolbar.phi \
# runtime files for all distributions # Runtime files for all distributions.
RT_ALL = \ RT_ALL = \
README.txt \ README.txt \
README.md \ README.md \
@ -778,12 +778,12 @@ RT_ALL = \
runtime/pack/dist/opt/swapmouse/plugin/swapmouse.vim \ runtime/pack/dist/opt/swapmouse/plugin/swapmouse.vim \
runtime/pack/dist/opt/termdebug/plugin/termdebug.vim \ runtime/pack/dist/opt/termdebug/plugin/termdebug.vim \
# runtime files for all distributions without CR-NL translation # Runtime files for all distributions without CR/LF translation.
RT_ALL_BIN = \ RT_ALL_BIN = \
runtime/doc/tags \ runtime/doc/tags \
runtime/print/*.ps \ runtime/print/*.ps \
# runtime script files # Runtime script files.
RT_SCRIPTS = \ RT_SCRIPTS = \
runtime/filetype.vim \ runtime/filetype.vim \
runtime/scripts.vim \ runtime/scripts.vim \
@ -834,7 +834,7 @@ RT_SCRIPTS = \
runtime/syntax/generator/update_date.vim \ runtime/syntax/generator/update_date.vim \
runtime/syntax/generator/vim.vim.base \ runtime/syntax/generator/vim.vim.base \
# Unix runtime # Unix-like runtime.
RT_UNIX = \ RT_UNIX = \
README_unix.txt \ README_unix.txt \
runtime/hi16-action-make.png \ runtime/hi16-action-make.png \
@ -842,7 +842,7 @@ RT_UNIX = \
runtime/gvim.desktop \ runtime/gvim.desktop \
runtime/vim.desktop \ runtime/vim.desktop \
# Unix and DOS runtime without CR-LF translation # Unix-like and MS Windows runtime without CR/LF translation.
RT_UNIX_DOS_BIN = \ RT_UNIX_DOS_BIN = \
runtime/vim16x16.gif \ runtime/vim16x16.gif \
runtime/vim16x16.png \ runtime/vim16x16.png \
@ -854,10 +854,10 @@ RT_UNIX_DOS_BIN = \
runtime/vim48x48.png \ runtime/vim48x48.png \
runtime/vim48x48.xpm \ runtime/vim48x48.xpm \
# runtime not for unix or extra # Runtime not for Unix-like or extra.
RT_NO_UNIX = \ RT_NO_UNIX = \
# runtime for Amiga (also in the extra archive) # Runtime for Amiga (also in the extra archive).
RT_AMI_DOS = \ RT_AMI_DOS = \
runtime/doc/evim.man \ runtime/doc/evim.man \
runtime/doc/vim.man \ runtime/doc/vim.man \
@ -865,15 +865,16 @@ RT_AMI_DOS = \
runtime/doc/vimtutor.man \ runtime/doc/vimtutor.man \
runtime/doc/xxd.man \ runtime/doc/xxd.man \
# DOS runtime (also in the extra archive) # MS Windows runtime (also in the extra archive).
RT_DOS = \ RT_DOS = \
README_dos.txt \ README_dos.txt \
runtime/doc/Make_mvc.mak \ runtime/doc/Make_mvc.mak \
runtime/indent/Make_mvc.mak \
runtime/tutor/Make_mvc.mak \ runtime/tutor/Make_mvc.mak \
runtime/lang/Make_mvc.mak \ runtime/lang/Make_mvc.mak \
vimtutor.bat \ vimtutor.bat \
# DOS runtime without CR-LF translation (also in the extra archive) # MS Windows runtime without CR/LF translation (also in the extra archive).
RT_DOS_BIN = \ RT_DOS_BIN = \
runtime/vimlogo.cdr \ runtime/vimlogo.cdr \
runtime/vimlogo.eps \ runtime/vimlogo.eps \
@ -901,7 +902,7 @@ RT_AMI = \
runtime/tutor.info \ runtime/tutor.info \
runtime/tutor/*.info \ runtime/tutor/*.info \
# runtime files in extra archive # Runtime files in extra archive.
RT_EXTRA = \ RT_EXTRA = \
$(RT_AMI) \ $(RT_AMI) \
$(RT_AMI_DOS) \ $(RT_AMI_DOS) \
@ -909,46 +910,46 @@ RT_EXTRA = \
$(RT_DOS_BIN) \ $(RT_DOS_BIN) \
README_mac.txt \ README_mac.txt \
# included in all Amiga archives # Included in all Amiga archives.
ROOT_AMI = \ ROOT_AMI = \
Contents \ Contents \
Contents.info \ Contents.info \
runtime.info \ runtime.info \
vimdir.info \ vimdir.info \
# root files for the extra archive # Root files for the extra archive.
ROOT_EXTRA = \ ROOT_EXTRA = \
$(ROOT_AMI) \ $(ROOT_AMI) \
# files for Amiga small binary (also in extra archive) # Files for Amiga small binary (also in extra archive).
BIN_AMI = \ BIN_AMI = \
README_amibin.txt \ README_amibin.txt \
README_amibin.txt.info \ README_amibin.txt.info \
Vim.info \ Vim.info \
Xxd.info \ Xxd.info \
# files for DOS binary (also in extra archive) # Files for MS Windows binary (also in extra archive).
BIN_DOS = \ BIN_DOS = \
README_bindos.txt \ README_bindos.txt \
uninstall.txt \ uninstall.txt \
# files for Win32 OLE binary (also in extra archive) # Files for Win32 OLE binary (also in extra archive).
BIN_OLE = \ BIN_OLE = \
README_ole.txt \ README_ole.txt \
# files for Win32s binary (also in extra archive) # Files for Win32s binary (also in extra archive).
BIN_W32S = \ BIN_W32S = \
README_w32s.txt \ README_w32s.txt \
# files for VMS binary (also in extra archive) # Files for VMS binary (also in extra archive).
BIN_VMS = \ BIN_VMS = \
README_vms.txt \ README_vms.txt \
# files for OS/2 binary (also in extra archive) # Files for OS/2 binary (also in extra archive).
BIN_OS2 = \ BIN_OS2 = \
README_os2.txt \ README_os2.txt \
# binary files for extra archive # Binary files for extra archive.
BIN_EXTRA = \ BIN_EXTRA = \
$(BIN_AMI) \ $(BIN_AMI) \
$(BIN_DOS) \ $(BIN_DOS) \
@ -957,7 +958,7 @@ BIN_EXTRA = \
$(BIN_VMS) \ $(BIN_VMS) \
$(BIN_OS2) \ $(BIN_OS2) \
# all files for extra archive # All files for extra archive.
EXTRA = \ EXTRA = \
$(BIN_EXTRA) \ $(BIN_EXTRA) \
$(ROOT_EXTRA) \ $(ROOT_EXTRA) \
@ -966,7 +967,7 @@ EXTRA = \
README_extra.txt \ README_extra.txt \
runtime/vimlogo.xpm \ runtime/vimlogo.xpm \
# files in READMEdir that are included from the top dir # Files in READMEdir that are included from the top dir.
IN_README_DIR = \ IN_README_DIR = \
README.txt.info \ README.txt.info \
README_ami.txt \ README_ami.txt \
@ -997,7 +998,7 @@ IN_README_DIR = \
src.info \ src.info \
vimdir.info \ vimdir.info \
# generic language files # Generic language files.
LANG_GEN = \ LANG_GEN = \
runtime/doc/*-da.1 \ runtime/doc/*-da.1 \
runtime/doc/*-da.UTF-8.1 \ runtime/doc/*-da.UTF-8.1 \
@ -1050,7 +1051,7 @@ LANG_GEN = \
runtime/spell/main.aap \ runtime/spell/main.aap \
runtime/spell/*.vim \ runtime/spell/*.vim \
# generic language files, binary # Generic language files, binary.
LANG_GEN_BIN = \ LANG_GEN_BIN = \
runtime/spell/README_en.txt \ runtime/spell/README_en.txt \
runtime/spell/en.ascii.spl \ runtime/spell/en.ascii.spl \
@ -1060,7 +1061,7 @@ LANG_GEN_BIN = \
runtime/spell/en.latin1.sug \ runtime/spell/en.latin1.sug \
runtime/spell/en.utf-8.sug \ runtime/spell/en.utf-8.sug \
# all files for lang archive # All files for lang archive.
LANG_SRC = \ LANG_SRC = \
src/po/README.txt \ src/po/README.txt \
src/po/README_mingw.txt \ src/po/README_mingw.txt \
@ -1080,7 +1081,7 @@ LANG_SRC = \
src/po/big5corr.c \ src/po/big5corr.c \
src/po/*.po \ src/po/*.po \
# the language files for the Win32 lang archive # The language files for the Win32 lang archive.
LANG_DOS = \ LANG_DOS = \
src/po/*.mo \ src/po/*.mo \

View File

@ -0,0 +1,21 @@
# Makefile for running indent tests on OS Windows.
# Made on the base of a indent/Makefile.
# Restorer, 13.03.2024
.SUFFIXES:
VIM = vim.exe
VIMRUNTIME = ..
# Run the tests that didn't run yet or failed previously.
# If a test succeeds a testdir\*.out file will be written.
# If a test fails a testdir\*.fail file will be written.
test :
@ set "VIMRUNTIME=$(VIMRUNTIME)"
$(VIM) --clean --not-a-term -u testdir\runtest.vim
clean testclean :
@ if exist testdir\*.fail del /q testdir\*.fail
@ if exist testdir\*.out del /q testdir\*.out

View File

@ -1,5 +1,8 @@
# Portable Makefile for running indent tests. # Portable Makefile for running indent tests.
.SUFFIXES:
.PHONY: test clean testclean
VIM = vim VIM = vim
VIMRUNTIME = .. VIMRUNTIME = ..

View File

@ -2,7 +2,7 @@
" "
" Current directory must be runtime/indent. " Current directory must be runtime/indent.
" Only do this with the +eval feature " Only do this with the +eval feature.
if 1 if 1
set nocp set nocp
@ -18,7 +18,7 @@ au! SwapExists * call HandleSwapExists()
func HandleSwapExists() func HandleSwapExists()
" Ignore finding a swap file for the test input and output, the user might be " Ignore finding a swap file for the test input and output, the user might be
" editing them and that's OK. " editing them and that's OK.
if expand('<afile>') =~ '.*\.\(in\|out\|fail\|ok\)' if expand('<afile>') =~ '.*\.\%(in\|out\|fail\|ok\)'
let v:swapchoice = 'e' let v:swapchoice = 'e'
endif endif
endfunc endfunc
@ -30,19 +30,19 @@ for fname in glob('testdir/*.in', 1, 1)
" Execute the test if the .out file does not exist of when the .in file is " Execute the test if the .out file does not exist of when the .in file is
" newer. " newer.
let in_time = getftime(fname) let in_time = getftime(fname)
let out_time = getftime(root . '.out') let out_time = getftime(root .. '.out')
if out_time < 0 || in_time > out_time if out_time < 0 || in_time > out_time
call delete(root . '.fail') call delete(root .. '.fail')
call delete(root . '.out') call delete(root .. '.out')
set sw& ts& filetype= set sw& ts& filetype=
exe 'split ' . fname exe 'split ' .. fname
let did_some = 0 let did_some = 0
let failed = 0 let failed = 0
let end = 1 let end = 1
while 1 while 1
" Indent all the lines between "START_INDENT" and "END_INDENT" " Indent all the lines between "START_INDENT" and "END_INDENT".
exe end exe end
let start = search('\<START_INDENT\>') let start = search('\<START_INDENT\>')
let end = search('\<END_INDENT\>') let end = search('\<END_INDENT\>')
@ -63,7 +63,7 @@ for fname in glob('testdir/*.in', 1, 1)
exe lnum + 1 exe lnum + 1
let lnum_exe = search('\<INDENT_EXE\>') let lnum_exe = search('\<INDENT_EXE\>')
exe lnum + 1 exe lnum + 1
let indent_at = search('\<INDENT_\(AT\|NEXT\|PREV\)\>') let indent_at = search('\<INDENT_\%(AT\|NEXT\|PREV\)\>')
if lnum_exe > 0 && lnum_exe < end && (indent_at <= 0 || lnum_exe < indent_at) if lnum_exe > 0 && lnum_exe < end && (indent_at <= 0 || lnum_exe < indent_at)
exe substitute(getline(lnum_exe), '.*INDENT_EXE', '', '') exe substitute(getline(lnum_exe), '.*INDENT_EXE', '', '')
let lnum = lnum_exe let lnum = lnum_exe
@ -87,15 +87,15 @@ for fname in glob('testdir/*.in', 1, 1)
exe start + 1 exe start + 1
if pattern == '' if pattern == ''
try try
exe 'normal =' . (end - 1) . 'G' exe 'normal =' .. (end - 1) .. 'G'
catch catch
call append(indent_at, 'ERROR: ' . v:exception) call append(indent_at, 'ERROR: ' .. v:exception)
let failed = 1 let failed = 1
endtry endtry
else else
let lnum = search(pattern) let lnum = search(pattern)
if lnum <= 0 if lnum <= 0
call append(indent_at, 'ERROR: pattern not found: ' . pattern) call append(indent_at, 'ERROR: pattern not found: ' .. pattern)
let failed = 1 let failed = 1
break break
endif endif
@ -109,7 +109,7 @@ for fname in glob('testdir/*.in', 1, 1)
try try
normal == normal ==
catch catch
call append(indent_at, 'ERROR: ' . v:exception) call append(indent_at, 'ERROR: ' .. v:exception)
let failed = 1 let failed = 1
endtry endtry
endif endif
@ -118,21 +118,21 @@ for fname in glob('testdir/*.in', 1, 1)
if !failed if !failed
" Check the resulting text equals the .ok file. " Check the resulting text equals the .ok file.
if getline(1, '$') != readfile(root . '.ok') if getline(1, '$') != readfile(root .. '.ok')
let failed = 1 let failed = 1
endif endif
endif endif
if failed if failed
let failed_count += 1 let failed_count += 1
exe 'write ' . root . '.fail' exe 'write ' .. root .. '.fail'
echoerr 'Test ' . fname . ' FAILED!' echoerr 'Test ' .. fname .. ' FAILED!'
else else
exe 'write ' . root . '.out' exe 'write ' .. root .. '.out'
echo "Test " . fname . " OK\n" echo "Test " .. fname .. " OK\n"
endif endif
quit! " close the indented file quit! " Close the indented file.
endif endif
endfor endfor
@ -140,7 +140,7 @@ endfor
endif endif
if failed_count > 0 if failed_count > 0
" have make report an error " Have make report an error.
cquit cquit
endif endif
qall! qall!