blob: b34ae1d2c3105cb02dc12b4fa72cbe19bf06ede2 [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 Moolenaarad48e6c2020-04-21 22:19:45 +020031SCRIPTS_BENCH = test_bench_regexp.res
Bram Moolenaarfda37292014-11-05 14:27:36 +010032
Bram Moolenaara6082432015-12-28 16:26:45 +010033# Must run test1 first to create small.vim.
Bram Moolenaarf7c4d832020-08-11 20:42:19 +020034$(NEW_TESTS_RES): $(SCRIPTS_FIRST)
Bram Moolenaara6082432015-12-28 16:26:45 +010035
Bram Moolenaar9bd31862016-06-13 22:58:39 +020036.SUFFIXES: .in .out .res .vim
Bram Moolenaar34b6cb12008-09-20 14:27:03 +000037
Bram Moolenaarf7c4d832020-08-11 20:42:19 +020038vimall: fixff $(SCRIPTS_FIRST) newtests
Bram Moolenaar5b4a3762016-08-06 20:36:34 +020039 @echo ALL DONE
Bram Moolenaar34b6cb12008-09-20 14:27:03 +000040
Bram Moolenaarf7c4d832020-08-11 20:42:19 +020041nongui: fixff nolog $(SCRIPTS_FIRST) newtests
Bram Moolenaar5b4a3762016-08-06 20:36:34 +020042 @echo ALL DONE
Bram Moolenaar34b6cb12008-09-20 14:27:03 +000043
Bram Moolenaarfda37292014-11-05 14:27:36 +010044benchmark: $(SCRIPTS_BENCH)
45
Bram Moolenaar9bd31862016-06-13 22:58:39 +020046small: nolog
Bram Moolenaar5b4a3762016-08-06 20:36:34 +020047 @echo ALL DONE
Bram Moolenaar34b6cb12008-09-20 14:27:03 +000048
Bram Moolenaarf7c4d832020-08-11 20:42:19 +020049gui: fixff nolog $(SCRIPTS_FIRST) newtests
Bram Moolenaar5b4a3762016-08-06 20:36:34 +020050 @echo ALL DONE
Bram Moolenaar34b6cb12008-09-20 14:27:03 +000051
Bram Moolenaarf7c4d832020-08-11 20:42:19 +020052win32: fixff nolog $(SCRIPTS_FIRST) newtests
Bram Moolenaar5b4a3762016-08-06 20:36:34 +020053 @echo ALL DONE
Bram Moolenaar34b6cb12008-09-20 14:27:03 +000054
Bram Moolenaar9bd31862016-06-13 22:58:39 +020055# TODO: find a way to avoid changing the distributed files.
Bram Moolenaar34b6cb12008-09-20 14:27:03 +000056fixff:
Bram Moolenaar8be2fbb2017-02-23 19:32:47 +010057 -$(VIMPROG) -u dos.vim $(NO_INITS) "+argdo set ff=dos|upd" +q *.in *.ok
58 -$(VIMPROG) -u dos.vim $(NO_INITS) "+argdo set ff=unix|upd" +q \
Bram Moolenaara703aae2017-12-11 22:55:26 +010059 dotest.in
Bram Moolenaar34b6cb12008-09-20 14:27:03 +000060
61clean:
Bram Moolenaar9bd31862016-06-13 22:58:39 +020062 -@if exist *.out $(DEL) *.out
63 -@if exist *.failed $(DEL) *.failed
64 -@if exist *.res $(DEL) *.res
65 -@if exist test.in $(DEL) test.in
66 -@if exist test.ok $(DEL) test.ok
67 -@if exist small.vim $(DEL) small.vim
68 -@if exist tiny.vim $(DEL) tiny.vim
69 -@if exist mbyte.vim $(DEL) mbyte.vim
70 -@if exist mzscheme.vim $(DEL) mzscheme.vim
Bram Moolenaar9bd31862016-06-13 22:58:39 +020071 -@if exist Xdir1 $(DELDIR) Xdir1
72 -@if exist Xfind $(DELDIR) Xfind
Bram Moolenaar30fe8862017-07-29 23:01:57 +020073 -@if exist XfakeHOME $(DELDIR) XfakeHOME
Bram Moolenaar9bd31862016-06-13 22:58:39 +020074 -@if exist X* $(DEL) X*
75 -@if exist viminfo $(DEL) viminfo
76 -@if exist test.log $(DEL) test.log
77 -@if exist messages $(DEL) messages
Bram Moolenaar65408f72017-03-07 21:31:27 +010078 -@if exist opt_test.vim $(DEL) opt_test.vim
Bram Moolenaar34b6cb12008-09-20 14:27:03 +000079
Bram Moolenaarfb1199d2019-01-24 12:18:46 +010080test1.out: test1.in
81 -@if exist wrongtermsize $(DEL) wrongtermsize
82 $(VIMPROG) -u dos.vim $(NO_INITS) -s dotest.in test1.in
83 -@if exist wrongtermsize ( \
84 echo Vim window too small- must be 80x25 or larger && exit 1 \
85 )
86 -@if exist test.out $(DEL) test.out
87 -@if exist viminfo $(DEL) viminfo
88
Bram Moolenaar9bd31862016-06-13 22:58:39 +020089nolog:
90 -@if exist test.log $(DEL) test.log
91 -@if exist messages $(DEL) messages
Bram Moolenaarfda37292014-11-05 14:27:36 +010092
Bram Moolenaarad48e6c2020-04-21 22:19:45 +020093test_bench_regexp.res: test_bench_regexp.vim
Bram Moolenaarfda37292014-11-05 14:27:36 +010094 -$(DEL) benchmark.out
Bram Moolenaarad48e6c2020-04-21 22:19:45 +020095 @echo $(VIMPROG) > vimcmd
96 $(VIMPROG) -u NONE $(NO_INITS) -S runtest.vim $*.vim
97 @$(DEL) vimcmd
Bram Moolenaarfda37292014-11-05 14:27:36 +010098 $(CAT) benchmark.out
Bram Moolenaar9bd31862016-06-13 22:58:39 +020099
100# New style of tests uses Vim script with assert calls. These are easier
101# to write and a lot easier to read and debug.
102# Limitation: Only works with the +eval feature.
103
Bram Moolenaarec504012019-01-11 17:30:16 +0100104newtests: $(NEW_TESTS_RES)
Bram Moolenaar9bd31862016-06-13 22:58:39 +0200105
106.vim.res:
Bram Moolenaar4635e112017-10-07 21:05:18 +0200107 @echo $(VIMPROG) > vimcmd
Bram Moolenaar8be2fbb2017-02-23 19:32:47 +0100108 $(VIMPROG) -u NONE $(NO_INITS) -S runtest.vim $*.vim
109 @$(DEL) vimcmd
110
111test_gui.res: test_gui.vim
Bram Moolenaar4635e112017-10-07 21:05:18 +0200112 @echo $(VIMPROG) > vimcmd
Bram Moolenaar8be2fbb2017-02-23 19:32:47 +0100113 $(VIMPROG) -u NONE $(NO_INITS) -S runtest.vim $<
114 @$(DEL) vimcmd
115
116test_gui_init.res: test_gui_init.vim
Bram Moolenaar4635e112017-10-07 21:05:18 +0200117 @echo $(VIMPROG) > vimcmd
Bram Moolenaar84be8b62017-03-13 22:41:42 +0100118 $(VIMPROG) -u gui_preinit.vim -U gui_init.vim $(NO_PLUGINS) -S runtest.vim $<
Bram Moolenaar5b4a3762016-08-06 20:36:34 +0200119 @$(DEL) vimcmd
Bram Moolenaar9bd31862016-06-13 22:58:39 +0200120
Bram Moolenaar46fd6bf2019-01-11 19:19:44 +0100121test_options.res test_alot.res: opt_test.vim
122
Bram Moolenaard9b0d832019-09-14 15:46:32 +0200123opt_test.vim: ../optiondefs.h gen_opt_test.vim
124 $(VIMPROG) -u NONE -S gen_opt_test.vim --noplugin --not-a-term ../optiondefs.h