blob: 7b38be53eff8a31567ae4ce0438169aa5364333f [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
Bram Moolenaar9bd31862016-06-13 22:58:39 +020078 -@if exist Xdir1 $(DELDIR) Xdir1
79 -@if exist Xfind $(DELDIR) Xfind
Bram Moolenaar30fe8862017-07-29 23:01:57 +020080 -@if exist XfakeHOME $(DELDIR) XfakeHOME
Bram Moolenaar9bd31862016-06-13 22:58:39 +020081 -@if exist X* $(DEL) X*
82 -@if exist viminfo $(DEL) viminfo
83 -@if exist test.log $(DEL) test.log
84 -@if exist messages $(DEL) messages
Bram Moolenaar65408f72017-03-07 21:31:27 +010085 -@if exist opt_test.vim $(DEL) opt_test.vim
Bram Moolenaar34b6cb12008-09-20 14:27:03 +000086
87.in.out:
Bram Moolenaar9bd31862016-06-13 22:58:39 +020088 -@if exist $*.ok $(CP) $*.ok test.ok
Bram Moolenaar8be2fbb2017-02-23 19:32:47 +010089 $(VIMPROG) -u dos.vim $(NO_INITS) -s dotest.in $*.in
Bram Moolenaar9bd31862016-06-13 22:58:39 +020090 @diff test.out $*.ok
91 -@if exist $*.out $(DEL) $*.out
92 @$(MV) test.out $*.out
93 -@if exist Xdir1 $(DELDIR) Xdir1
94 -@if exist Xfind $(DELDIR) Xfind
Bram Moolenaar30fe8862017-07-29 23:01:57 +020095 -@if exist XfakeHOME $(DELDIR) XfakeHOME
Bram Moolenaar9bd31862016-06-13 22:58:39 +020096 -@if exist X* $(DEL) X*
97 -@if exist test.ok $(DEL) test.ok
98 -@if exist viminfo $(DEL) viminfo
99
100nolog:
101 -@if exist test.log $(DEL) test.log
102 -@if exist messages $(DEL) messages
Bram Moolenaarfda37292014-11-05 14:27:36 +0100103
104bench_re_freeze.out: bench_re_freeze.vim
105 -$(DEL) benchmark.out
Bram Moolenaar8be2fbb2017-02-23 19:32:47 +0100106 $(VIMPROG) -u dos.vim $(NO_INITS) $*.in
Bram Moolenaarfda37292014-11-05 14:27:36 +0100107 $(CAT) benchmark.out
Bram Moolenaar9bd31862016-06-13 22:58:39 +0200108
109# New style of tests uses Vim script with assert calls. These are easier
110# to write and a lot easier to read and debug.
111# Limitation: Only works with the +eval feature.
112
113newtests: $(NEW_TESTS)
114
115.vim.res:
Bram Moolenaar4635e112017-10-07 21:05:18 +0200116 @echo $(VIMPROG) > vimcmd
Bram Moolenaar8be2fbb2017-02-23 19:32:47 +0100117 $(VIMPROG) -u NONE $(NO_INITS) -S runtest.vim $*.vim
118 @$(DEL) vimcmd
119
120test_gui.res: test_gui.vim
Bram Moolenaar4635e112017-10-07 21:05:18 +0200121 @echo $(VIMPROG) > vimcmd
Bram Moolenaar8be2fbb2017-02-23 19:32:47 +0100122 $(VIMPROG) -u NONE $(NO_INITS) -S runtest.vim $<
123 @$(DEL) vimcmd
124
125test_gui_init.res: test_gui_init.vim
Bram Moolenaar4635e112017-10-07 21:05:18 +0200126 @echo $(VIMPROG) > vimcmd
Bram Moolenaar84be8b62017-03-13 22:41:42 +0100127 $(VIMPROG) -u gui_preinit.vim -U gui_init.vim $(NO_PLUGINS) -S runtest.vim $<
Bram Moolenaar5b4a3762016-08-06 20:36:34 +0200128 @$(DEL) vimcmd
Bram Moolenaar9bd31862016-06-13 22:58:39 +0200129
Bram Moolenaar65408f72017-03-07 21:31:27 +0100130opt_test.vim: ../option.c gen_opt_test.vim
Bram Moolenaarbb962262017-03-08 00:01:35 +0100131 $(VIMPROG) -u NONE -S gen_opt_test.vim --noplugin --not-a-term ../option.c