@@ -56,32 +56,64 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
5656
5757SCRIPTS32 = test50.out test70.out
5858
59- SCRIPTS_GUI = test16.out
59+ SCRIPTS_GUI = test16.out
6060
61- .SUFFIXES : .in .out
62-
63- nongui : fixff $(SCRIPTS16 ) $(SCRIPTS ) report
64-
65- small : report
66-
67- gui : fixff $(SCRIPTS16 ) $(SCRIPTS ) $(SCRIPTS_GUI ) report
61+ TEST_OUTFILES = $(SCRIPTS16 ) $(SCRIPTS ) $(SCRIPTS32 ) $(SCRIPTS_GUI )
62+ DOSTMP = dostmp
63+ DOSTMP_OUTFILES = $(TEST_OUTFILES:test=dostmp\test )
64+ DOSTMP_INFILES = $(DOSTMP_OUTFILES:.out=.in )
6865
69- win32 : fixff $( SCRIPTS16 ) $( SCRIPTS ) $( SCRIPTS32 ) report
66+ .SUFFIXES : .in .out
7067
71- fixff :
72- -$(VIMPROG ) -u dos.vim --noplugin " +argdo set ff=dos|upd" +q * .in * .ok
73- -$(VIMPROG ) -u dos.vim --noplugin " +argdo set ff=unix|upd" +q \
74- dotest.in test60.ok test71.ok test74.ok test100.ok
68+ nongui : nolog $(SCRIPTS16 ) $(SCRIPTS ) report
69+
70+ small : nolog report
71+
72+ gui : nolog $(SCRIPTS16 ) $(SCRIPTS ) $(SCRIPTS_GUI ) report
73+
74+ win32 : nolog $(SCRIPTS16 ) $(SCRIPTS ) $(SCRIPTS32 ) report
75+
76+ # Copy the input files to dostmp, changing the fileformat to dos.
77+ $(DOSTMP_INFILES ) : $(*B ) .in
78+ if not exist $( DOSTMP) \N UL 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
87+ copy $* .in $(*B ) .in
88+ copy $(DOSTMP ) \$ (* B).in $(*B ) .in
89+ copy $(*B ) .ok test.ok
90+ $(VIMPROG ) -u dos.vim -U NONE --noplugin -s dotest.in $(*B ) .in
91+ -@if exist test.out MOVE /y test.out $(DOSTMP ) \$ (* B).out
92+ -@if exist $(*B ) .in.bak move /y $(*B ) .in.bak $(*B ) .in
93+ -@del X*
94+ -@if exist test.ok del test.ok
95+ -@if exist Xdir1 rd /s /q Xdir1
96+ -@if exist Xfind rd /s /q Xfind
97+ -@if exist viminfo del viminfo
98+ $(VIMPROG ) -u dos.vim --noplugin " +set ff=unix|f test.out|wq" \
99+ $(DOSTMP ) \$ (* B).out
100+ @diff test.out $* .ok & if errorlevel 1 \
101+ ( move /y test.out $* .failed \
102+ & del $(DOSTMP ) \$ (* B).out \
103+ & echo $* FAILED >> test.log ) \
104+ else ( move /y test.out $* .out )
75105
76106report :
77107 @echo " "
78108 @echo Test results:
79- @IF EXIST test.log ( type test.log & echo TEST FAILURE & exit /b 1 ) \
80- ELSE ( ECHO ALL DONE )
109+ @if exist test.log ( type test.log & echo TEST FAILURE & exit /b 1 ) \
110+ else ( echo ALL DONE )
81111
82112clean :
83113 -del * .out
84114 -del * .failed
115+ -if exist $(DOSTMP ) rd /s /q $(DOSTMP )
116+ -if exist test.in del test.in
85117 -if exist test.ok del test.ok
86118 -if exist small.vim del small.vim
87119 -if exist tiny.vim del tiny.vim
@@ -92,24 +124,11 @@ clean:
92124 -if exist Xdir1 rd /s /q Xdir1
93125 -if exist Xfind rd /s /q Xfind
94126 -if exist viminfo del viminfo
95- -del test.log
127+ -if exist test.log del test.log
96128 -if exist benchmark.out del benchmark.out
97129
98- .in.out :
99- -if exist $* .failed del $* .failed
100- copy $* .ok test.ok
101- $(VIMPROG ) -u dos.vim -U NONE --noplugin -s dotest.in $* .in
102- @diff test.out $* .ok & if errorlevel 1 \
103- ( move /y test.out $* .failed & echo $* FAILED >> test.log ) \
104- else ( move /y test.out $* .out )
105- -del X*
106- -del test.ok
107- -if exist Xdir1 rd /s /q Xdir1
108- -if exist Xfind rd /s /q Xfind
109- -if exist viminfo del viminfo
110-
111130nolog :
112- -del test.log
131+ -if exist test.log del test.log
113132
114133benchmark :
115134 bench_re_freeze.out
0 commit comments