summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilly <milly.ca@gmail.com>2024-10-17 21:05:31 +0200
committerChristian Brabandt <cb@256bit.org>2024-10-17 21:05:31 +0200
commitb498c444440b9da0e7abec430d446a31e01d5eb9 (patch)
tree4e7053ca4cddb39e820a2f75ac0465b4aff19f1f
parent5e48e97e4231e95385e07470a7e5659ff59bd0d7 (diff)
patch 9.1.0791: tests: errors in gen_opt_test.vim are not shownv9.1.0791
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>
-rw-r--r--src/testdir/Make_ming.mak8
-rw-r--r--src/testdir/Make_mvc.mak5
-rw-r--r--src/testdir/Makefile10
-rw-r--r--src/testdir/gen_opt_test.vim17
-rw-r--r--src/version.c2
5 files changed, 32 insertions, 10 deletions
diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak
index f26950e2e3..16632b350e 100644
--- a/src/testdir/Make_ming.mak
+++ b/src/testdir/Make_ming.mak
@@ -157,8 +157,12 @@ test_gui_init.res: test_gui_init.vim
$(VIMPROG) -u gui_preinit.vim -U gui_init.vim $(NO_PLUGINS) -S runtest.vim $<
@$(DEL) vimcmd
-opt_test.vim: ../optiondefs.h gen_opt_test.vim
- $(VIMPROG) -e -s -u NONE $(COMMON_ARGS) --nofork -S gen_opt_test.vim ../optiondefs.h
+opt_test.vim: gen_opt_test.vim ../optiondefs.h
+ $(VIMPROG) -e -s -u NONE $(COMMON_ARGS) --nofork -S $^
+ @if test -f test.log; then \
+ cat test.log; \
+ exit 1; \
+ fi
test_bench_regexp.res: test_bench_regexp.vim
-$(DEL) benchmark.out
diff --git a/src/testdir/Make_mvc.mak b/src/testdir/Make_mvc.mak
index bb38e25c51..bbfd8f09e5 100644
--- a/src/testdir/Make_mvc.mak
+++ b/src/testdir/Make_mvc.mak
@@ -151,8 +151,9 @@ test_gui_init.res: test_gui_init.vim
$(VIMPROG) -u gui_preinit.vim -U gui_init.vim $(NO_PLUGINS) -S runtest.vim $*.vim
@del vimcmd
-opt_test.vim: ../optiondefs.h gen_opt_test.vim
- $(VIMPROG) -e -s -u NONE $(COMMON_ARGS) --nofork -S gen_opt_test.vim ../optiondefs.h
+opt_test.vim: gen_opt_test.vim ../optiondefs.h
+ $(VIMPROG) -e -s -u NONE $(COMMON_ARGS) --nofork -S $**
+ @if exist test.log ( type test.log & exit /b 1 )
test_bench_regexp.res: test_bench_regexp.vim
-if exist benchmark.out del benchmark.out
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
index 2827f994a5..66b8f1b74c 100644
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -160,8 +160,14 @@ test_gui_init.res: test_gui_init.vim
$(RUN_VIMTEST) -u gui_preinit.vim -U gui_init.vim $(NO_PLUGINS) -S runtest.vim $<
@rm vimcmd
-opt_test.vim: ../optiondefs.h gen_opt_test.vim
- $(VIMPROG) -e -s -u NONE $(NO_INITS) --nofork --gui-dialog-file guidialog -S gen_opt_test.vim ../optiondefs.h
+GEN_OPT_DEPS = gen_opt_test.vim ../optiondefs.h
+
+opt_test.vim: $(GEN_OPT_DEPS)
+ $(VIMPROG) -e -s -u NONE $(NO_INITS) --nofork --gui-dialog-file guidialog -S $(GEN_OPT_DEPS)
+ @if test -f test.log; then \
+ cat test.log; \
+ exit 1; \
+ fi
test_xxd.res:
XXD=$(XXDPROG); export XXD; $(RUN_VIMTEST) $(NO_INITS) -S runtest.vim test_xxd.vim
diff --git a/src/testdir/gen_opt_test.vim b/src/testdir/gen_opt_test.vim
index 4ca3c09386..372070b7aa 100644
--- a/src/testdir/gen_opt_test.vim
+++ b/src/testdir/gen_opt_test.vim
@@ -192,6 +192,12 @@ let test_values = {
\ 'otherstring': [['', 'xxx'], []],
\}
+const invalid_options = test_values->keys()
+ \->filter({-> v:val !~# '^other' && !exists($"&{v:val}")})
+if !empty(invalid_options)
+ throw $"Invalid option name in test_values: '{invalid_options->join("', '")}'"
+endif
+
1
/struct vimoption options
while 1
@@ -253,11 +259,14 @@ call add(script, 'let &lines = save_lines')
call writefile(script, 'opt_test.vim')
-" Exit with error-code if error occurs.
+" Write error messages if error occurs.
catch
- set verbose=1
- echoc 'Error:' v:exception 'in' v:throwpoint
- cq! 1
+ " Append errors to test.log
+ let error = $'Error: {v:exception} in {v:throwpoint}'
+ echoc error
+ split test.log
+ call append('$', error)
+ write
endtry
endif
diff --git a/src/version.c b/src/version.c
index 89ca65c518..c5d66b141e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 791,
+/**/
790,
/**/
789,