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 | 34b6cb1 | 2008-09-20 14:27:03 +0000 | [diff] [blame] | 51 | echo ALL DONE |
| 52 | |
Bram Moolenaar | 9bd3186 | 2016-06-13 22:58:39 +0200 | [diff] [blame^] | 53 | nongui: fixff nolog $(SCRIPTS_FIRST) $(SCRIPTS) newtests |
Bram Moolenaar | 34b6cb1 | 2008-09-20 14:27:03 +0000 | [diff] [blame] | 54 | echo ALL DONE |
| 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 | 34b6cb1 | 2008-09-20 14:27:03 +0000 | [diff] [blame] | 59 | echo ALL DONE |
| 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 | 34b6cb1 | 2008-09-20 14:27:03 +0000 | [diff] [blame] | 62 | echo ALL DONE |
| 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 | 34b6cb1 | 2008-09-20 14:27:03 +0000 | [diff] [blame] | 65 | echo ALL DONE |
| 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 | 49c39ff | 2016-02-25 21:21:52 +0100 | [diff] [blame] | 69 | -$(VIMPROG) -u dos.vim $(NO_PLUGIN) "+argdo set ff=dos|upd" +q *.in *.ok |
| 70 | -$(VIMPROG) -u dos.vim $(NO_PLUGIN) "+argdo set ff=unix|upd" +q \ |
Bram Moolenaar | 298c659 | 2016-04-02 22:24:20 +0200 | [diff] [blame] | 71 | dotest.in test60.ok test71.ok test74.ok test_listchars.ok \ |
| 72 | test_getcwd.ok 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 |
| 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 |
Bram Moolenaar | 34b6cb1 | 2008-09-20 14:27:03 +0000 | [diff] [blame] | 91 | |
| 92 | .in.out: |
Bram Moolenaar | 9bd3186 | 2016-06-13 22:58:39 +0200 | [diff] [blame^] | 93 | -@if exist $*.ok $(CP) $*.ok test.ok |
Bram Moolenaar | 49c39ff | 2016-02-25 21:21:52 +0100 | [diff] [blame] | 94 | $(VIMPROG) -u dos.vim $(NO_PLUGIN) -s dotest.in $*.in |
Bram Moolenaar | 9bd3186 | 2016-06-13 22:58:39 +0200 | [diff] [blame^] | 95 | @diff test.out $*.ok |
| 96 | -@if exist $*.out $(DEL) $*.out |
| 97 | @$(MV) test.out $*.out |
| 98 | -@if exist Xdir1 $(DELDIR) Xdir1 |
| 99 | -@if exist Xfind $(DELDIR) Xfind |
| 100 | -@if exist X* $(DEL) X* |
| 101 | -@if exist test.ok $(DEL) test.ok |
| 102 | -@if exist viminfo $(DEL) viminfo |
| 103 | |
| 104 | nolog: |
| 105 | -@if exist test.log $(DEL) test.log |
| 106 | -@if exist messages $(DEL) messages |
Bram Moolenaar | fda3729 | 2014-11-05 14:27:36 +0100 | [diff] [blame] | 107 | |
| 108 | bench_re_freeze.out: bench_re_freeze.vim |
| 109 | -$(DEL) benchmark.out |
Bram Moolenaar | 49c39ff | 2016-02-25 21:21:52 +0100 | [diff] [blame] | 110 | $(VIMPROG) -u dos.vim $(NO_PLUGIN) $*.in |
Bram Moolenaar | fda3729 | 2014-11-05 14:27:36 +0100 | [diff] [blame] | 111 | $(CAT) benchmark.out |
Bram Moolenaar | 9bd3186 | 2016-06-13 22:58:39 +0200 | [diff] [blame^] | 112 | |
| 113 | # New style of tests uses Vim script with assert calls. These are easier |
| 114 | # to write and a lot easier to read and debug. |
| 115 | # Limitation: Only works with the +eval feature. |
| 116 | |
| 117 | newtests: $(NEW_TESTS) |
| 118 | |
| 119 | .vim.res: |
| 120 | $(VIMPROG) -u NONE $(NO_PLUGIN) -S runtest.vim $*.vim |
| 121 | |