Imported Upstream version 8.0.586
[platform/upstream/vim.git] / src / testdir / Make_ming.mak
1 #
2 # Makefile to run all tests for Vim, on Dos-like machines
3 # with sh.exe or zsh.exe in the path or not.
4 #
5 # Author: Bill McCarthy
6 #
7 # Note that test54 has been removed until it is fixed.
8 #
9 # Requires a set of Unix tools: echo, diff, etc.
10
11 ifneq (sh.exe, $(SHELL))
12 DEL = rm -f
13 DELDIR = rm -rf
14 MV = mv
15 CP = cp
16 CAT = cat
17 DIRSLASH = /
18 else
19 DEL = del
20 DELDIR = rd /s /q
21 MV = rename
22 CP = copy
23 CAT = type
24 DIRSLASH = \\
25 endif
26
27 VIMPROG = ..$(DIRSLASH)vim
28
29 default: vimall
30
31 include Make_all.mak
32
33 # Omitted:
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
40
41 SCRIPTS = $(SCRIPTS_ALL) $(SCRIPTS_MORE1) $(SCRIPTS_MORE4) $(SCRIPTS_WIN32)
42
43 SCRIPTS_BENCH = bench_re_freeze.out
44
45 # Must run test1 first to create small.vim.
46 $(SCRIPTS) $(SCRIPTS_GUI) $(SCRIPTS_WIN32) $(NEW_TESTS): $(SCRIPTS_FIRST)
47
48 .SUFFIXES: .in .out .res .vim
49
50 vimall: fixff $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_GUI) $(SCRIPTS_WIN32) newtests
51         @echo ALL DONE
52
53 nongui: fixff nolog $(SCRIPTS_FIRST) $(SCRIPTS) newtests
54         @echo ALL DONE
55
56 benchmark: $(SCRIPTS_BENCH)
57
58 small: nolog
59         @echo ALL DONE
60
61 gui:    fixff nolog $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_GUI) newtests
62         @echo ALL DONE
63
64 win32:  fixff nolog $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_WIN32) newtests
65         @echo ALL DONE
66
67 # TODO: find a way to avoid changing the distributed files.
68 fixff:
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
73
74 clean:
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
92
93 .in.out:
94         -@if exist $*.ok $(CP) $*.ok test.ok
95         $(VIMPROG) -u dos.vim $(NO_INITS) -s dotest.in $*.in
96         @diff test.out $*.ok
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
104
105 nolog:
106         -@if exist test.log $(DEL) test.log
107         -@if exist messages $(DEL) messages
108
109 bench_re_freeze.out: bench_re_freeze.vim
110         -$(DEL) benchmark.out
111         $(VIMPROG) -u dos.vim $(NO_INITS) $*.in
112         $(CAT) benchmark.out
113
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.
117
118 newtests: $(NEW_TESTS)
119
120 .vim.res:
121         @echo "$(VIMPROG)" > vimcmd
122         $(VIMPROG) -u NONE $(NO_INITS) -S runtest.vim $*.vim
123         @$(DEL) vimcmd
124
125 test_gui.res: test_gui.vim
126         @echo "$(VIMPROG)" > vimcmd
127         $(VIMPROG) -u NONE $(NO_INITS) -S runtest.vim $<
128         @$(DEL) vimcmd
129
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 $<
133         @$(DEL) vimcmd
134
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