xref: /vim-8.2.3635/src/testdir/Make_dos.mak (revision 2bf24176)
1#
2# Makefile to run all tests for Vim, on Dos-like machines.
3#
4# Requires a set of Unix tools: echo, diff, etc.
5
6VIMPROG = ..\\vim
7
8default: nongui
9
10!include Make_all.mak
11
12# Omitted:
13# test2		"\\tmp" doesn't work.
14# test10	'errorformat' is different
15# test12	can't unlink a swap file
16# test25	uses symbolic link
17# test27	can't edit file with "*" in file name
18# test49	fails in various ways
19# test97	\{ and \$ are not escaped characters.
20
21SCRIPTS = $(SCRIPTS_ALL) $(SCRIPTS_MORE1) $(SCRIPTS_MORE3) $(SCRIPTS_MORE4)
22
23TEST_OUTFILES = $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_WIN32) $(SCRIPTS_GUI)
24DOSTMP = dostmp
25DOSTMP_OUTFILES = $(TEST_OUTFILES:test=dostmp\test)
26DOSTMP_INFILES = $(DOSTMP_OUTFILES:.out=.in)
27
28.SUFFIXES: .in .out .res .vim
29
30nongui:	nolog $(SCRIPTS_FIRST) $(SCRIPTS) newtests report
31
32small:	nolog report
33
34gui:	nolog $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_GUI) newtests report
35
36win32:	nolog $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_WIN32) newtests report
37
38# Copy the input files to dostmp, changing the fileformat to dos.
39$(DOSTMP_INFILES): $(*B).in
40	if not exist $(DOSTMP)\NUL md $(DOSTMP)
41	if exist $@ del $@
42	$(VIMPROG) -u dos.vim --noplugin "+set ff=dos|f $@|wq" $(*B).in
43
44# For each input file dostmp/test99.in run the tests.
45# This moves test99.in to test99.in.bak temporarily.
46$(TEST_OUTFILES): $(DOSTMP)\$(*B).in
47	-@if exist test.out DEL test.out
48	move $(*B).in $(*B).in.bak
49	copy $(DOSTMP)\$(*B).in $(*B).in
50	copy $(*B).ok test.ok
51	$(VIMPROG) -u dos.vim -U NONE --noplugin -s dotest.in $(*B).in
52	-@if exist test.out MOVE /y test.out $(DOSTMP)\$(*B).out
53	-@if exist $(*B).in.bak move /y $(*B).in.bak $(*B).in
54	-@del X*
55	-@if exist test.ok del test.ok
56	-@if exist Xdir1 rd /s /q Xdir1
57	-@if exist Xfind rd /s /q Xfind
58	-@if exist viminfo del viminfo
59	$(VIMPROG) -u dos.vim --noplugin "+set ff=unix|f test.out|wq" \
60		$(DOSTMP)\$(*B).out
61	@diff test.out $*.ok & if errorlevel 1 \
62		( move /y test.out $*.failed \
63		 & del $(DOSTMP)\$(*B).out \
64		 & echo $* FAILED >> test.log ) \
65		else ( move /y test.out $*.out )
66
67# Must run test1 first to create small.vim.
68# This rule must come after the one that copies the input files to dostmp to
69# allow for running an individual test.
70$(SCRIPTS) $(SCRIPTS_GUI) $(SCRIPTS_WIN32) $(NEW_TESTS): $(SCRIPTS_FIRST)
71
72report:
73	@echo ""
74	@echo Test results:
75	@if exist test.log ( type test.log & echo TEST FAILURE & exit /b 1 ) \
76		else ( echo ALL DONE )
77
78clean:
79	-del *.out
80	-del *.failed
81	-del *.res
82	-if exist $(DOSTMP) rd /s /q $(DOSTMP)
83	-if exist test.in del test.in
84	-if exist test.ok del test.ok
85	-if exist small.vim del small.vim
86	-if exist tiny.vim del tiny.vim
87	-if exist mbyte.vim del mbyte.vim
88	-if exist mzscheme.vim del mzscheme.vim
89	-if exist lua.vim del lua.vim
90	-del X*
91	-if exist Xdir1 rd /s /q Xdir1
92	-if exist Xfind rd /s /q Xfind
93	-if exist viminfo del viminfo
94	-if exist test.log del test.log
95	-if exist messages del messages
96	-if exist benchmark.out del benchmark.out
97
98nolog:
99	-if exist test.log del test.log
100	-if exist messages del messages
101
102benchmark:
103	bench_re_freeze.out
104
105bench_re_freeze.out: bench_re_freeze.vim
106	-if exist benchmark.out del benchmark.out
107	$(VIMPROG) -u dos.vim -U NONE --noplugin $*.in
108	@IF EXIST benchmark.out ( type benchmark.out )
109
110# New style of tests uses Vim script with assert calls.  These are easier
111# to write and a lot easier to read and debug.
112# Limitation: Only works with the +eval feature.
113
114newtests: $(NEW_TESTS)
115
116.vim.res:
117	$(VIMPROG) -u NONE -S runtest.vim $*.vim
118