patch 7.4.991
Problem: When running new style tests the output is not visible.
Solution: Add the testdir/messages file and show it. Update the list of
test names.
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
index b587f32..6cc928c 100644
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -55,7 +55,7 @@
RUN_VIM = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(VALGRIND) $(VIMPROG) -f -u unix.vim -U NONE --noplugin -s dotest.in
clean:
- -rm -rf *.out *.failed *.res *.rej *.orig test.log $(RM_ON_RUN) $(RM_ON_START) valgrind.*
+ -rm -rf *.out *.failed *.res *.rej *.orig test.log messages $(RM_ON_RUN) $(RM_ON_START) valgrind.*
test1.out: test1.in
-rm -rf $*.failed $(RM_ON_RUN) $(RM_ON_START) wrongtermsize
@@ -112,7 +112,7 @@
@/bin/sh -c "if test -f benchmark.out; then cat benchmark.out; fi"
nolog:
- -rm -f test.log
+ -rm -f test.log messages
# New style of tests uses Vim script with assert calls. These are easier
@@ -123,4 +123,4 @@
newtests: $(NEW_TESTS)
.vim.res:
- $(RUN_VIMTEST) -S runtest.vim $*.vim
+ $(RUN_VIMTEST) -u NONE -S runtest.vim $*.vim
diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim
index cca7c75..8314a45 100644
--- a/src/testdir/runtest.vim
+++ b/src/testdir/runtest.vim
@@ -39,6 +39,7 @@
let done = 0
let fail = 0
let errors = []
+let messages = []
try
source %
catch
@@ -57,6 +58,7 @@
call SetUp()
endif
+ call add(messages, 'Executing ' . test)
let done += 1
try
exe 'call ' . test
@@ -92,9 +94,20 @@
write
endif
-echo 'Executed ' . done . (done > 1 ? ' tests': ' test')
+let message = 'Executed ' . done . (done > 1 ? ' tests': ' test')
+echo message
+call add(messages, message)
if fail > 0
- echo fail . ' FAILED'
+ let message = fail . ' FAILED'
+ echo message
+ call add(messages, message)
endif
+" Append messages to "messages"
+split messages
+call append(line('$'), '')
+call append(line('$'), 'From ' . testname . ':')
+call append(line('$'), messages)
+write
+
qall!