blob: d66d6678c8cea1ca3243cbd9ffe428fc7b97bdec [file] [log] [blame]
Bram Moolenaar68392722010-07-30 22:04:17 +02001#
2# Makefile to run all tests for Vim, on Dos-like machines
Bram Moolenaar34b6cb12008-09-20 14:27:03 +00003# with sh.exe or zsh.exe in the path or not.
4#
5# Author: Bill McCarthy
6#
Bram Moolenaar34b6cb12008-09-20 14:27:03 +00007# Requires a set of Unix tools: echo, diff, etc.
8
9ifneq (sh.exe, $(SHELL))
10DEL = rm -f
Bram Moolenaaracf92d22016-01-02 16:00:20 +010011DELDIR = rm -rf
Bram Moolenaar34b6cb12008-09-20 14:27:03 +000012MV = mv
13CP = cp
Bram Moolenaarfda37292014-11-05 14:27:36 +010014CAT = cat
Bram Moolenaar34b6cb12008-09-20 14:27:03 +000015DIRSLASH = /
16else
17DEL = del
Bram Moolenaaracf92d22016-01-02 16:00:20 +010018DELDIR = rd /s /q
Bram Moolenaar34b6cb12008-09-20 14:27:03 +000019MV = rename
20CP = copy
Bram Moolenaarfda37292014-11-05 14:27:36 +010021CAT = type
Bram Moolenaar34b6cb12008-09-20 14:27:03 +000022DIRSLASH = \\
23endif
24
25VIMPROG = ..$(DIRSLASH)vim
26
Bram Moolenaar40bbcee2015-12-28 22:24:41 +010027default: vimall
28
Bram Moolenaar7b6156f2015-12-28 16:01:26 +010029include Make_all.mak
30
Bram Moolenaar34b6cb12008-09-20 14:27:03 +000031# Omitted:
32# test2 "\\tmp" doesn't work.
33# test10 'errorformat' is different
Bram Moolenaar7b6156f2015-12-28 16:01:26 +010034# test97 \{ and \$ are not escaped characters
Bram Moolenaar34b6cb12008-09-20 14:27:03 +000035
Bram Moolenaar7b6156f2015-12-28 16:01:26 +010036SCRIPTS = $(SCRIPTS_ALL) $(SCRIPTS_MORE1) $(SCRIPTS_MORE4) $(SCRIPTS_WIN32)
Bram Moolenaar34b6cb12008-09-20 14:27:03 +000037
Bram Moolenaarfda37292014-11-05 14:27:36 +010038SCRIPTS_BENCH = bench_re_freeze.out
39
Bram Moolenaara6082432015-12-28 16:26:45 +010040# Must run test1 first to create small.vim.
41$(SCRIPTS) $(SCRIPTS_GUI) $(SCRIPTS_WIN32) $(NEW_TESTS): $(SCRIPTS_FIRST)
42
Bram Moolenaar9bd31862016-06-13 22:58:39 +020043.SUFFIXES: .in .out .res .vim
Bram Moolenaar34b6cb12008-09-20 14:27:03 +000044
Bram Moolenaar9bd31862016-06-13 22:58:39 +020045vimall: fixff $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_GUI) $(SCRIPTS_WIN32) newtests
Bram Moolenaar5b4a3762016-08-06 20:36:34 +020046 @echo ALL DONE
Bram Moolenaar34b6cb12008-09-20 14:27:03 +000047
Bram Moolenaar9bd31862016-06-13 22:58:39 +020048nongui: fixff nolog $(SCRIPTS_FIRST) $(SCRIPTS) newtests
Bram Moolenaar5b4a3762016-08-06 20:36:34 +020049 @echo ALL DONE
Bram Moolenaar34b6cb12008-09-20 14:27:03 +000050
Bram Moolenaarfda37292014-11-05 14:27:36 +010051benchmark: $(SCRIPTS_BENCH)
52
Bram Moolenaar9bd31862016-06-13 22:58:39 +020053small: nolog
Bram Moolenaar5b4a3762016-08-06 20:36:34 +020054 @echo ALL DONE
Bram Moolenaar34b6cb12008-09-20 14:27:03 +000055
Bram Moolenaar9bd31862016-06-13 22:58:39 +020056gui: fixff nolog $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_GUI) newtests
Bram Moolenaar5b4a3762016-08-06 20:36:34 +020057 @echo ALL DONE
Bram Moolenaar34b6cb12008-09-20 14:27:03 +000058
Bram Moolenaar9bd31862016-06-13 22:58:39 +020059win32: fixff nolog $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_WIN32) newtests
Bram Moolenaar5b4a3762016-08-06 20:36:34 +020060 @echo ALL DONE
Bram Moolenaar34b6cb12008-09-20 14:27:03 +000061
Bram Moolenaar9bd31862016-06-13 22:58:39 +020062# TODO: find a way to avoid changing the distributed files.
Bram Moolenaar34b6cb12008-09-20 14:27:03 +000063fixff:
Bram Moolenaar8be2fbb2017-02-23 19:32:47 +010064 -$(VIMPROG) -u dos.vim $(NO_INITS) "+argdo set ff=dos|upd" +q *.in *.ok
65 -$(VIMPROG) -u dos.vim $(NO_INITS) "+argdo set ff=unix|upd" +q \
Bram Moolenaara703aae2017-12-11 22:55:26 +010066 dotest.in
Bram Moolenaar34b6cb12008-09-20 14:27:03 +000067
68clean:
Bram Moolenaar9bd31862016-06-13 22:58:39 +020069 -@if exist *.out $(DEL) *.out
70 -@if exist *.failed $(DEL) *.failed
71 -@if exist *.res $(DEL) *.res
72 -@if exist test.in $(DEL) test.in
73 -@if exist test.ok $(DEL) test.ok
74 -@if exist small.vim $(DEL) small.vim
75 -@if exist tiny.vim $(DEL) tiny.vim
76 -@if exist mbyte.vim $(DEL) mbyte.vim
77 -@if exist mzscheme.vim $(DEL) mzscheme.vim
78 -@if exist lua.vim $(DEL) lua.vim
79 -@if exist Xdir1 $(DELDIR) Xdir1
80 -@if exist Xfind $(DELDIR) Xfind
Bram Moolenaar30fe8862017-07-29 23:01:57 +020081 -@if exist XfakeHOME $(DELDIR) XfakeHOME
Bram Moolenaar9bd31862016-06-13 22:58:39 +020082 -@if exist X* $(DEL) X*
83 -@if exist viminfo $(DEL) viminfo
84 -@if exist test.log $(DEL) test.log
85 -@if exist messages $(DEL) messages
Bram Moolenaar65408f72017-03-07 21:31:27 +010086 -@if exist opt_test.vim $(DEL) opt_test.vim
Bram Moolenaar34b6cb12008-09-20 14:27:03 +000087
88.in.out:
Bram Moolenaar9bd31862016-06-13 22:58:39 +020089 -@if exist $*.ok $(CP) $*.ok test.ok
Bram Moolenaar8be2fbb2017-02-23 19:32:47 +010090 $(VIMPROG) -u dos.vim $(NO_INITS) -s dotest.in $*.in
Bram Moolenaar9bd31862016-06-13 22:58:39 +020091 @diff test.out $*.ok
92 -@if exist $*.out $(DEL) $*.out
93 @$(MV) test.out $*.out
94 -@if exist Xdir1 $(DELDIR) Xdir1
95 -@if exist Xfind $(DELDIR) Xfind
Bram Moolenaar30fe8862017-07-29 23:01:57 +020096 -@if exist XfakeHOME $(DELDIR) XfakeHOME
Bram Moolenaar9bd31862016-06-13 22:58:39 +020097 -@if exist X* $(DEL) X*
98 -@if exist test.ok $(DEL) test.ok
99 -@if exist viminfo $(DEL) viminfo
100
101nolog:
102 -@if exist test.log $(DEL) test.log
103 -@if exist messages $(DEL) messages
Bram Moolenaarfda37292014-11-05 14:27:36 +0100104
105bench_re_freeze.out: bench_re_freeze.vim
106 -$(DEL) benchmark.out
Bram Moolenaar8be2fbb2017-02-23 19:32:47 +0100107 $(VIMPROG) -u dos.vim $(NO_INITS) $*.in
Bram Moolenaarfda37292014-11-05 14:27:36 +0100108 $(CAT) benchmark.out
Bram Moolenaar9bd31862016-06-13 22:58:39 +0200109
110# New style of tests uses Vim script with assert calls. These are easier
111# to write and a lot easier to read and debug.
112# Limitation: Only works with the +eval feature.
113
114newtests: $(NEW_TESTS)
115
116.vim.res:
Bram Moolenaar4635e112017-10-07 21:05:18 +0200117 @echo $(VIMPROG) > vimcmd
Bram Moolenaar8be2fbb2017-02-23 19:32:47 +0100118 $(VIMPROG) -u NONE $(NO_INITS) -S runtest.vim $*.vim
119 @$(DEL) vimcmd
120
121test_gui.res: test_gui.vim
Bram Moolenaar4635e112017-10-07 21:05:18 +0200122 @echo $(VIMPROG) > vimcmd
Bram Moolenaar8be2fbb2017-02-23 19:32:47 +0100123 $(VIMPROG) -u NONE $(NO_INITS) -S runtest.vim $<
124 @$(DEL) vimcmd
125
126test_gui_init.res: test_gui_init.vim
Bram Moolenaar4635e112017-10-07 21:05:18 +0200127 @echo $(VIMPROG) > vimcmd
Bram Moolenaar84be8b62017-03-13 22:41:42 +0100128 $(VIMPROG) -u gui_preinit.vim -U gui_init.vim $(NO_PLUGINS) -S runtest.vim $<
Bram Moolenaar5b4a3762016-08-06 20:36:34 +0200129 @$(DEL) vimcmd
Bram Moolenaar9bd31862016-06-13 22:58:39 +0200130
Bram Moolenaar65408f72017-03-07 21:31:27 +0100131opt_test.vim: ../option.c gen_opt_test.vim
Bram Moolenaarbb962262017-03-08 00:01:35 +0100132 $(VIMPROG) -u NONE -S gen_opt_test.vim --noplugin --not-a-term ../option.c