]> granicus.if.org Git - vim/commitdiff
patch 7.4.991 v7.4.991
authorBram Moolenaar <Bram@vim.org>
Tue, 29 Dec 2015 13:26:57 +0000 (14:26 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 29 Dec 2015 13:26:57 +0000 (14:26 +0100)
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.

src/Makefile
src/testdir/Makefile
src/testdir/runtest.vim
src/version.c

index 3f29d461f59c9997844fb3124bc044aa45a3b3b1..231b0367d9692859e3172d6cfa51812bce9ef976 100644 (file)
@@ -616,6 +616,27 @@ LINT_OPTIONS = -beprxzF
 #PROFILE_LIBS = -pg
 #PROFILE_LIBS = -pg -lc
 
+
+# TEST COVERAGE - Uncomment the two lines below the explanation to get code
+# coverage information. (provided by Yegappan Lakshmanan)
+# 1. make clean, run configure and build Vim as usual.
+# 2. Generate the baseline code coverage information:
+#        $ lcov -c -i -b . -d objects -o objects/coverage_base.info
+# 3. Run "make test" to run the unit tests.  The code coverage information will
+#    be generated in the src/objects directory.
+# 4. Generate the code coverage information from the tests:
+#        $ lcov -c -b . -d objects/ -o objects/coverage_test.info
+# 5. Combine the baseline and test code coverage data:
+#        $ lcov -a objects/coverage_base.info -a objects/coverage_test.info -o objects/coverage_total.info
+# 6. Process the test coverage data and generate a report in html:
+#        $ genhtml objects/coverage_total.info -o objects
+# 7. Open the objects/index.html file in a web browser to view the coverage
+#    information.
+#
+# PROFILE_CFLAGS=-g -O0 -fprofile-arcs -ftest-coverage
+# LDFLAGS=--coverage
+
+
 # Uncomment one of the next two lines to compile Vim with the
 # address sanitizer or with the undefined sanitizer.  Works with gcc and
 # clang.  May make Vim twice as slow.  Errors reported on stderr.
@@ -1905,7 +1926,6 @@ test1 \
        test_autocmd_option \
        test_autoformat_join \
        test_breakindent \
-       test_cdo \
        test_changelist \
        test_charsearch \
        test_close_count \
@@ -1948,13 +1968,17 @@ test1 \
        cd testdir; rm -f $@.out; $(MAKE) -f Makefile $@.out VIMPROG=../$(VIMTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE)
 
 test_assert \
+       test_cdo \
+       test_searchpos \
        test_sort \
        test_undolevels \
        test_alot:
-       cd testdir; rm -f $@.res; $(MAKE) -f Makefile $@.res VIMPROG=../$(VIMTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE)
+       cd testdir; rm -f $@.res test.log messages; $(MAKE) -f Makefile $@.res VIMPROG=../$(VIMTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE)
+       cat testdir/messages
 
 newtests:
-       cd testdir; rm -f $@.res; $(MAKE) -f Makefile newtests VIMPROG=../$(VIMTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE)
+       cd testdir; rm -f $@.res test.log messages; $(MAKE) -f Makefile newtests VIMPROG=../$(VIMTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE)
+       cat testdir/messages
 
 testclean:
        cd testdir; $(MAKE) -f Makefile clean
@@ -2674,7 +2698,7 @@ objects/if_lua.o: if_lua.c
 
 objects/if_mzsch.o: if_mzsch.c $(MZSCHEME_EXTRA)
        $(CCC) -o $@ $(MZSCHEME_CFLAGS_EXTRA) if_mzsch.c
+
 mzscheme_base.c:
        $(MZSCHEME_MZC) --c-mods mzscheme_base.c ++lib scheme/base
 
index b587f32e913faa66af144ac7781a20c849242314..6cc928c7f6b762d8695bef45bc67c24a15d8fb54 100644 (file)
@@ -55,7 +55,7 @@ RM_ON_START = tiny.vim small.vim mbyte.vim mzscheme.vim lua.vim test.ok benchmar
 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 @@ bench_re_freeze.out: bench_re_freeze.vim
        @/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 @@ RUN_VIMTEST = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(VALGRIND) $(VIMPR
 newtests: $(NEW_TESTS)
 
 .vim.res:
-       $(RUN_VIMTEST) -S runtest.vim $*.vim
+       $(RUN_VIMTEST) -u NONE -S runtest.vim $*.vim
index cca7c751dfd91f63617f57a788bb620481ca5b8e..8314a45d0c6fabdaed4b66211ab6daa827994496 100644 (file)
@@ -39,6 +39,7 @@ let testname = expand('%')
 let done = 0
 let fail = 0
 let errors = []
+let messages = []
 try
   source %
 catch
@@ -57,6 +58,7 @@ for test in tests
     call SetUp()
   endif
 
+  call add(messages, 'Executing ' . test)
   let done += 1
   try
     exe 'call ' . test
@@ -92,9 +94,20 @@ if len(errors) > 0
   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!
index af7afea523974ce9247b4e0e3770d6ca81706405..b10453eca19d003b8c9a79c8ab689d66fcdb3cbf 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    991,
 /**/
     990,
 /**/