On 12/4/2015 5:27 PM, Bram Moolenaar wrote:
Michael Soyka wrote:
On 12/3/2015 4:13 PM, Bram Moolenaar wrote:
I have added "new style" testing for Unix. It appears to work well, so
now we also need this for other platforms. The Unix Makefile only
needed a few extra lines, hopefully it's also simple for others.
I would prefer someone who knows the platform to make a patch for this.
We need this for:
src/testdir/Make_dos.mak
src/testdir/Make_ming.mak
And if someone still has one of these systems:
src/testdir/Make_amiga.mak
src/testdir/Make_os2.mak
src/testdir/Make_vms.mms
Bram,
Since I've been dabbling in things ming lately, I'm willing to give it
shot. What information do I need?
Look in src/testdir/Makefile for how "newtests" is defined.
I assume that the MingW make works pretty much like the Unix one.
Bram,
I've updated the mingw makefile using your changes to the unix makefile
as a guide. I've attached the complete modified file and show the diffs
below.
I ran the newtests using gvim and both tests passed. However, a popup
window with an OK button is displayed at the conclusion of each test.
This happens whether the test passes or fails. The tester must press
the OK button to continue to the next test. Is this desirable? By the
way, the popup looks like one put up by the confirm function.
Because of the popups, I've added an if-test at the end of the makefile
to display the test status in the terminal window.
I added the "newtests" targets to all the test targets in the makefile-
gui, nongui, and the others. In effect, I've made the assumption that
the new tests will never be intended for gvim testing exclusively. If
this is not correct, changes are in order.
Just to be clear, I'm using mingw under Windows.
Thanks for the opportunity to help,
Mike
==========================================================
diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak
index a7c98ee..f9a5965 100644
--- a/src/testdir/Make_ming.mak
+++ b/src/testdir/Make_ming.mak
@@ -23,6 +23,13 @@ DIRSLASH = \\
endif
VIMPROG = ..$(DIRSLASH)vim
+SCRIPTSOURCE = ../../runtime
+
+# Uncomment this line to use valgrind for memory leaks and extra warnings.
+# The output goes into a file "valgrind.testN"
+# Vim should be compiled with EXITFREE to avoid false warnings.
+# This will make testing about 10 times as slow.
+# VALGRIND = valgrind --tool=memcheck --leak-check=yes --num-callers=15
--log-file=valgrind.$*
# Omitted:
# test2 "\\tmp" doesn't work.
@@ -94,16 +101,19 @@ SCRIPTS = test3.out test4.out test5.out test6.out
test7.out \
SCRIPTS32 = test50.out test70.out
+NEW_TESTS = test_assert.res \
+ test_alot.res
+
SCRIPTS_GUI = test16.out
SCRIPTS_BENCH = bench_re_freeze.out
-.SUFFIXES: .in .out
+.SUFFIXES: .in .out .res .vim
-vimall: fixff $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS_GUI) $(SCRIPTS32)
+vimall: fixff $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS_GUI)
$(SCRIPTS32) newtests
echo ALL DONE
-nongui: fixff $(SCRIPTS16) $(SCRIPTS)
+nongui: fixff $(SCRIPTS16) $(SCRIPTS) newtests
echo ALL DONE
benchmark: $(SCRIPTS_BENCH)
@@ -111,10 +121,10 @@ benchmark: $(SCRIPTS_BENCH)
small:
echo ALL DONE
-gui: fixff $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS_GUI)
+gui: fixff $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS_GUI) newtests
echo ALL DONE
-win32: fixff $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS32)
+win32: fixff $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS32) newtests
echo ALL DONE
fixff:
@@ -132,6 +142,8 @@ clean:
-$(DEL) lua.vim
-$(DEL) X*
-$(DEL) viminfo
+ -$(DEL) *.res
+ -$(DEL) test.log
.in.out:
$(CP) $*.ok test.ok
@@ -147,3 +159,19 @@ bench_re_freeze.out: bench_re_freeze.vim
-$(DEL) benchmark.out
$(VIMPROG) -u dos.vim -U NONE --noplugin $*.in
$(CAT) benchmark.out
+
+
+# New style of tests uses Vim script with assert calls. These are easier
+# to write and a lot easier to read and debug.
+# Limitation: Only works with the +eval feature.
+RUN_VIMTEST = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME;
$(VALGRIND) $(VIMPROG) -u dos.vim -U NONE --noplugin
+
+newtests: $(NEW_TESTS)
+
+.vim.res:
+ $(RUN_VIMTEST) -u runtest.vim $*.vim
+ @if [ ! -f $*.res ]; then \
+ echo "Test $* failed."; \
+ else \
+ echo "Test $* passed."; \
+ fi
--
--
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/d/optout.
#
# Makefile to run all tests for Vim, on Dos-like machines
# with sh.exe or zsh.exe in the path or not.
#
# Author: Bill McCarthy
#
# Note that test54 has been removed until it is fixed.
#
# Requires a set of Unix tools: echo, diff, etc.
ifneq (sh.exe, $(SHELL))
DEL = rm -f
MV = mv
CP = cp
CAT = cat
DIRSLASH = /
else
DEL = del
MV = rename
CP = copy
CAT = type
DIRSLASH = \\
endif
VIMPROG = ..$(DIRSLASH)vim
SCRIPTSOURCE = ../../runtime
# Uncomment this line to use valgrind for memory leaks and extra warnings.
# The output goes into a file "valgrind.testN"
# Vim should be compiled with EXITFREE to avoid false warnings.
# This will make testing about 10 times as slow.
# VALGRIND = valgrind --tool=memcheck --leak-check=yes --num-callers=15
--log-file=valgrind.$*
# Omitted:
# test2 "\\tmp" doesn't work.
# test10 'errorformat' is different
# test12 can't unlink a swap file
# test25 uses symbolic link
# test27 can't edit file with "*" in file name
# test97 \{ and \$ are not escaped characters.
SCRIPTS16 = test1.out test19.out test20.out test22.out \
test23.out test24.out test28.out test29.out \
test35.out test36.out test43.out \
test44.out test45.out test46.out test47.out \
test48.out test51.out test53.out \
test55.out test56.out test57.out test58.out test59.out \
test60.out test61.out test62.out test63.out test64.out
# Had to remove test54 which doesn't work yet.
# test54.out
SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test8.out test9.out test11.out test13.out test14.out \
test15.out test17.out test18.out test21.out test26.out \
test30.out test31.out test32.out test33.out test34.out \
test37.out test38.out test39.out test40.out test41.out \
test42.out test52.out test65.out test66.out test67.out \
test68.out test69.out test71.out test72.out test73.out \
test74.out test75.out test76.out test77.out test78.out \
test79.out test80.out test81.out test82.out test83.out \
test84.out test85.out test86.out test87.out test88.out \
test89.out test90.out test91.out test92.out test93.out \
test94.out test95.out test96.out test98.out test99.out \
test101.out test102.out test103.out test104.out \
test105.out test106.out test107.out \
test_argument_0count.out \
test_argument_count.out \
test_autocmd_option.out \
test_autoformat_join.out \
test_breakindent.out \
test_cdo.out \
test_changelist.out \
test_charsearch.out \
test_close_count.out \
test_command_count.out \
test_comparators.out \
test_erasebackword.out \
test_eval.out \
test_fixeol.out \
test_increment.out \
test_insertcount.out \
test_listchars.out \
test_listlbr.out \
test_listlbr_utf8.out \
test_mapping.out \
test_marks.out \
test_match_conceal.out \
test_nested_function.out \
test_options.out \
test_perl.out \
test_qf_title.out \
test_ruby.out \
test_search_mbyte.out \
test_set.out \
test_signs.out \
test_tagcase.out \
test_textobjects.out \
test_utf8.out \
test_writefile.out
SCRIPTS32 = test50.out test70.out
NEW_TESTS = test_assert.res \
test_alot.res
SCRIPTS_GUI = test16.out
SCRIPTS_BENCH = bench_re_freeze.out
.SUFFIXES: .in .out .res .vim
vimall: fixff $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS_GUI) $(SCRIPTS32) newtests
echo ALL DONE
nongui: fixff $(SCRIPTS16) $(SCRIPTS) newtests
echo ALL DONE
benchmark: $(SCRIPTS_BENCH)
small:
echo ALL DONE
gui: fixff $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS_GUI) newtests
echo ALL DONE
win32: fixff $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS32) newtests
echo ALL DONE
fixff:
-$(VIMPROG) -u dos.vim --noplugin "+argdo set ff=dos|upd" +q *.in *.ok
-$(VIMPROG) -u dos.vim --noplugin "+argdo set ff=unix|upd" +q \
dotest.in test60.ok test71.ok test74.ok test_listchars.ok
clean:
-$(DEL) *.out
-$(DEL) test.ok
-$(DEL) small.vim
-$(DEL) tiny.vim
-$(DEL) mbyte.vim
-$(DEL) mzscheme.vim
-$(DEL) lua.vim
-$(DEL) X*
-$(DEL) viminfo
-$(DEL) *.res
-$(DEL) test.log
.in.out:
$(CP) $*.ok test.ok
$(VIMPROG) -u dos.vim -U NONE --noplugin -s dotest.in $*.in
diff test.out $*.ok
-$(DEL) $*.out
$(MV) test.out $*.out
-$(DEL) X*
-$(DEL) test.ok
-$(DEL) viminfo
bench_re_freeze.out: bench_re_freeze.vim
-$(DEL) benchmark.out
$(VIMPROG) -u dos.vim -U NONE --noplugin $*.in
$(CAT) benchmark.out
# New style of tests uses Vim script with assert calls. These are easier
# to write and a lot easier to read and debug.
# Limitation: Only works with the +eval feature.
RUN_VIMTEST = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(VALGRIND)
$(VIMPROG) -u dos.vim -U NONE --noplugin
newtests: $(NEW_TESTS)
.vim.res:
$(RUN_VIMTEST) -u runtest.vim $*.vim
@if [ ! -f $*.res ]; then \
echo "Test $* failed."; \
else \
echo "Test $* passed."; \
fi