0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.1.0723: cannot easily run specific test when in src/testdir

Problem:    Cannot run specific test when in src/testdir the same was as in
            the src directory.
Solution:   Move build rule to src/testdir/Makefile.
This commit is contained in:
Bram Moolenaar 2019-01-11 17:30:16 +01:00
parent 977239ef52
commit ec50401e1e
10 changed files with 378 additions and 362 deletions

View File

@ -2,216 +2,6 @@
# Common Makefile, defines the list of tests to run and other things. # Common Makefile, defines the list of tests to run and other things.
# #
# Individual tests, including the ones part of test_alot.
# Please keep sorted up to test_alot.
NEW_TESTS = \
test_arglist \
test_arabic \
test_assert \
test_assign \
test_autochdir \
test_autocmd \
test_autoload \
test_backspace_opt \
test_backup \
test_behave \
test_blockedit \
test_breakindent \
test_bufline \
test_bufwintabinfo \
test_cd \
test_cdo \
test_changedtick \
test_changelist \
test_channel \
test_charsearch \
test_charsearch_utf8 \
test_cindent \
test_clientserver \
test_close_count \
test_cmdline \
test_command_count \
test_comparators \
test_compiler \
test_conceal \
test_crypt \
test_cscope \
test_cursor_func \
test_curswant \
test_delete \
test_diffmode \
test_digraph \
test_display \
test_edit \
test_erasebackword \
test_escaped_glob \
test_eval_stuff \
test_ex_undo \
test_ex_z \
test_exit \
test_exec_while_if \
test_execute_func \
test_exists \
test_exists_autocmd \
test_expand \
test_expand_dllpath \
test_expand_func \
test_expr \
test_expr_utf8 \
test_farsi \
test_feedkeys \
test_file_perm \
test_file_size \
test_fileformat \
test_filetype \
test_filter_cmd \
test_filter_map \
test_find_complete \
test_findfile \
test_fixeol \
test_float_func \
test_fnameescape \
test_fnamemodify \
test_fold \
test_functions \
test_ga \
test_getcwd \
test_getvar \
test_gf \
test_glob2regpat \
test_global \
test_gn \
test_goto \
test_gui \
test_gui_init \
test_hardcopy \
test_help \
test_help_tagjump \
test_hide \
test_highlight \
test_history \
test_hlsearch \
test_iminsert \
test_increment \
test_increment_dbcs \
test_ins_complete \
test_job_fails \
test_join \
test_json \
test_jumplist \
test_jumps \
test_lambda \
test_langmap \
test_largefile \
test_let \
test_lineending \
test_lispwords \
test_listchars \
test_listdict \
test_listlbr \
test_listlbr_utf8 \
test_lua \
test_makeencoding \
test_man \
test_maparg \
test_mapping \
test_marks \
test_match \
test_matchadd_conceal \
test_matchadd_conceal_utf8 \
test_menu \
test_messages \
test_mksession \
test_mksession_utf8 \
test_modeline \
test_move \
test_nested_function \
test_netbeans \
test_normal \
test_number \
test_options \
test_packadd \
test_partial \
test_paste \
test_perl \
test_plus_arg_edit \
test_popup \
test_preview \
test_profile \
test_prompt_buffer \
test_put \
test_python2 \
test_python3 \
test_pyx2 \
test_pyx3 \
test_quickfix \
test_quotestar \
test_recover \
test_regex_char_classes \
test_regexp_latin \
test_regexp_utf8 \
test_registers \
test_reltime \
test_retab \
test_ruby \
test_scriptnames \
test_scroll_opt \
test_scrollbind \
test_search \
test_searchpos \
test_set \
test_sha256 \
test_signs \
test_smartindent \
test_sort \
test_source_utf8 \
test_spell \
test_startup \
test_startup_utf8 \
test_stat \
test_statusline \
test_substitute \
test_suspend \
test_swap \
test_syn_attr \
test_syntax \
test_system \
test_tab \
test_tabline \
test_tabpage \
test_tagcase \
test_tagjump \
test_taglist \
test_tcl \
test_terminal \
test_terminal_fail \
test_textformat \
test_textobjects \
test_textprop \
test_timers \
test_true_false \
test_undo \
test_unlet \
test_usercommands \
test_utf8 \
test_utf8_comparisons \
test_vartabs \
test_viminfo \
test_vimscript \
test_virtualedit \
test_visual \
test_winbar \
test_winbuf_close \
test_window_cmd \
test_window_id \
test_windows_home \
test_wordcount \
test_writefile \
test_xxd \
test_alot_latin \
test_alot_utf8 \
test_alot
# Argument for running ctags. # Argument for running ctags.
TAGS_FILES = \ TAGS_FILES = \
*.c \ *.c \

View File

@ -694,6 +694,7 @@ CFLAGS = $(CFLAGS) /Zl /MTd
!endif # DEBUG !endif # DEBUG
!include Make_all.mak !include Make_all.mak
!include testdir\Make_all.mak
INCL = vim.h alloc.h arabic.h ascii.h ex_cmds.h farsi.h feature.h globals.h \ INCL = vim.h alloc.h arabic.h ascii.h ex_cmds.h farsi.h feature.h globals.h \
keymap.h macros.h option.h os_dos.h os_win32.h proto.h regexp.h \ keymap.h macros.h option.h os_dos.h os_win32.h proto.h regexp.h \

View File

@ -1565,9 +1565,12 @@ DEST_MAN_PL_U = $(DEST_MAN_TOP)/pl.UTF-8$(MAN1DIR)
DEST_MAN_RU = $(DEST_MAN_TOP)/ru.KOI8-R$(MAN1DIR) DEST_MAN_RU = $(DEST_MAN_TOP)/ru.KOI8-R$(MAN1DIR)
DEST_MAN_RU_U = $(DEST_MAN_TOP)/ru.UTF-8$(MAN1DIR) DEST_MAN_RU_U = $(DEST_MAN_TOP)/ru.UTF-8$(MAN1DIR)
# The list of tests is common to all systems. # stuff common to all systems
include Make_all.mak include Make_all.mak
# get the list of tests
include testdir/Make_all.mak
# BASIC_SRC: files that are always used # BASIC_SRC: files that are always used
# GUI_SRC: extra GUI files for current configuration # GUI_SRC: extra GUI files for current configuration
# ALL_GUI_SRC: all GUI files for Unix # ALL_GUI_SRC: all GUI files for Unix
@ -2184,11 +2187,7 @@ test1 \
# Run individual NEW style test. # Run individual NEW style test.
# These do not depend on the executable, compile it when needed. # These do not depend on the executable, compile it when needed.
$(NEW_TESTS): $(NEW_TESTS):
cd testdir; rm -f $@.res test.log messages; $(MAKE) -f Makefile $@.res VIMPROG=../$(VIMTESTTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE) cd testdir; $(MAKE) $@ VIMPROG=../$(VIMTESTTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE)
@if test -f testdir/test.log; then \
cat testdir/test.log; \
fi
cat testdir/messages
newtests: newtests:
cd testdir; rm -f $@.res test.log messages; $(MAKE) -f Makefile newtestssilent VIMPROG=../$(VIMTESTTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE) cd testdir; rm -f $@.res test.log messages; $(MAKE) -f Makefile newtestssilent VIMPROG=../$(VIMTESTTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE)

View File

@ -60,11 +60,222 @@ SCRIPTS_WIN32 =
# Tests for the GUI. # Tests for the GUI.
SCRIPTS_GUI = SCRIPTS_GUI =
# Individual tests, including the ones part of test_alot.
# Please keep sorted up to test_alot.
NEW_TESTS = \
test_arglist \
test_arabic \
test_assert \
test_assign \
test_autochdir \
test_autocmd \
test_autoload \
test_backspace_opt \
test_backup \
test_behave \
test_blockedit \
test_breakindent \
test_bufline \
test_bufwintabinfo \
test_cd \
test_cdo \
test_changedtick \
test_changelist \
test_channel \
test_charsearch \
test_charsearch_utf8 \
test_cindent \
test_clientserver \
test_close_count \
test_cmdline \
test_command_count \
test_comparators \
test_compiler \
test_conceal \
test_crypt \
test_cscope \
test_cursor_func \
test_curswant \
test_delete \
test_diffmode \
test_digraph \
test_display \
test_edit \
test_erasebackword \
test_escaped_glob \
test_eval_stuff \
test_ex_undo \
test_ex_z \
test_exit \
test_exec_while_if \
test_execute_func \
test_exists \
test_exists_autocmd \
test_expand \
test_expand_dllpath \
test_expand_func \
test_expr \
test_expr_utf8 \
test_farsi \
test_feedkeys \
test_file_perm \
test_file_size \
test_fileformat \
test_filetype \
test_filter_cmd \
test_filter_map \
test_find_complete \
test_findfile \
test_fixeol \
test_float_func \
test_fnameescape \
test_fnamemodify \
test_fold \
test_functions \
test_ga \
test_getcwd \
test_getvar \
test_gf \
test_glob2regpat \
test_global \
test_gn \
test_goto \
test_gui \
test_gui_init \
test_hardcopy \
test_help \
test_help_tagjump \
test_hide \
test_highlight \
test_history \
test_hlsearch \
test_iminsert \
test_increment \
test_increment_dbcs \
test_ins_complete \
test_job_fails \
test_join \
test_json \
test_jumplist \
test_jumps \
test_lambda \
test_langmap \
test_largefile \
test_let \
test_lineending \
test_lispwords \
test_listchars \
test_listdict \
test_listlbr \
test_listlbr_utf8 \
test_lua \
test_makeencoding \
test_man \
test_maparg \
test_mapping \
test_marks \
test_match \
test_matchadd_conceal \
test_matchadd_conceal_utf8 \
test_menu \
test_messages \
test_mksession \
test_mksession_utf8 \
test_modeline \
test_move \
test_nested_function \
test_netbeans \
test_normal \
test_number \
test_options \
test_packadd \
test_partial \
test_paste \
test_perl \
test_plus_arg_edit \
test_popup \
test_preview \
test_profile \
test_prompt_buffer \
test_put \
test_python2 \
test_python3 \
test_pyx2 \
test_pyx3 \
test_quickfix \
test_quotestar \
test_recover \
test_regex_char_classes \
test_regexp_latin \
test_regexp_utf8 \
test_registers \
test_reltime \
test_retab \
test_ruby \
test_scriptnames \
test_scroll_opt \
test_scrollbind \
test_search \
test_searchpos \
test_set \
test_sha256 \
test_signs \
test_smartindent \
test_sort \
test_source_utf8 \
test_spell \
test_startup \
test_startup_utf8 \
test_stat \
test_statusline \
test_substitute \
test_suspend \
test_swap \
test_syn_attr \
test_syntax \
test_system \
test_tab \
test_tabline \
test_tabpage \
test_tagcase \
test_tagjump \
test_taglist \
test_tcl \
test_terminal \
test_terminal_fail \
test_textformat \
test_textobjects \
test_textprop \
test_timers \
test_true_false \
test_undo \
test_unlet \
test_usercommands \
test_utf8 \
test_utf8_comparisons \
test_vartabs \
test_viminfo \
test_vimscript \
test_virtualedit \
test_visual \
test_winbar \
test_winbuf_close \
test_window_cmd \
test_window_id \
test_windows_home \
test_wordcount \
test_writefile \
test_xxd \
test_alot_latin \
test_alot_utf8 \
test_alot
# Tests using runtest.vim
# Test targets that use runtest.vim.
# Keep test_alot*.res as the last one, sort the others. # Keep test_alot*.res as the last one, sort the others.
# test_largefile.res is omitted, it uses too much resources to run on CI. # test_largefile.res is omitted, it uses too much resources to run on CI.
NEW_TESTS = test_arabic.res \ NEW_TESTS_RES = \
test_arabic.res \
test_arglist.res \ test_arglist.res \
test_assert.res \ test_assert.res \
test_autochdir.res \ test_autochdir.res \

View File

@ -19,7 +19,7 @@ include Make_all.mak
SCRIPTS = $(SCRIPTS_ALL) $(SCRIPTS_MORE4) SCRIPTS = $(SCRIPTS_ALL) $(SCRIPTS_MORE4)
# Must run test1 first to create small.vim. # Must run test1 first to create small.vim.
$(SCRIPTS) $(SCRIPTS_GUI) $(NEW_TESTS): $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_GUI) $(NEW_TESTS_RES): $(SCRIPTS_FIRST)
.SUFFIXES: .in .out .SUFFIXES: .in .out

View File

@ -66,7 +66,7 @@ $(TEST_OUTFILES): $(DOSTMP)\$(*B).in
# Must run test1 first to create small.vim. # Must run test1 first to create small.vim.
# This rule must come after the one that copies the input files to dostmp to # This rule must come after the one that copies the input files to dostmp to
# allow for running an individual test. # allow for running an individual test.
$(SCRIPTS) $(SCRIPTS_GUI) $(SCRIPTS_WIN32) $(NEW_TESTS): $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_GUI) $(SCRIPTS_WIN32) $(NEW_TESTS_RES): $(SCRIPTS_FIRST)
report: report:
@echo "" @echo ""
@ -115,7 +115,7 @@ bench_re_freeze.out: bench_re_freeze.vim
newtests: newtestssilent newtests: newtestssilent
@if exist messages (findstr "SKIPPED FAILED" messages > nul) && type messages @if exist messages (findstr "SKIPPED FAILED" messages > nul) && type messages
newtestssilent: $(NEW_TESTS) newtestssilent: $(NEW_TESTS_RES)
.vim.res: .vim.res:
@echo $(VIMPROG) > vimcmd @echo $(VIMPROG) > vimcmd

View File

@ -38,7 +38,7 @@ SCRIPTS = $(SCRIPTS_ALL) $(SCRIPTS_MORE1) $(SCRIPTS_MORE4) $(SCRIPTS_WIN32)
SCRIPTS_BENCH = bench_re_freeze.out SCRIPTS_BENCH = bench_re_freeze.out
# Must run test1 first to create small.vim. # Must run test1 first to create small.vim.
$(SCRIPTS) $(SCRIPTS_GUI) $(SCRIPTS_WIN32) $(NEW_TESTS): $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_GUI) $(SCRIPTS_WIN32) $(NEW_TESTS_RES): $(SCRIPTS_FIRST)
.SUFFIXES: .in .out .res .vim .SUFFIXES: .in .out .res .vim
@ -110,7 +110,7 @@ bench_re_freeze.out: bench_re_freeze.vim
# to write and a lot easier to read and debug. # to write and a lot easier to read and debug.
# Limitation: Only works with the +eval feature. # Limitation: Only works with the +eval feature.
newtests: $(NEW_TESTS) newtests: $(NEW_TESTS_RES)
.vim.res: .vim.res:
@echo $(VIMPROG) > vimcmd @echo $(VIMPROG) > vimcmd

View File

@ -23,7 +23,8 @@ REDIR_TEST_TO_NULL = --cmd 'au SwapExists * let v:swapchoice = "e"' > /dev/null
default: nongui default: nongui
# The list of tests is common to all systems. # The list of tests is common to all systems.
# This defines NEW_TESTS, SCRIPTS_ALL, SCRIPTS_MORE* and SCRIPTS_GUI. # This defines NEW_TESTS, NEW_TESTS_RES, SCRIPTS_ALL, SCRIPTS_MORE* and
# SCRIPTS_GUI.
include Make_all.mak include Make_all.mak
@ -50,10 +51,21 @@ report:
else echo ALL DONE; \ else echo ALL DONE; \
fi" fi"
$(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_GUI) $(NEW_TESTS): $(VIMPROG) $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_GUI) $(NEW_TESTS_RES): $(VIMPROG)
# Must run test1 first to create small.vim. # Must run test1 first to create small.vim.
$(SCRIPTS) $(SCRIPTS_GUI) $(NEW_TESTS): $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_GUI) $(NEW_TESTS_RES): $(SCRIPTS_FIRST)
# Execute an individual new style test, e.g.:
# make test_largefile
$(NEW_TESTS):
rm -f $@.res test.log messages
$(MAKE) -f Makefile $@.res
@if test -f test.log; then \
cat test.log; \
fi
cat messages
RM_ON_RUN = test.out X* viminfo RM_ON_RUN = test.out X* viminfo
RM_ON_START = tiny.vim small.vim mbyte.vim mzscheme.vim test.ok benchmark.out RM_ON_START = tiny.vim small.vim mbyte.vim mzscheme.vim test.ok benchmark.out
@ -128,7 +140,7 @@ RUN_VIMTEST = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(VALGRIND) $(VIMPR
newtests: newtestssilent newtests: newtestssilent
@/bin/sh -c "if test -f messages && grep -q 'SKIPPED\|FAILED' messages; then cat messages; fi" @/bin/sh -c "if test -f messages && grep -q 'SKIPPED\|FAILED' messages; then cat messages; fi"
newtestssilent: $(NEW_TESTS) newtestssilent: $(NEW_TESTS_RES)
.vim.res: writevimcmd .vim.res: writevimcmd

View File

@ -1,4 +1,5 @@
This directory contains tests for various Vim features. This directory contains tests for various Vim features.
For testing an indent script see runtime/indent/testdir/README.txt.
If it makes sense, add a new test method to an already existing file. You may If it makes sense, add a new test method to an already existing file. You may
want to separate it from other tests with comment lines. want to separate it from other tests with comment lines.
@ -14,10 +15,10 @@ can. Use an old style test when it needs to run without the +eval feature.
TO ADD A NEW STYLE TEST: TO ADD A NEW STYLE TEST:
1) Create a test_<subject>.vim file. 1) Create a test_<subject>.vim file.
2) Add test_<subject>.res to NEW_TESTS in Make_all.mak in alphabetical order. 2) Add test_<subject>.res to NEW_TESTS_RES in Make_all.mak in alphabetical
3) Also add an entry "test_<subject>" in src/Make_all.mak. order.
4) Use make test_<subject>.res to run a single test in src/testdir/. 3) Also add an entry "test_<subject>" to NEW_TESTS in Make_all.mak.
Use make test_<subject> to run a single test in src/. 4) Use make test_<subject> to run a single test.
At 2), instead of running the test separately, it can be included in At 2), instead of running the test separately, it can be included in
"test_alot". Do this for quick tests without side effects. The test runs a "test_alot". Do this for quick tests without side effects. The test runs a

View File

@ -795,6 +795,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
723,
/**/ /**/
722, 722,
/**/ /**/