2 # Makefile to run all tests for Vim, on Dos-like machines
3 # with sh.exe or zsh.exe in the path or not.
5 # Author: Bill McCarthy
7 # Note that test54 has been removed until it is fixed.
9 # Requires a set of Unix tools: echo, diff, etc.
11 ifneq (sh.exe, $(SHELL))
27 VIMPROG = ..$(DIRSLASH)vim
34 # test2 "\\tmp" doesn't work.
35 # test10 'errorformat' is different
36 # test12 can't unlink a swap file
37 # test25 uses symbolic link
38 # test54 doesn't work yet
39 # test97 \{ and \$ are not escaped characters
41 SCRIPTS = $(SCRIPTS_ALL) $(SCRIPTS_MORE1) $(SCRIPTS_MORE4) $(SCRIPTS_WIN32)
43 SCRIPTS_BENCH = bench_re_freeze.out
45 # Must run test1 first to create small.vim.
46 $(SCRIPTS) $(SCRIPTS_GUI) $(SCRIPTS_WIN32) $(NEW_TESTS): $(SCRIPTS_FIRST)
48 .SUFFIXES: .in .out .res .vim
50 vimall: fixff $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_GUI) $(SCRIPTS_WIN32) newtests
53 nongui: fixff nolog $(SCRIPTS_FIRST) $(SCRIPTS) newtests
56 benchmark: $(SCRIPTS_BENCH)
61 gui: fixff nolog $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_GUI) newtests
64 win32: fixff nolog $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_WIN32) newtests
67 # TODO: find a way to avoid changing the distributed files.
69 -$(VIMPROG) -u dos.vim $(NO_INITS) "+argdo set ff=dos|upd" +q *.in *.ok
70 -$(VIMPROG) -u dos.vim $(NO_INITS) "+argdo set ff=unix|upd" +q \
71 dotest.in test60.ok test_listchars.ok \
72 test_getcwd.ok test_wordcount.ok
75 -@if exist *.out $(DEL) *.out
76 -@if exist *.failed $(DEL) *.failed
77 -@if exist *.res $(DEL) *.res
78 -@if exist test.in $(DEL) test.in
79 -@if exist test.ok $(DEL) test.ok
80 -@if exist small.vim $(DEL) small.vim
81 -@if exist tiny.vim $(DEL) tiny.vim
82 -@if exist mbyte.vim $(DEL) mbyte.vim
83 -@if exist mzscheme.vim $(DEL) mzscheme.vim
84 -@if exist lua.vim $(DEL) lua.vim
85 -@if exist Xdir1 $(DELDIR) Xdir1
86 -@if exist Xfind $(DELDIR) Xfind
87 -@if exist X* $(DEL) X*
88 -@if exist viminfo $(DEL) viminfo
89 -@if exist test.log $(DEL) test.log
90 -@if exist messages $(DEL) messages
91 -@if exist opt_test.vim $(DEL) opt_test.vim
94 -@if exist $*.ok $(CP) $*.ok test.ok
95 $(VIMPROG) -u dos.vim $(NO_INITS) -s dotest.in $*.in
97 -@if exist $*.out $(DEL) $*.out
98 @$(MV) test.out $*.out
99 -@if exist Xdir1 $(DELDIR) Xdir1
100 -@if exist Xfind $(DELDIR) Xfind
101 -@if exist X* $(DEL) X*
102 -@if exist test.ok $(DEL) test.ok
103 -@if exist viminfo $(DEL) viminfo
106 -@if exist test.log $(DEL) test.log
107 -@if exist messages $(DEL) messages
109 bench_re_freeze.out: bench_re_freeze.vim
110 -$(DEL) benchmark.out
111 $(VIMPROG) -u dos.vim $(NO_INITS) $*.in
114 # New style of tests uses Vim script with assert calls. These are easier
115 # to write and a lot easier to read and debug.
116 # Limitation: Only works with the +eval feature.
118 newtests: $(NEW_TESTS)
121 @echo "$(VIMPROG)" > vimcmd
122 $(VIMPROG) -u NONE $(NO_INITS) -S runtest.vim $*.vim
125 test_gui.res: test_gui.vim
126 @echo "$(VIMPROG)" > vimcmd
127 $(VIMPROG) -u NONE $(NO_INITS) -S runtest.vim $<
130 test_gui_init.res: test_gui_init.vim
131 @echo "$(VIMPROG)" > vimcmd
132 $(VIMPROG) -u gui_preinit.vim -U gui_init.vim $(NO_PLUGINS) -S runtest.vim $<
135 opt_test.vim: ../option.c gen_opt_test.vim
136 $(VIMPROG) -u NONE -S gen_opt_test.vim --noplugin --not-a-term ../option.c