@@ -47,12 +47,16 @@ report:
4747
4848$(SCRIPTS ) $(SCRIPTS_GUI ) : $(VIMPROG )
4949
50+ RM_ON_RUN = test.out X* viminfo
51+ RM_ON_START = tiny.vim small.vim mbyte.vim mzscheme.vim lua.vim test.ok
52+ RUN_VIM = $(VALGRIND ) $(VIMPROG ) -u unix.vim -U NONE --noplugin -s dotest.in
53+
5054clean :
51- -rm -rf * .out * .failed * .rej * .orig test.log tiny.vim small.vim mbyte.vim mzscheme.vim lua.vim test.ok X * valgrind.* viminfo
55+ -rm -rf * .out * .failed * .rej * .orig test.log $( RM_ON_RUN ) $( RM_ON_START ) valgrind.*
5256
5357test1.out : test1.in
54- -rm -f $* .failed tiny.vim small.vim mbyte.vim mzscheme.vim lua.vim test.ok X * viminfo
55- $(VALGRIND ) $( VIMPROG ) -u unix.vim -U NONE --noplugin -s dotest.in $* .in
58+ -rm -rf $* .failed $( RM_ON_RUN ) $( RM_ON_START )
59+ $(RUN_VIM ) $* .in
5660 @/bin/sh -c " if diff test.out $* .ok; \
5761 then mv -f test.out $* .out; \
5862 else echo ; \
@@ -61,11 +65,22 @@ test1.out: test1.in
6165 -rm -rf X* viminfo
6266
6367.in.out :
64- -rm -rf $* .failed test.ok test.out X * viminfo
68+ -rm -rf $* .failed test.ok $( RM_ON_RUN )
6569 cp $* .ok test.ok
6670 # Sleep a moment to avoid that the xterm title is messed up
6771 @-sleep .2
68- -$(VALGRIND ) $(VIMPROG ) -u unix.vim -U NONE --noplugin -s dotest.in $* .in
72+ -$(RUN_VIM ) $* .in
73+
74+ # For flaky tests retry one time.
75+ @/bin/sh -c "if test -f test.out -a $* = test61; then \
76+ if diff test.out $*.ok; \
77+ then echo flaky test ok first time; \
78+ else rm -rf $*.failed $(RM_ON_RUN); \
79+ $(RUN_VIM) $*.in; \
80+ fi \
81+ fi"
82+
83+ # Check if the test.out file matches test.ok.
6984 @/bin/sh -c "if test -f test.out; then\
7085 if diff test.out $*.ok; \
7186 then mv -f test.out $*.out; \
0 commit comments