diff options
author | RestorerZ <restorer@mail2k.ru> | 2024-03-16 15:08:53 +0100 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-03-16 15:13:21 +0100 |
commit | 8291e91c6b10e0cdeb2f29c8f1a0aad6d5b5c684 (patch) | |
tree | 8f669c0321ba974dfcdc76efa092a8d61ce0c14a /runtime | |
parent | d0c1b7723f7e73763597af2f97a53d94ab7ed020 (diff) |
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
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/indent/Make_mvc.mak | 21 | ||||
-rw-r--r-- | runtime/indent/Makefile | 3 | ||||
-rw-r--r-- | runtime/indent/testdir/runtest.vim | 38 |
3 files changed, 43 insertions, 19 deletions
diff --git a/runtime/indent/Make_mvc.mak b/runtime/indent/Make_mvc.mak new file mode 100644 index 0000000000..0f73d7fa79 --- /dev/null +++ b/runtime/indent/Make_mvc.mak @@ -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 + diff --git a/runtime/indent/Makefile b/runtime/indent/Makefile index f6c44736d2..66ded80928 100644 --- a/runtime/indent/Makefile +++ b/runtime/indent/Makefile @@ -1,5 +1,8 @@ # Portable Makefile for running indent tests. +.SUFFIXES: +.PHONY: test clean testclean + VIM = vim VIMRUNTIME = .. diff --git a/runtime/indent/testdir/runtest.vim b/runtime/indent/testdir/runtest.vim index 882a140a8d..dde8c5c47b 100644 --- a/runtime/indent/testdir/runtest.vim +++ b/runtime/indent/testdir/runtest.vim @@ -2,7 +2,7 @@ " " Current directory must be runtime/indent. -" Only do this with the +eval feature +" Only do this with the +eval feature. if 1 set nocp @@ -18,7 +18,7 @@ au! SwapExists * call HandleSwapExists() func HandleSwapExists() " Ignore finding a swap file for the test input and output, the user might be " editing them and that's OK. - if expand('<afile>') =~ '.*\.\(in\|out\|fail\|ok\)' + if expand('<afile>') =~ '.*\.\%(in\|out\|fail\|ok\)' let v:swapchoice = 'e' endif 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 " newer. 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 - call delete(root . '.fail') - call delete(root . '.out') + call delete(root .. '.fail') + call delete(root .. '.out') set sw& ts& filetype= - exe 'split ' . fname + exe 'split ' .. fname let did_some = 0 let failed = 0 let end = 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 let start = search('\<START_INDENT\>') let end = search('\<END_INDENT\>') @@ -63,7 +63,7 @@ for fname in glob('testdir/*.in', 1, 1) exe lnum + 1 let lnum_exe = search('\<INDENT_EXE\>') 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) exe substitute(getline(lnum_exe), '.*INDENT_EXE', '', '') let lnum = lnum_exe @@ -87,15 +87,15 @@ for fname in glob('testdir/*.in', 1, 1) exe start + 1 if pattern == '' try - exe 'normal =' . (end - 1) . 'G' + exe 'normal =' .. (end - 1) .. 'G' catch - call append(indent_at, 'ERROR: ' . v:exception) + call append(indent_at, 'ERROR: ' .. v:exception) let failed = 1 endtry else let lnum = search(pattern) if lnum <= 0 - call append(indent_at, 'ERROR: pattern not found: ' . pattern) + call append(indent_at, 'ERROR: pattern not found: ' .. pattern) let failed = 1 break endif @@ -109,7 +109,7 @@ for fname in glob('testdir/*.in', 1, 1) try normal == catch - call append(indent_at, 'ERROR: ' . v:exception) + call append(indent_at, 'ERROR: ' .. v:exception) let failed = 1 endtry endif @@ -118,21 +118,21 @@ for fname in glob('testdir/*.in', 1, 1) if !failed " Check the resulting text equals the .ok file. - if getline(1, '$') != readfile(root . '.ok') + if getline(1, '$') != readfile(root .. '.ok') let failed = 1 endif endif if failed let failed_count += 1 - exe 'write ' . root . '.fail' - echoerr 'Test ' . fname . ' FAILED!' + exe 'write ' .. root .. '.fail' + echoerr 'Test ' .. fname .. ' FAILED!' else - exe 'write ' . root . '.out' - echo "Test " . fname . " OK\n" + exe 'write ' .. root .. '.out' + echo "Test " .. fname .. " OK\n" endif - quit! " close the indented file + quit! " Close the indented file. endif endfor @@ -140,7 +140,7 @@ endfor endif if failed_count > 0 - " have make report an error + " Have make report an error. cquit endif qall! |