]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0791: tests: errors in gen_opt_test.vim are not shown v9.1.0791
authorMilly <milly.ca@gmail.com>
Thu, 17 Oct 2024 19:05:31 +0000 (21:05 +0200)
committerChristian Brabandt <cb@256bit.org>
Thu, 17 Oct 2024 19:05:31 +0000 (21:05 +0200)
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>
src/testdir/Make_ming.mak
src/testdir/Make_mvc.mak
src/testdir/Makefile
src/testdir/gen_opt_test.vim
src/version.c

index f26950e2e30c9e4f4f795c10f945599ce90f94ba..16632b350e2e035ec3a24fd5d562d2cd89d40839 100644 (file)
@@ -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
index bb38e25c5167de0bc31e8e3df8dc9972316d8be0..bbfd8f09e58a5dc5f5804ac413a54b893f04eb10 100644 (file)
@@ -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
index 2827f994a56f4da0054e22444d572d1b12625d69..66b8f1b74cde31d8d8a46c670ffeffdd283b4d4f 100644 (file)
@@ -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
index 4ca3c09386e717452ed3796b386ff40a01bfa1e8..372070b7aaa82e978e72f6928f9650243e5fa855 100644 (file)
@@ -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
index 89ca65c518086d50f67a4c54ed0e1dfe0926e8ea..c5d66b141e0c2fb4392a5015229b0734ca13698f 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    791,
 /**/
     790,
 /**/