blob: 4b17f96f4ba4607a1986731421afaa1bb9f84e8b [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
8# Omitted:
9# test2 "\\tmp" doesn't work.
10# test10 'errorformat' is different
11# test12 can't unlink a swap file
12# test25 uses symbolic link
13# test27 can't edit file with "*" in file name
Bram Moolenaaree0ee2a2013-07-03 21:19:07 +020014# test97 \{ and \$ are not escaped characters.
Bram Moolenaar071d4272004-06-13 20:20:40 +000015
16SCRIPTS16 = test1.out test19.out test20.out test22.out \
17 test23.out test24.out test28.out test29.out \
18 test35.out test36.out test43.out \
19 test44.out test45.out test46.out test47.out \
Bram Moolenaara7fc0102005-05-18 22:17:12 +000020 test48.out test51.out test53.out test54.out \
Bram Moolenaar0ce33f32005-12-23 22:16:03 +000021 test55.out test56.out test57.out test58.out test59.out \
Bram Moolenaar9c039782007-08-14 15:55:42 +000022 test60.out test61.out test62.out test63.out test64.out
Bram Moolenaar071d4272004-06-13 20:20:40 +000023
24SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
25 test8.out test9.out test11.out test13.out test14.out \
26 test15.out test17.out test18.out test21.out test26.out \
27 test30.out test31.out test32.out test33.out test34.out \
28 test37.out test38.out test39.out test40.out test41.out \
Bram Moolenaarf11021b2009-11-17 16:57:14 +000029 test42.out test52.out test65.out test66.out test67.out \
Bram Moolenaar680eeca2010-10-20 17:44:42 +020030 test68.out test69.out test71.out test72.out test73.out \
Bram Moolenaar978287b2011-06-19 04:32:15 +020031 test74.out test75.out test76.out test77.out test78.out \
Bram Moolenaar913077c2012-03-28 19:59:04 +020032 test79.out test80.out test81.out test82.out test83.out \
Bram Moolenaarf4e5e862013-02-13 15:44:26 +010033 test84.out test85.out test86.out test87.out test88.out \
Bram Moolenaare3e6e572013-04-12 13:45:02 +020034 test89.out test90.out test91.out test92.out test93.out \
Bram Moolenaarc1c023e2013-11-07 03:26:06 +010035 test94.out test95.out test96.out test98.out test99.out \
Bram Moolenaar26df0922014-02-23 23:39:13 +010036 test100.out test101.out test102.out test103.out test104.out \
Bram Moolenaarc35b0fb2014-05-29 11:47:40 +020037 test105.out test106.out test107.out\
Bram Moolenaar4bde00c2015-01-20 19:31:02 +010038 test_argument_0count.out \
Bram Moolenaarb96a7f32014-11-27 16:22:48 +010039 test_argument_count.out \
Bram Moolenaard69bd9a2014-04-29 12:15:40 +020040 test_autoformat_join.out \
Bram Moolenaar597a4222014-06-25 14:39:50 +020041 test_breakindent.out \
Bram Moolenaar23fb7a92014-07-30 14:05:00 +020042 test_changelist.out \
Bram Moolenaarb96a7f32014-11-27 16:22:48 +010043 test_close_count.out \
Bram Moolenaarf1d6ccf2014-12-08 04:16:44 +010044 test_command_count.out \
Bram Moolenaarb7cb42b2014-04-02 19:55:10 +020045 test_eval.out \
Bram Moolenaar4f5ce332014-07-30 16:00:58 +020046 test_insertcount.out \
Bram Moolenaarb5cf6c32014-08-16 18:36:43 +020047 test_listlbr.out \
48 test_listlbr_utf8.out \
Bram Moolenaarbdef5182014-10-21 16:22:17 +020049 test_mapping.out \
Bram Moolenaarf65aad52015-02-17 13:43:40 +010050 test_marks.out \
Bram Moolenaaref923902014-12-13 21:00:55 +010051 test_nested_function.out \
Bram Moolenaarb5cf6c32014-08-16 18:36:43 +020052 test_options.out \
53 test_qf_title.out \
Bram Moolenaar482a2b52014-10-21 20:57:15 +020054 test_signs.out \
Bram Moolenaarb5cf6c32014-08-16 18:36:43 +020055 test_utf8.out
Bram Moolenaar071d4272004-06-13 20:20:40 +000056
Bram Moolenaar7e506b62010-01-19 15:55:06 +010057SCRIPTS32 = test50.out test70.out
Bram Moolenaar071d4272004-06-13 20:20:40 +000058
Bram Moolenaar13cf77b2015-02-27 21:11:02 +010059SCRIPTS_GUI = test16.out
60
61TEST_OUTFILES = $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS32) $(SCRIPTS_GUI)
62DOSTMP = dostmp
63DOSTMP_OUTFILES = $(TEST_OUTFILES:test=dostmp\test)
64DOSTMP_INFILES = $(DOSTMP_OUTFILES:.out=.in)
Bram Moolenaar071d4272004-06-13 20:20:40 +000065
66.SUFFIXES: .in .out
67
Bram Moolenaar13cf77b2015-02-27 21:11:02 +010068nongui: nolog $(SCRIPTS16) $(SCRIPTS) report
Bram Moolenaar071d4272004-06-13 20:20:40 +000069
Bram Moolenaar13cf77b2015-02-27 21:11:02 +010070small: nolog report
Bram Moolenaar071d4272004-06-13 20:20:40 +000071
Bram Moolenaar13cf77b2015-02-27 21:11:02 +010072gui: nolog $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS_GUI) report
Bram Moolenaar071d4272004-06-13 20:20:40 +000073
Bram Moolenaar13cf77b2015-02-27 21:11:02 +010074win32: nolog $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS32) report
Bram Moolenaar071d4272004-06-13 20:20:40 +000075
Bram Moolenaar13cf77b2015-02-27 21:11:02 +010076# Copy the input files to dostmp, changing the fileformat to dos.
77$(DOSTMP_INFILES): $(*B).in
78 if not exist $(DOSTMP)\NUL md $(DOSTMP)
79 if exist $@ del $@
80 $(VIMPROG) -u dos.vim --noplugin "+set ff=dos|f $@|wq" $(*B).in
81
82# For each input file dostmp/test99.in run the tests.
83# This moves test99.in to test99.in.bak temporarily.
84$(TEST_OUTFILES): $(DOSTMP)\$(*B).in
85 -@if exist test.out DEL test.out
86 move $(*B).in $(*B).in.bak
Bram Moolenaar13cf77b2015-02-27 21:11:02 +010087 copy $(DOSTMP)\$(*B).in $(*B).in
88 copy $(*B).ok test.ok
89 $(VIMPROG) -u dos.vim -U NONE --noplugin -s dotest.in $(*B).in
90 -@if exist test.out MOVE /y test.out $(DOSTMP)\$(*B).out
91 -@if exist $(*B).in.bak move /y $(*B).in.bak $(*B).in
92 -@del X*
93 -@if exist test.ok del test.ok
94 -@if exist Xdir1 rd /s /q Xdir1
95 -@if exist Xfind rd /s /q Xfind
96 -@if exist viminfo del viminfo
97 $(VIMPROG) -u dos.vim --noplugin "+set ff=unix|f test.out|wq" \
98 $(DOSTMP)\$(*B).out
99 @diff test.out $*.ok & if errorlevel 1 \
100 ( move /y test.out $*.failed \
101 & del $(DOSTMP)\$(*B).out \
102 & echo $* FAILED >> test.log ) \
103 else ( move /y test.out $*.out )
Bram Moolenaarb78b0b02005-01-02 11:32:29 +0000104
Bram Moolenaar6949eea2013-06-16 16:57:46 +0200105report:
106 @echo ""
107 @echo Test results:
Bram Moolenaar13cf77b2015-02-27 21:11:02 +0100108 @if exist test.log ( type test.log & echo TEST FAILURE & exit /b 1 ) \
109 else ( echo ALL DONE )
Bram Moolenaar6949eea2013-06-16 16:57:46 +0200110
Bram Moolenaar071d4272004-06-13 20:20:40 +0000111clean:
112 -del *.out
Bram Moolenaar555d2a82013-06-17 21:53:37 +0200113 -del *.failed
Bram Moolenaar13cf77b2015-02-27 21:11:02 +0100114 -if exist $(DOSTMP) rd /s /q $(DOSTMP)
115 -if exist test.in del test.in
Bram Moolenaar9c039782007-08-14 15:55:42 +0000116 -if exist test.ok del test.ok
117 -if exist small.vim del small.vim
118 -if exist tiny.vim del tiny.vim
119 -if exist mbyte.vim del mbyte.vim
Bram Moolenaar2498b3a2010-03-02 17:59:44 +0100120 -if exist mzscheme.vim del mzscheme.vim
Bram Moolenaarb35c3382012-10-06 19:10:35 +0200121 -if exist lua.vim del lua.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000122 -del X*
Bram Moolenaar555d2a82013-06-17 21:53:37 +0200123 -if exist Xdir1 rd /s /q Xdir1
124 -if exist Xfind rd /s /q Xfind
Bram Moolenaar9c039782007-08-14 15:55:42 +0000125 -if exist viminfo del viminfo
Bram Moolenaar13cf77b2015-02-27 21:11:02 +0100126 -if exist test.log del test.log
Bram Moolenaar9c7d98d2014-11-05 15:46:09 +0100127 -if exist benchmark.out del benchmark.out
Bram Moolenaar071d4272004-06-13 20:20:40 +0000128
Bram Moolenaar6949eea2013-06-16 16:57:46 +0200129nolog:
Bram Moolenaar13cf77b2015-02-27 21:11:02 +0100130 -if exist test.log del test.log
Bram Moolenaarfda37292014-11-05 14:27:36 +0100131
132benchmark:
133 bench_re_freeze.out
134
135bench_re_freeze.out: bench_re_freeze.vim
136 -if exist benchmark.out del benchmark.out
137 $(VIMPROG) -u dos.vim -U NONE --noplugin $*.in
138 @IF EXIST benchmark.out ( type benchmark.out )