Bram Moolenaar | 6839272 | 2010-07-30 22:04:17 +0200 | [diff] [blame] | 1 | # |
| 2 | # Makefile to run all tests for Vim, on Dos-like machines |
Bram Moolenaar | 34b6cb1 | 2008-09-20 14:27:03 +0000 | [diff] [blame] | 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 |
Bram Moolenaar | acf92d2 | 2016-01-02 16:00:20 +0100 | [diff] [blame] | 13 | DELDIR = rm -rf |
Bram Moolenaar | 34b6cb1 | 2008-09-20 14:27:03 +0000 | [diff] [blame] | 14 | MV = mv |
| 15 | CP = cp |
Bram Moolenaar | fda3729 | 2014-11-05 14:27:36 +0100 | [diff] [blame] | 16 | CAT = cat |
Bram Moolenaar | 34b6cb1 | 2008-09-20 14:27:03 +0000 | [diff] [blame] | 17 | DIRSLASH = / |
| 18 | else |
| 19 | DEL = del |
Bram Moolenaar | acf92d2 | 2016-01-02 16:00:20 +0100 | [diff] [blame] | 20 | DELDIR = rd /s /q |
Bram Moolenaar | 34b6cb1 | 2008-09-20 14:27:03 +0000 | [diff] [blame] | 21 | MV = rename |
| 22 | CP = copy |
Bram Moolenaar | fda3729 | 2014-11-05 14:27:36 +0100 | [diff] [blame] | 23 | CAT = type |
Bram Moolenaar | 34b6cb1 | 2008-09-20 14:27:03 +0000 | [diff] [blame] | 24 | DIRSLASH = \\ |
| 25 | endif |
| 26 | |
| 27 | VIMPROG = ..$(DIRSLASH)vim |
| 28 | |
Bram Moolenaar | 40bbcee | 2015-12-28 22:24:41 +0100 | [diff] [blame] | 29 | default: vimall |
| 30 | |
Bram Moolenaar | 7b6156f | 2015-12-28 16:01:26 +0100 | [diff] [blame] | 31 | include Make_all.mak |
| 32 | |
Bram Moolenaar | 34b6cb1 | 2008-09-20 14:27:03 +0000 | [diff] [blame] | 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 |
Bram Moolenaar | 7b6156f | 2015-12-28 16:01:26 +0100 | [diff] [blame] | 38 | # test54 doesn't work yet |
| 39 | # test97 \{ and \$ are not escaped characters |
Bram Moolenaar | 34b6cb1 | 2008-09-20 14:27:03 +0000 | [diff] [blame] | 40 | |
Bram Moolenaar | 7b6156f | 2015-12-28 16:01:26 +0100 | [diff] [blame] | 41 | SCRIPTS = $(SCRIPTS_ALL) $(SCRIPTS_MORE1) $(SCRIPTS_MORE4) $(SCRIPTS_WIN32) |
Bram Moolenaar | 34b6cb1 | 2008-09-20 14:27:03 +0000 | [diff] [blame] | 42 | |
Bram Moolenaar | fda3729 | 2014-11-05 14:27:36 +0100 | [diff] [blame] | 43 | SCRIPTS_BENCH = bench_re_freeze.out |
| 44 | |
Bram Moolenaar | a608243 | 2015-12-28 16:26:45 +0100 | [diff] [blame] | 45 | # Must run test1 first to create small.vim. |
| 46 | $(SCRIPTS) $(SCRIPTS_GUI) $(SCRIPTS_WIN32) $(NEW_TESTS): $(SCRIPTS_FIRST) |
| 47 | |
Bram Moolenaar | 9bd3186 | 2016-06-13 22:58:39 +0200 | [diff] [blame] | 48 | .SUFFIXES: .in .out .res .vim |
Bram Moolenaar | 34b6cb1 | 2008-09-20 14:27:03 +0000 | [diff] [blame] | 49 | |
Bram Moolenaar | 9bd3186 | 2016-06-13 22:58:39 +0200 | [diff] [blame] | 50 | vimall: fixff $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_GUI) $(SCRIPTS_WIN32) newtests |
Bram Moolenaar | 5b4a376 | 2016-08-06 20:36:34 +0200 | [diff] [blame] | 51 | @echo ALL DONE |
Bram Moolenaar | 34b6cb1 | 2008-09-20 14:27:03 +0000 | [diff] [blame] | 52 | |
Bram Moolenaar | 9bd3186 | 2016-06-13 22:58:39 +0200 | [diff] [blame] | 53 | nongui: fixff nolog $(SCRIPTS_FIRST) $(SCRIPTS) newtests |
Bram Moolenaar | 5b4a376 | 2016-08-06 20:36:34 +0200 | [diff] [blame] | 54 | @echo ALL DONE |
Bram Moolenaar | 34b6cb1 | 2008-09-20 14:27:03 +0000 | [diff] [blame] | 55 | |
Bram Moolenaar | fda3729 | 2014-11-05 14:27:36 +0100 | [diff] [blame] | 56 | benchmark: $(SCRIPTS_BENCH) |
| 57 | |
Bram Moolenaar | 9bd3186 | 2016-06-13 22:58:39 +0200 | [diff] [blame] | 58 | small: nolog |
Bram Moolenaar | 5b4a376 | 2016-08-06 20:36:34 +0200 | [diff] [blame] | 59 | @echo ALL DONE |
Bram Moolenaar | 34b6cb1 | 2008-09-20 14:27:03 +0000 | [diff] [blame] | 60 | |
Bram Moolenaar | 9bd3186 | 2016-06-13 22:58:39 +0200 | [diff] [blame] | 61 | gui: fixff nolog $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_GUI) newtests |
Bram Moolenaar | 5b4a376 | 2016-08-06 20:36:34 +0200 | [diff] [blame] | 62 | @echo ALL DONE |
Bram Moolenaar | 34b6cb1 | 2008-09-20 14:27:03 +0000 | [diff] [blame] | 63 | |
Bram Moolenaar | 9bd3186 | 2016-06-13 22:58:39 +0200 | [diff] [blame] | 64 | win32: fixff nolog $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_WIN32) newtests |
Bram Moolenaar | 5b4a376 | 2016-08-06 20:36:34 +0200 | [diff] [blame] | 65 | @echo ALL DONE |
Bram Moolenaar | 34b6cb1 | 2008-09-20 14:27:03 +0000 | [diff] [blame] | 66 | |
Bram Moolenaar | 9bd3186 | 2016-06-13 22:58:39 +0200 | [diff] [blame] | 67 | # TODO: find a way to avoid changing the distributed files. |
Bram Moolenaar | 34b6cb1 | 2008-09-20 14:27:03 +0000 | [diff] [blame] | 68 | fixff: |
Bram Moolenaar | 8be2fbb | 2017-02-23 19:32:47 +0100 | [diff] [blame] | 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 \ |
Bram Moolenaar | 3f9ebf3 | 2016-11-07 22:13:32 +0100 | [diff] [blame] | 71 | dotest.in test60.ok test_listchars.ok \ |
Bram Moolenaar | 292eff0 | 2017-07-11 21:46:28 +0200 | [diff] [blame] | 72 | test_wordcount.ok |
Bram Moolenaar | 34b6cb1 | 2008-09-20 14:27:03 +0000 | [diff] [blame] | 73 | |
| 74 | clean: |
Bram Moolenaar | 9bd3186 | 2016-06-13 22:58:39 +0200 | [diff] [blame] | 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 |
Bram Moolenaar | 30fe886 | 2017-07-29 23:01:57 +0200 | [diff] [blame] | 87 | -@if exist XfakeHOME $(DELDIR) XfakeHOME |
Bram Moolenaar | 9bd3186 | 2016-06-13 22:58:39 +0200 | [diff] [blame] | 88 | -@if exist X* $(DEL) X* |
| 89 | -@if exist viminfo $(DEL) viminfo |
| 90 | -@if exist test.log $(DEL) test.log |
| 91 | -@if exist messages $(DEL) messages |
Bram Moolenaar | 65408f7 | 2017-03-07 21:31:27 +0100 | [diff] [blame] | 92 | -@if exist opt_test.vim $(DEL) opt_test.vim |
Bram Moolenaar | 34b6cb1 | 2008-09-20 14:27:03 +0000 | [diff] [blame] | 93 | |
| 94 | .in.out: |
Bram Moolenaar | 9bd3186 | 2016-06-13 22:58:39 +0200 | [diff] [blame] | 95 | -@if exist $*.ok $(CP) $*.ok test.ok |
Bram Moolenaar | 8be2fbb | 2017-02-23 19:32:47 +0100 | [diff] [blame] | 96 | $(VIMPROG) -u dos.vim $(NO_INITS) -s dotest.in $*.in |
Bram Moolenaar | 9bd3186 | 2016-06-13 22:58:39 +0200 | [diff] [blame] | 97 | @diff test.out $*.ok |
| 98 | -@if exist $*.out $(DEL) $*.out |
| 99 | @$(MV) test.out $*.out |
| 100 | -@if exist Xdir1 $(DELDIR) Xdir1 |
| 101 | -@if exist Xfind $(DELDIR) Xfind |
Bram Moolenaar | 30fe886 | 2017-07-29 23:01:57 +0200 | [diff] [blame] | 102 | -@if exist XfakeHOME $(DELDIR) XfakeHOME |
Bram Moolenaar | 9bd3186 | 2016-06-13 22:58:39 +0200 | [diff] [blame] | 103 | -@if exist X* $(DEL) X* |
| 104 | -@if exist test.ok $(DEL) test.ok |
| 105 | -@if exist viminfo $(DEL) viminfo |
| 106 | |
| 107 | nolog: |
| 108 | -@if exist test.log $(DEL) test.log |
| 109 | -@if exist messages $(DEL) messages |
Bram Moolenaar | fda3729 | 2014-11-05 14:27:36 +0100 | [diff] [blame] | 110 | |
| 111 | bench_re_freeze.out: bench_re_freeze.vim |
| 112 | -$(DEL) benchmark.out |
Bram Moolenaar | 8be2fbb | 2017-02-23 19:32:47 +0100 | [diff] [blame] | 113 | $(VIMPROG) -u dos.vim $(NO_INITS) $*.in |
Bram Moolenaar | fda3729 | 2014-11-05 14:27:36 +0100 | [diff] [blame] | 114 | $(CAT) benchmark.out |
Bram Moolenaar | 9bd3186 | 2016-06-13 22:58:39 +0200 | [diff] [blame] | 115 | |
| 116 | # New style of tests uses Vim script with assert calls. These are easier |
| 117 | # to write and a lot easier to read and debug. |
| 118 | # Limitation: Only works with the +eval feature. |
| 119 | |
| 120 | newtests: $(NEW_TESTS) |
| 121 | |
| 122 | .vim.res: |
Bram Moolenaar | 4635e11 | 2017-10-07 21:05:18 +0200 | [diff] [blame^] | 123 | @echo $(VIMPROG) > vimcmd |
Bram Moolenaar | 8be2fbb | 2017-02-23 19:32:47 +0100 | [diff] [blame] | 124 | $(VIMPROG) -u NONE $(NO_INITS) -S runtest.vim $*.vim |
| 125 | @$(DEL) vimcmd |
| 126 | |
| 127 | test_gui.res: test_gui.vim |
Bram Moolenaar | 4635e11 | 2017-10-07 21:05:18 +0200 | [diff] [blame^] | 128 | @echo $(VIMPROG) > vimcmd |
Bram Moolenaar | 8be2fbb | 2017-02-23 19:32:47 +0100 | [diff] [blame] | 129 | $(VIMPROG) -u NONE $(NO_INITS) -S runtest.vim $< |
| 130 | @$(DEL) vimcmd |
| 131 | |
| 132 | test_gui_init.res: test_gui_init.vim |
Bram Moolenaar | 4635e11 | 2017-10-07 21:05:18 +0200 | [diff] [blame^] | 133 | @echo $(VIMPROG) > vimcmd |
Bram Moolenaar | 84be8b6 | 2017-03-13 22:41:42 +0100 | [diff] [blame] | 134 | $(VIMPROG) -u gui_preinit.vim -U gui_init.vim $(NO_PLUGINS) -S runtest.vim $< |
Bram Moolenaar | 5b4a376 | 2016-08-06 20:36:34 +0200 | [diff] [blame] | 135 | @$(DEL) vimcmd |
Bram Moolenaar | 9bd3186 | 2016-06-13 22:58:39 +0200 | [diff] [blame] | 136 | |
Bram Moolenaar | 65408f7 | 2017-03-07 21:31:27 +0100 | [diff] [blame] | 137 | opt_test.vim: ../option.c gen_opt_test.vim |
Bram Moolenaar | bb96226 | 2017-03-08 00:01:35 +0100 | [diff] [blame] | 138 | $(VIMPROG) -u NONE -S gen_opt_test.vim --noplugin --not-a-term ../option.c |