Mercurial > vim
comparison runtime/indent/testdir/runtest.vim @ 18122:0cc306ebc8fe v8.1.2056
patch 8.1.2056: "make test" for indent files doesn't cause make to fail
Commit: https://github.com/vim/vim/commit/cd67059c0c3abf1e28aa66458abdf6f338252eb2
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Sep 18 22:14:43 2019 +0200
patch 8.1.2056: "make test" for indent files doesn't cause make to fail
Problem: "make test" for indent files doesn't cause make to fail.
Solution: Exit the script with ":cquit". (Daniel Hahler, closes https://github.com/vim/vim/issues/4949)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 18 Sep 2019 22:15:04 +0200 |
parents | bd7461db24b3 |
children | a0e0f0256d0b |
comparison
equal
deleted
inserted
replaced
18121:a505da83c907 | 18122:0cc306ebc8fe |
---|---|
18 if expand('<afile>') =~ '.*\.\(in\|out\|fail\|ok\)' | 18 if expand('<afile>') =~ '.*\.\(in\|out\|fail\|ok\)' |
19 let v:swapchoice = 'e' | 19 let v:swapchoice = 'e' |
20 endif | 20 endif |
21 endfunc | 21 endfunc |
22 | 22 |
23 let failed_count = 0 | |
23 for fname in glob('testdir/*.in', 1, 1) | 24 for fname in glob('testdir/*.in', 1, 1) |
24 let root = substitute(fname, '\.in', '', '') | 25 let root = substitute(fname, '\.in', '', '') |
25 | 26 |
26 " Execute the test if the .out file does not exist of when the .in file is | 27 " Execute the test if the .out file does not exist of when the .in file is |
27 " newer. | 28 " newer. |
108 let failed = 1 | 109 let failed = 1 |
109 endif | 110 endif |
110 endif | 111 endif |
111 | 112 |
112 if failed | 113 if failed |
114 let failed_count += 1 | |
113 exe 'write ' . root . '.fail' | 115 exe 'write ' . root . '.fail' |
114 echoerr 'Test ' . fname . ' FAILED!' | 116 echoerr 'Test ' . fname . ' FAILED!' |
115 else | 117 else |
116 exe 'write ' . root . '.out' | 118 exe 'write ' . root . '.out' |
117 endif | 119 endif |
121 endfor | 123 endfor |
122 | 124 |
123 " Matching "if 1" at the start. | 125 " Matching "if 1" at the start. |
124 endif | 126 endif |
125 | 127 |
128 if failed_count > 0 | |
129 " have make report an error | |
130 cquit | |
131 endif | |
126 qall! | 132 qall! |