blob: b907fe7051e13c9a07b108af827e68349e0e985c [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001#
Bram Moolenaar68392722010-07-30 22:04:17 +02002# Makefile to run all tests for Vim, on Dos-like machines.
Bram Moolenaar071d4272004-06-13 20:20:40 +00003#
4# Requires a set of Unix tools: echo, diff, etc.
5
6VIMPROG = ..\\vim
7
Bram Moolenaar7b6156f2015-12-28 16:01:26 +01008!include Make_all.mak
9
Bram Moolenaar071d4272004-06-13 20:20:40 +000010# 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 Moolenaarda9888a2015-12-28 21:35:14 +010016# test49 fails in various ways
Bram Moolenaaree0ee2a2013-07-03 21:19:07 +020017# test97 \{ and \$ are not escaped characters.
Bram Moolenaar071d4272004-06-13 20:20:40 +000018
Bram Moolenaar7b6156f2015-12-28 16:01:26 +010019SCRIPTS = $(SCRIPTS_ALL) $(SCRIPTS_MORE1) $(SCRIPTS_MORE3) $(SCRIPTS_MORE4)
Bram Moolenaar071d4272004-06-13 20:20:40 +000020
Bram Moolenaara6082432015-12-28 16:26:45 +010021TEST_OUTFILES = $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_WIN32) $(SCRIPTS_GUI)
Bram Moolenaar13cf77b2015-02-27 21:11:02 +010022DOSTMP = dostmp
23DOSTMP_OUTFILES = $(TEST_OUTFILES:test=dostmp\test)
24DOSTMP_INFILES = $(DOSTMP_OUTFILES:.out=.in)
Bram Moolenaar071d4272004-06-13 20:20:40 +000025
26.SUFFIXES: .in .out
27
Bram Moolenaara6082432015-12-28 16:26:45 +010028# Must run test1 first to create small.vim.
29$(SCRIPTS) $(SCRIPTS_GUI) $(SCRIPTS_WIN32) $(NEW_TESTS): $(SCRIPTS_FIRST)
30
31nongui: nolog $(SCRIPTS_FIRST) $(SCRIPTS) report
Bram Moolenaar071d4272004-06-13 20:20:40 +000032
Bram Moolenaar13cf77b2015-02-27 21:11:02 +010033small: nolog report
Bram Moolenaar071d4272004-06-13 20:20:40 +000034
Bram Moolenaara6082432015-12-28 16:26:45 +010035gui: nolog $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_GUI) report
Bram Moolenaar071d4272004-06-13 20:20:40 +000036
Bram Moolenaara6082432015-12-28 16:26:45 +010037win32: nolog $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_WIN32) report
Bram Moolenaar071d4272004-06-13 20:20:40 +000038
Bram Moolenaar13cf77b2015-02-27 21:11:02 +010039# Copy the input files to dostmp, changing the fileformat to dos.
40$(DOSTMP_INFILES): $(*B).in
41 if not exist $(DOSTMP)\NUL md $(DOSTMP)
42 if exist $@ del $@
43 $(VIMPROG) -u dos.vim --noplugin "+set ff=dos|f $@|wq" $(*B).in
44
45# For each input file dostmp/test99.in run the tests.
46# This moves test99.in to test99.in.bak temporarily.
47$(TEST_OUTFILES): $(DOSTMP)\$(*B).in
48 -@if exist test.out DEL test.out
49 move $(*B).in $(*B).in.bak
Bram Moolenaar13cf77b2015-02-27 21:11:02 +010050 copy $(DOSTMP)\$(*B).in $(*B).in
51 copy $(*B).ok test.ok
52 $(VIMPROG) -u dos.vim -U NONE --noplugin -s dotest.in $(*B).in
53 -@if exist test.out MOVE /y test.out $(DOSTMP)\$(*B).out
54 -@if exist $(*B).in.bak move /y $(*B).in.bak $(*B).in
55 -@del X*
56 -@if exist test.ok del test.ok
57 -@if exist Xdir1 rd /s /q Xdir1
58 -@if exist Xfind rd /s /q Xfind
59 -@if exist viminfo del viminfo
60 $(VIMPROG) -u dos.vim --noplugin "+set ff=unix|f test.out|wq" \
61 $(DOSTMP)\$(*B).out
62 @diff test.out $*.ok & if errorlevel 1 \
63 ( move /y test.out $*.failed \
64 & del $(DOSTMP)\$(*B).out \
65 & echo $* FAILED >> test.log ) \
66 else ( move /y test.out $*.out )
Bram Moolenaarb78b0b02005-01-02 11:32:29 +000067
Bram Moolenaar6949eea2013-06-16 16:57:46 +020068report:
69 @echo ""
70 @echo Test results:
Bram Moolenaar13cf77b2015-02-27 21:11:02 +010071 @if exist test.log ( type test.log & echo TEST FAILURE & exit /b 1 ) \
72 else ( echo ALL DONE )
Bram Moolenaar6949eea2013-06-16 16:57:46 +020073
Bram Moolenaar071d4272004-06-13 20:20:40 +000074clean:
75 -del *.out
Bram Moolenaar555d2a82013-06-17 21:53:37 +020076 -del *.failed
Bram Moolenaar13cf77b2015-02-27 21:11:02 +010077 -if exist $(DOSTMP) rd /s /q $(DOSTMP)
78 -if exist test.in del test.in
Bram Moolenaar9c039782007-08-14 15:55:42 +000079 -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
Bram Moolenaar2498b3a2010-03-02 17:59:44 +010083 -if exist mzscheme.vim del mzscheme.vim
Bram Moolenaarb35c3382012-10-06 19:10:35 +020084 -if exist lua.vim del lua.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +000085 -del X*
Bram Moolenaar555d2a82013-06-17 21:53:37 +020086 -if exist Xdir1 rd /s /q Xdir1
87 -if exist Xfind rd /s /q Xfind
Bram Moolenaar9c039782007-08-14 15:55:42 +000088 -if exist viminfo del viminfo
Bram Moolenaar13cf77b2015-02-27 21:11:02 +010089 -if exist test.log del test.log
Bram Moolenaar9c7d98d2014-11-05 15:46:09 +010090 -if exist benchmark.out del benchmark.out
Bram Moolenaar071d4272004-06-13 20:20:40 +000091
Bram Moolenaar6949eea2013-06-16 16:57:46 +020092nolog:
Bram Moolenaar13cf77b2015-02-27 21:11:02 +010093 -if exist test.log del test.log
Bram Moolenaarfda37292014-11-05 14:27:36 +010094
95benchmark:
96 bench_re_freeze.out
97
98bench_re_freeze.out: bench_re_freeze.vim
99 -if exist benchmark.out del benchmark.out
100 $(VIMPROG) -u dos.vim -U NONE --noplugin $*.in
101 @IF EXIST benchmark.out ( type benchmark.out )