Skip to content

Commit b498c44

Browse files
Millychrisbra
authored andcommitted
patch 9.1.0791: tests: errors in gen_opt_test.vim are not shown
Problem: tests: errors in gen_opt_test.vim are not shown Solution: update gen_opt_test.vim and write test.log, let the makefile output test.log (Milly) closes: #15887 Signed-off-by: Milly <milly.ca@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent 5e48e97 commit b498c44

5 files changed

Lines changed: 32 additions & 10 deletions

File tree

src/testdir/Make_ming.mak

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,12 @@ test_gui_init.res: test_gui_init.vim
157157
$(VIMPROG) -u gui_preinit.vim -U gui_init.vim $(NO_PLUGINS) -S runtest.vim $<
158158
@$(DEL) vimcmd
159159

160-
opt_test.vim: ../optiondefs.h gen_opt_test.vim
161-
$(VIMPROG) -e -s -u NONE $(COMMON_ARGS) --nofork -S gen_opt_test.vim ../optiondefs.h
160+
opt_test.vim: gen_opt_test.vim ../optiondefs.h
161+
$(VIMPROG) -e -s -u NONE $(COMMON_ARGS) --nofork -S $^
162+
@if test -f test.log; then \
163+
cat test.log; \
164+
exit 1; \
165+
fi
162166

163167
test_bench_regexp.res: test_bench_regexp.vim
164168
-$(DEL) benchmark.out

src/testdir/Make_mvc.mak

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,9 @@ test_gui_init.res: test_gui_init.vim
151151
$(VIMPROG) -u gui_preinit.vim -U gui_init.vim $(NO_PLUGINS) -S runtest.vim $*.vim
152152
@del vimcmd
153153

154-
opt_test.vim: ../optiondefs.h gen_opt_test.vim
155-
$(VIMPROG) -e -s -u NONE $(COMMON_ARGS) --nofork -S gen_opt_test.vim ../optiondefs.h
154+
opt_test.vim: gen_opt_test.vim ../optiondefs.h
155+
$(VIMPROG) -e -s -u NONE $(COMMON_ARGS) --nofork -S $**
156+
@if exist test.log ( type test.log & exit /b 1 )
156157

157158
test_bench_regexp.res: test_bench_regexp.vim
158159
-if exist benchmark.out del benchmark.out

src/testdir/Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,14 @@ test_gui_init.res: test_gui_init.vim
160160
$(RUN_VIMTEST) -u gui_preinit.vim -U gui_init.vim $(NO_PLUGINS) -S runtest.vim $<
161161
@rm vimcmd
162162

163-
opt_test.vim: ../optiondefs.h gen_opt_test.vim
164-
$(VIMPROG) -e -s -u NONE $(NO_INITS) --nofork --gui-dialog-file guidialog -S gen_opt_test.vim ../optiondefs.h
163+
GEN_OPT_DEPS = gen_opt_test.vim ../optiondefs.h
164+
165+
opt_test.vim: $(GEN_OPT_DEPS)
166+
$(VIMPROG) -e -s -u NONE $(NO_INITS) --nofork --gui-dialog-file guidialog -S $(GEN_OPT_DEPS)
167+
@if test -f test.log; then \
168+
cat test.log; \
169+
exit 1; \
170+
fi
165171

166172
test_xxd.res:
167173
XXD=$(XXDPROG); export XXD; $(RUN_VIMTEST) $(NO_INITS) -S runtest.vim test_xxd.vim

src/testdir/gen_opt_test.vim

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,12 @@ let test_values = {
192192
\ 'otherstring': [['', 'xxx'], []],
193193
\}
194194

195+
const invalid_options = test_values->keys()
196+
\->filter({-> v:val !~# '^other' && !exists($"&{v:val}")})
197+
if !empty(invalid_options)
198+
throw $"Invalid option name in test_values: '{invalid_options->join("', '")}'"
199+
endif
200+
195201
1
196202
/struct vimoption options
197203
while 1
@@ -253,11 +259,14 @@ call add(script, 'let &lines = save_lines')
253259

254260
call writefile(script, 'opt_test.vim')
255261

256-
" Exit with error-code if error occurs.
262+
" Write error messages if error occurs.
257263
catch
258-
set verbose=1
259-
echoc 'Error:' v:exception 'in' v:throwpoint
260-
cq! 1
264+
" Append errors to test.log
265+
let error = $'Error: {v:exception} in {v:throwpoint}'
266+
echoc error
267+
split test.log
268+
call append('$', error)
269+
write
261270
endtry
262271

263272
endif

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ static char *(features[]) =
704704

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
791,
707709
/**/
708710
790,
709711
/**/

0 commit comments

Comments
 (0)