@@ -9,56 +9,23 @@ default: nongui
99
1010!include Make_all.mak
1111
12- TEST_OUTFILES = $(SCRIPTS_FIRST )
12+ # Explicit dependencies.
13+ test_options.res test_alot.res : opt_test.vim
14+
15+ TEST_OUTFILES = $(SCRIPTS_TINY_OUT )
1316DOSTMP = dostmp
1417DOSTMP_OUTFILES = $(TEST_OUTFILES:test=dostmp\test )
1518DOSTMP_INFILES = $(DOSTMP_OUTFILES:.out=.in )
1619
1720.SUFFIXES : .in .out .res .vim
1821
19- nongui : nolog $( SCRIPTS_FIRST ) newtests report
22+ nongui : nolog tinytests newtests report
2023
21- small : nolog report
24+ gui : nolog tinytests newtests report
2225
23- gui : nolog $( SCRIPTS_FIRST ) newtests report
26+ tiny : nolog tinytests report
2427
25- win32 : nolog $(SCRIPTS_FIRST ) newtests report
26-
27- # Copy the input files to dostmp, changing the fileformat to dos.
28- $(DOSTMP_INFILES ) : $(*B ) .in
29- if not exist $( DOSTMP) \N UL md $( DOSTMP)
30- if exist $@ del $@
31- $(VIMPROG ) -u dos.vim $(NO_INITS ) " +set ff=dos|f $@ |wq" $(*B ) .in
32-
33- # For each input file dostmp/test99.in run the tests.
34- # This moves test99.in to test99.in.bak temporarily.
35- $(TEST_OUTFILES ) : $(DOSTMP ) \$(*B ) .in
36- -@if exist test.out DEL test.out
37- -@if exist $(DOSTMP ) \$ (* B).out DEL $(DOSTMP ) \$ (* B).out
38- move $(*B ) .in $(*B ) .in.bak > nul
39- copy $(DOSTMP ) \$ (* B).in $(*B ) .in > nul
40- copy $(*B ) .ok test.ok > nul
41- $(VIMPROG ) -u dos.vim $(NO_INITS ) -s dotest.in $(*B ) .in
42- -@if exist test.out MOVE /y test.out $(DOSTMP ) \$ (* B).out > nul
43- -@if exist $(*B ) .in.bak move /y $(*B ) .in.bak $(*B ) .in > nul
44- -@if exist test.ok del test.ok
45- -@if exist Xdir1 rd /s /q Xdir1
46- -@if exist Xfind rd /s /q Xfind
47- -@if exist XfakeHOME rd /s /q XfakeHOME
48- -@del X*
49- -@if exist viminfo del viminfo
50- $(VIMPROG ) -u dos.vim $(NO_INITS ) " +set ff=unix|f test.out|wq" \
51- $(DOSTMP ) \$ (* B).out
52- @diff test.out $* .ok & if errorlevel 1 \
53- ( move /y test.out $* .failed > nul \
54- & del $(DOSTMP ) \$ (* B).out \
55- & echo $* FAILED >> test.log ) \
56- else ( move /y test.out $* .out > nul )
57-
58- # Must run test1 first to create small.vim.
59- # This rule must come after the one that copies the input files to dostmp to
60- # allow for running an individual test.
61- $(SCRIPTS ) $(SCRIPTS_GUI ) $(SCRIPTS_WIN32 ) $(NEW_TESTS_RES ) : $(SCRIPTS_FIRST )
28+ benchmark : $(SCRIPTS_BENCH )
6229
6330report :
6431 @rem without the +eval feature test_result.log is a copy of test.log
@@ -71,10 +38,24 @@ report:
7138 @if exist test.log ( echo TEST FAILURE & exit /b 1 ) \
7239 else ( echo ALL DONE )
7340
41+
42+ # Execute an individual new style test, e.g.:
43+ # nmake -f Make_dos.mak test_largefile
44+ $(NEW_TESTS ) :
45+ -if exist $@ .res del $@ .res
46+ -if exist test.log del test.log
47+ -if exist messages del messages
48+ @$(MAKE ) -nologo -f Make_dos.mak $@ .res VIMPROG=$(VIMPROG )
49+ @type messages
50+ @if exist test.log exit 1
51+
52+
53+ # Delete files that may interfere with running tests. This includes some files
54+ # that may result from working on the tests, not only from running them.
7455clean :
75- -del * .out
76- -del * .failed
77- -del * .res
56+ -if exist * .out $( DEL ) * .out
57+ -if exist * .failed $( DEL ) * .failed
58+ -if exist * .res $( DEL ) * .res
7859 -if exist $(DOSTMP ) rd /s /q $(DOSTMP )
7960 -if exist test.in del test.in
8061 -if exist test.ok del test.ok
8566 -if exist Xdir1 rd /s /q Xdir1
8667 -if exist Xfind rd /s /q Xfind
8768 -if exist XfakeHOME rd /s /q XfakeHOME
88- -del X*
89- -for /d %i in (X* ) do @rmdir /s/q %i
69+ -if exist X * $( DEL ) X*
70+ -for /d %i in (X* ) do @rd /s/q %i
9071 -if exist viminfo del viminfo
9172 -if exist test.log del test.log
9273 -if exist test_result.log del test_result.log
@@ -99,14 +80,41 @@ nolog:
9980 -if exist test_result.log del test_result.log
10081 -if exist messages del messages
10182
102- benchmark : test_bench_regexp.res
10383
104- test_bench_regexp.res : test_bench_regexp.vim
105- -if exist benchmark.out del benchmark.out
106- @echo $(VIMPROG ) > vimcmd
107- $(VIMPROG ) -u NONE $(NO_INITS ) -S runtest.vim $* .vim
108- @del vimcmd
109- @IF EXIST benchmark.out ( type benchmark.out )
84+ # Tiny tests. Works even without the +eval feature.
85+ tinytests : $(SCRIPTS_TINY_OUT )
86+
87+ # Copy the input files to dostmp, changing the fileformat to dos.
88+ $(DOSTMP_INFILES ) : $(*B ) .in
89+ if not exist $( DOSTMP) \N UL md $( DOSTMP)
90+ if exist $@ del $@
91+ $(VIMPROG ) -u dos.vim $(NO_INITS ) " +set ff=dos|f $@ |wq" $(*B ) .in
92+
93+ # For each input file dostmp/test99.in run the tests.
94+ # This moves test99.in to test99.in.bak temporarily.
95+ $(TEST_OUTFILES ) : $(DOSTMP ) \$(*B ) .in
96+ -@if exist test.out DEL test.out
97+ -@if exist $(DOSTMP ) \$ (* B).out DEL $(DOSTMP ) \$ (* B).out
98+ move $(*B ) .in $(*B ) .in.bak > nul
99+ copy $(DOSTMP ) \$ (* B).in $(*B ) .in > nul
100+ copy $(*B ) .ok test.ok > nul
101+ $(VIMPROG ) -u dos.vim $(NO_INITS ) -s dotest.in $(*B ) .in
102+ -@if exist test.out MOVE /y test.out $(DOSTMP ) \$ (* B).out > nul
103+ -@if exist $(*B ) .in.bak move /y $(*B ) .in.bak $(*B ) .in > nul
104+ -@if exist test.ok del test.ok
105+ -@if exist Xdir1 rd /s /q Xdir1
106+ -@if exist Xfind rd /s /q Xfind
107+ -@if exist XfakeHOME rd /s /q XfakeHOME
108+ -@del X*
109+ -@if exist viminfo del viminfo
110+ $(VIMPROG ) -u dos.vim $(NO_INITS ) " +set ff=unix|f test.out|wq" \
111+ $(DOSTMP ) \$ (* B).out
112+ @diff test.out $* .ok & if errorlevel 1 \
113+ ( move /y test.out $* .failed > nul \
114+ & del $(DOSTMP ) \$ (* B).out \
115+ & echo $* FAILED >> test.log ) \
116+ else ( move /y test.out $* .out > nul )
117+
110118
111119# New style of tests uses Vim script with assert calls. These are easier
112120# to write and a lot easier to read and debug.
@@ -132,7 +140,12 @@ test_gui_init.res: test_gui_init.vim
132140 $(VIMPROG ) -u gui_preinit.vim -U gui_init.vim $(NO_PLUGINS ) -S runtest.vim $* .vim
133141 @del vimcmd
134142
135- test_options.res test_alot.res : opt_test.vim
136-
137143opt_test.vim : ../optiondefs.h gen_opt_test.vim
138144 $(VIMPROG ) -u NONE -S gen_opt_test.vim --noplugin --not-a-term ../optiondefs.h
145+
146+ test_bench_regexp.res : test_bench_regexp.vim
147+ -if exist benchmark.out del benchmark.out
148+ @echo $(VIMPROG ) > vimcmd
149+ $(VIMPROG ) -u NONE $(NO_INITS ) -S runtest.vim $* .vim
150+ @del vimcmd
151+ @IF EXIST benchmark.out ( type benchmark.out )
0 commit comments