Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | # |
Bram Moolenaar | 6839272 | 2010-07-30 22:04:17 +0200 | [diff] [blame] | 2 | # Makefile to run all tests for Vim, on Dos-like machines. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3 | # |
| 4 | # Requires a set of Unix tools: echo, diff, etc. |
| 5 | |
| 6 | VIMPROG = ..\\vim |
| 7 | |
Bram Moolenaar | 7b6156f | 2015-12-28 16:01:26 +0100 | [diff] [blame^] | 8 | !include Make_all.mak |
| 9 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 10 | # Omitted: |
| 11 | # test2 "\\tmp" doesn't work. |
| 12 | # test10 'errorformat' is different |
| 13 | # test12 can't unlink a swap file |
| 14 | # test25 uses symbolic link |
| 15 | # test27 can't edit file with "*" in file name |
Bram Moolenaar | ee0ee2a | 2013-07-03 21:19:07 +0200 | [diff] [blame] | 16 | # test97 \{ and \$ are not escaped characters. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 17 | |
Bram Moolenaar | 7b6156f | 2015-12-28 16:01:26 +0100 | [diff] [blame^] | 18 | SCRIPTS = $(SCRIPTS_ALL) $(SCRIPTS_MORE1) $(SCRIPTS_MORE3) $(SCRIPTS_MORE4) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 19 | |
Bram Moolenaar | 7b6156f | 2015-12-28 16:01:26 +0100 | [diff] [blame^] | 20 | TEST_OUTFILES = $(SCRIPTS) $(SCRIPTS_WIN32) $(SCRIPTS_GUI) |
Bram Moolenaar | 13cf77b | 2015-02-27 21:11:02 +0100 | [diff] [blame] | 21 | DOSTMP = dostmp |
| 22 | DOSTMP_OUTFILES = $(TEST_OUTFILES:test=dostmp\test) |
| 23 | DOSTMP_INFILES = $(DOSTMP_OUTFILES:.out=.in) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 24 | |
| 25 | .SUFFIXES: .in .out |
| 26 | |
Bram Moolenaar | 7b6156f | 2015-12-28 16:01:26 +0100 | [diff] [blame^] | 27 | nongui: nolog $(SCRIPTS) report |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 28 | |
Bram Moolenaar | 13cf77b | 2015-02-27 21:11:02 +0100 | [diff] [blame] | 29 | small: nolog report |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 30 | |
Bram Moolenaar | 7b6156f | 2015-12-28 16:01:26 +0100 | [diff] [blame^] | 31 | gui: nolog $(SCRIPTS) $(SCRIPTS_GUI) report |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 32 | |
Bram Moolenaar | 7b6156f | 2015-12-28 16:01:26 +0100 | [diff] [blame^] | 33 | win32: nolog $(SCRIPTS) $(SCRIPTS_WIN32) report |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 34 | |
Bram Moolenaar | 13cf77b | 2015-02-27 21:11:02 +0100 | [diff] [blame] | 35 | # Copy the input files to dostmp, changing the fileformat to dos. |
| 36 | $(DOSTMP_INFILES): $(*B).in |
| 37 | if not exist $(DOSTMP)\NUL md $(DOSTMP) |
| 38 | if exist $@ del $@ |
| 39 | $(VIMPROG) -u dos.vim --noplugin "+set ff=dos|f $@|wq" $(*B).in |
| 40 | |
| 41 | # For each input file dostmp/test99.in run the tests. |
| 42 | # This moves test99.in to test99.in.bak temporarily. |
| 43 | $(TEST_OUTFILES): $(DOSTMP)\$(*B).in |
| 44 | -@if exist test.out DEL test.out |
| 45 | move $(*B).in $(*B).in.bak |
Bram Moolenaar | 13cf77b | 2015-02-27 21:11:02 +0100 | [diff] [blame] | 46 | copy $(DOSTMP)\$(*B).in $(*B).in |
| 47 | copy $(*B).ok test.ok |
| 48 | $(VIMPROG) -u dos.vim -U NONE --noplugin -s dotest.in $(*B).in |
| 49 | -@if exist test.out MOVE /y test.out $(DOSTMP)\$(*B).out |
| 50 | -@if exist $(*B).in.bak move /y $(*B).in.bak $(*B).in |
| 51 | -@del X* |
| 52 | -@if exist test.ok del test.ok |
| 53 | -@if exist Xdir1 rd /s /q Xdir1 |
| 54 | -@if exist Xfind rd /s /q Xfind |
| 55 | -@if exist viminfo del viminfo |
| 56 | $(VIMPROG) -u dos.vim --noplugin "+set ff=unix|f test.out|wq" \ |
| 57 | $(DOSTMP)\$(*B).out |
| 58 | @diff test.out $*.ok & if errorlevel 1 \ |
| 59 | ( move /y test.out $*.failed \ |
| 60 | & del $(DOSTMP)\$(*B).out \ |
| 61 | & echo $* FAILED >> test.log ) \ |
| 62 | else ( move /y test.out $*.out ) |
Bram Moolenaar | b78b0b0 | 2005-01-02 11:32:29 +0000 | [diff] [blame] | 63 | |
Bram Moolenaar | 6949eea | 2013-06-16 16:57:46 +0200 | [diff] [blame] | 64 | report: |
| 65 | @echo "" |
| 66 | @echo Test results: |
Bram Moolenaar | 13cf77b | 2015-02-27 21:11:02 +0100 | [diff] [blame] | 67 | @if exist test.log ( type test.log & echo TEST FAILURE & exit /b 1 ) \ |
| 68 | else ( echo ALL DONE ) |
Bram Moolenaar | 6949eea | 2013-06-16 16:57:46 +0200 | [diff] [blame] | 69 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 70 | clean: |
| 71 | -del *.out |
Bram Moolenaar | 555d2a8 | 2013-06-17 21:53:37 +0200 | [diff] [blame] | 72 | -del *.failed |
Bram Moolenaar | 13cf77b | 2015-02-27 21:11:02 +0100 | [diff] [blame] | 73 | -if exist $(DOSTMP) rd /s /q $(DOSTMP) |
| 74 | -if exist test.in del test.in |
Bram Moolenaar | 9c03978 | 2007-08-14 15:55:42 +0000 | [diff] [blame] | 75 | -if exist test.ok del test.ok |
| 76 | -if exist small.vim del small.vim |
| 77 | -if exist tiny.vim del tiny.vim |
| 78 | -if exist mbyte.vim del mbyte.vim |
Bram Moolenaar | 2498b3a | 2010-03-02 17:59:44 +0100 | [diff] [blame] | 79 | -if exist mzscheme.vim del mzscheme.vim |
Bram Moolenaar | b35c338 | 2012-10-06 19:10:35 +0200 | [diff] [blame] | 80 | -if exist lua.vim del lua.vim |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 81 | -del X* |
Bram Moolenaar | 555d2a8 | 2013-06-17 21:53:37 +0200 | [diff] [blame] | 82 | -if exist Xdir1 rd /s /q Xdir1 |
| 83 | -if exist Xfind rd /s /q Xfind |
Bram Moolenaar | 9c03978 | 2007-08-14 15:55:42 +0000 | [diff] [blame] | 84 | -if exist viminfo del viminfo |
Bram Moolenaar | 13cf77b | 2015-02-27 21:11:02 +0100 | [diff] [blame] | 85 | -if exist test.log del test.log |
Bram Moolenaar | 9c7d98d | 2014-11-05 15:46:09 +0100 | [diff] [blame] | 86 | -if exist benchmark.out del benchmark.out |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 87 | |
Bram Moolenaar | 6949eea | 2013-06-16 16:57:46 +0200 | [diff] [blame] | 88 | nolog: |
Bram Moolenaar | 13cf77b | 2015-02-27 21:11:02 +0100 | [diff] [blame] | 89 | -if exist test.log del test.log |
Bram Moolenaar | fda3729 | 2014-11-05 14:27:36 +0100 | [diff] [blame] | 90 | |
| 91 | benchmark: |
| 92 | bench_re_freeze.out |
| 93 | |
| 94 | bench_re_freeze.out: bench_re_freeze.vim |
| 95 | -if exist benchmark.out del benchmark.out |
| 96 | $(VIMPROG) -u dos.vim -U NONE --noplugin $*.in |
| 97 | @IF EXIST benchmark.out ( type benchmark.out ) |