Hi list.

When using vim's mercurial repository on Windows,
executing tests has some problems and is very very very stressfull.

  * converting 'ff' of *.ok and *.in causes messy status for hg.
  * executing single test is failed often,
    because of forgetting convert 'ff'.
  * debugging and modifing tests are not easy.  too many steps are
    required.

To resolve these problems, I have changed most part of
src/testdir/Make_dos.mak.  What are changed:

  * Place converted files into temporary directory (dostmp).
  * Set dependencies between input, temporary and output files.
  * Use upper case letters for commands which derived from DOS.

As a result of these changes, we can execute tests very easily.

  $ nmake -f Make_dos.mak win32
  $ nmake -f Make_dos.mak test87.out
  $ hg status
  (nothing changed, when test was succeeded)

Please check an attached patch.


Best.

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


# HG changeset patch
# Parent 0d4e0cde36e15e6cc585b839fe1685e7030d129e

diff -r 0d4e0cde36e1 .hgignore
--- a/.hgignore	Fri Jul 05 21:01:22 2013 +0200
+++ b/.hgignore	Sat Jul 06 12:29:02 2013 +0900
@@ -58,4 +58,6 @@
 src/testdir/small.vim 
 src/testdir/tiny.vim 
 src/testdir/test*.out
+src/testdir/test*.failed
 src/testdir/test.log
+src/testdir/dostmp/*
diff -r 0d4e0cde36e1 src/testdir/Make_dos.mak
--- a/src/testdir/Make_dos.mak	Fri Jul 05 21:01:22 2013 +0200
+++ b/src/testdir/Make_dos.mak	Sat Jul 06 12:29:02 2013 +0900
@@ -36,17 +36,53 @@
 
 SCRIPTS32 =	test50.out test70.out
 
-SCRIPTS_GUI = test16.out
+SCRIPTS_GUI =	test16.out
+
+TEST_OUTFILES = $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS32) $(SCRIPTS_GUI)
+DOSTMP = dostmp
+DOSTMP_OUTFILES = $(TEST_OUTFILES:test=dostmp\test)
+DOSTMP_INFILES = $(DOSTMP_OUTFILES:.out=.in)
 
 .SUFFIXES: .in .out
 
-nongui:	fixff $(SCRIPTS16) $(SCRIPTS) report
+nongui:	nolog $(SCRIPTS16) $(SCRIPTS) report
 
-small:	report
+small:	nolog report
 
-gui:	fixff $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS_GUI) report
+gui:	nolog $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS_GUI) report
 
-win32:	fixff $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS32) report
+win32:	nolog $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS32) report
+
+$(DOSTMP_INFILES): $(*B).in
+	IF NOT EXIST $(DOSTMP)\NUL MD $(DOSTMP)
+	IF EXIST $@ DEL $@
+	$(VIMPROG) -u dos.vim --noplugin "+set ff=dos|f $@|wq" $(*B).in
+
+$(DOSTMP_OUTFILES): $*.in
+	-@IF EXIST test.out DEL test.out
+	MOVE $(*B).in $(*B).in.bak
+	COPY $*.in $(*B).in
+	COPY $(*B).ok test.ok
+	$(VIMPROG) -u dos.vim -U NONE --noplugin -s dotest.in $(*B).in
+	-@IF EXIST test.out MOVE /y test.out $@
+	-@IF EXIST $(*B).in.bak \
+		( DEL $(*B).in & MOVE $(*B).in.bak $(*B).in )
+	-@IF EXIST test.in DEL test.in
+	-@IF EXIST X* DEL X*
+	-@IF EXIST test.ok DEL test.ok
+	-@IF EXIST Xdir1 RD /s /q Xdir1
+	-@IF EXIST Xfind RD /s /q Xfind
+	-@IF EXIST viminfo DEL viminfo
+
+$(TEST_OUTFILES): $(DOSTMP)\$(*B).out
+	IF EXIST test.out DEL test.out
+	$(VIMPROG) -u dos.vim --noplugin "+set ff=unix|f test.out|wq" \
+		$(DOSTMP)\$(*B).out
+	@diff test.out $*.ok & IF ERRORLEVEL 1 \
+		( MOVE /y test.out $*.failed \
+		 & DEL $(DOSTMP)\$(*B).out \
+		 & ECHO $* FAILED >> test.log ) \
+		ELSE ( MOVE /y test.out $*.out )
 
 fixff:
 	-$(VIMPROG) -u dos.vim --noplugin "+argdo set ff=dos|upd" +q *.in *.ok
@@ -54,38 +90,27 @@
 		dotest.in test60.ok test71.ok test74.ok
 
 report:
-	@echo ""
-	@echo Test results:
-	@IF EXIST test.log ( type test.log & echo TEST FAILURE & exit /b 1 ) \
+	@ECHO ""
+	@ECHO Test results:
+	@IF EXIST test.log ( TYPE test.log & ECHO TEST FAILURE & EXIT /b 1 ) \
 		ELSE ( ECHO ALL DONE )
 
 clean:
-	-del *.out
-	-del *.failed
-	-if exist test.ok del test.ok
-	-if exist small.vim del small.vim
-	-if exist tiny.vim del tiny.vim
-	-if exist mbyte.vim del mbyte.vim
-	-if exist mzscheme.vim del mzscheme.vim
-	-if exist lua.vim del lua.vim
-	-del X*
-	-if exist Xdir1 rd /s /q Xdir1
-	-if exist Xfind rd /s /q Xfind
-	-if exist viminfo del viminfo
-	-del test.log
-
-.in.out:
-	-if exist $*.failed del $*.failed
-	copy $*.ok test.ok
-	$(VIMPROG) -u dos.vim -U NONE --noplugin -s dotest.in $*.in
-	@diff test.out $*.ok & if errorlevel 1 \
-		( move /y test.out $*.failed & echo $* FAILED >> test.log ) \
-		else ( move /y test.out $*.out )
-	-del X*
-	-del test.ok
-	-if exist Xdir1 rd /s /q Xdir1
-	-if exist Xfind rd /s /q Xfind
-	-if exist viminfo del viminfo
+	-IF EXIST *.out DEL *.out
+	-IF EXIST *.failed DEL *.failed
+	-IF EXIST $(DOSTMP) RD /s /q $(DOSTMP)
+	-IF EXIST test.in DEL test.in
+	-IF EXIST test.ok DEL test.ok
+	-IF EXIST test.log DEL test.log
+	-IF EXIST small.vim DEL small.vim
+	-IF EXIST tiny.vim DEL tiny.vim
+	-IF EXIST mbyte.vim DEL mbyte.vim
+	-IF EXIST mzscheme.vim DEL mzscheme.vim
+	-IF EXIST lua.vim DEL lua.vim
+	-IF EXIST X* DEL X*
+	-IF EXIST Xdir1 RD /s /q Xdir1
+	-IF EXIST Xfind RD /s /q Xfind
+	-IF EXIST viminfo DEL viminfo
 
 nolog:
-	-del test.log
+	-DEL test.log

Raspunde prin e-mail lui