Skip to content

Commit 096c8bb

Browse files
committed
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.
1 parent e5c5f0c commit 096c8bb

4 files changed

Lines changed: 48 additions & 9 deletions

File tree

src/Makefile

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,27 @@ LINT_OPTIONS = -beprxzF
616616
#PROFILE_LIBS = -pg
617617
#PROFILE_LIBS = -pg -lc
618618

619+
620+
# TEST COVERAGE - Uncomment the two lines below the explanation to get code
621+
# coverage information. (provided by Yegappan Lakshmanan)
622+
# 1. make clean, run configure and build Vim as usual.
623+
# 2. Generate the baseline code coverage information:
624+
# $ lcov -c -i -b . -d objects -o objects/coverage_base.info
625+
# 3. Run "make test" to run the unit tests. The code coverage information will
626+
# be generated in the src/objects directory.
627+
# 4. Generate the code coverage information from the tests:
628+
# $ lcov -c -b . -d objects/ -o objects/coverage_test.info
629+
# 5. Combine the baseline and test code coverage data:
630+
# $ lcov -a objects/coverage_base.info -a objects/coverage_test.info -o objects/coverage_total.info
631+
# 6. Process the test coverage data and generate a report in html:
632+
# $ genhtml objects/coverage_total.info -o objects
633+
# 7. Open the objects/index.html file in a web browser to view the coverage
634+
# information.
635+
#
636+
# PROFILE_CFLAGS=-g -O0 -fprofile-arcs -ftest-coverage
637+
# LDFLAGS=--coverage
638+
639+
619640
# Uncomment one of the next two lines to compile Vim with the
620641
# address sanitizer or with the undefined sanitizer. Works with gcc and
621642
# clang. May make Vim twice as slow. Errors reported on stderr.
@@ -1905,7 +1926,6 @@ test1 \
19051926
test_autocmd_option \
19061927
test_autoformat_join \
19071928
test_breakindent \
1908-
test_cdo \
19091929
test_changelist \
19101930
test_charsearch \
19111931
test_close_count \
@@ -1948,13 +1968,17 @@ test1 \
19481968
cd testdir; rm -f [email protected]; $(MAKE) -f Makefile [email protected] VIMPROG=../$(VIMTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE)
19491969

19501970
test_assert \
1971+
test_cdo \
1972+
test_searchpos \
19511973
test_sort \
19521974
test_undolevels \
19531975
test_alot:
1954-
cd testdir; rm -f [email protected]; $(MAKE) -f Makefile [email protected] VIMPROG=../$(VIMTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE)
1976+
cd testdir; rm -f [email protected] test.log messages; $(MAKE) -f Makefile [email protected] VIMPROG=../$(VIMTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE)
1977+
cat testdir/messages
19551978

19561979
newtests:
1957-
cd testdir; rm -f $@.res; $(MAKE) -f Makefile newtests VIMPROG=../$(VIMTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE)
1980+
cd testdir; rm -f $@.res test.log messages; $(MAKE) -f Makefile newtests VIMPROG=../$(VIMTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE)
1981+
cat testdir/messages
19581982

19591983
testclean:
19601984
cd testdir; $(MAKE) -f Makefile clean
@@ -2674,7 +2698,7 @@ objects/if_lua.o: if_lua.c
26742698

26752699
objects/if_mzsch.o: if_mzsch.c $(MZSCHEME_EXTRA)
26762700
$(CCC) -o $@ $(MZSCHEME_CFLAGS_EXTRA) if_mzsch.c
2677-
2701+
26782702
mzscheme_base.c:
26792703
$(MZSCHEME_MZC) --c-mods mzscheme_base.c ++lib scheme/base
26802704

src/testdir/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ RM_ON_START = tiny.vim small.vim mbyte.vim mzscheme.vim lua.vim test.ok benchmar
5555
RUN_VIM = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(VALGRIND) $(VIMPROG) -f -u unix.vim -U NONE --noplugin -s dotest.in
5656

5757
clean:
58-
-rm -rf *.out *.failed *.res *.rej *.orig test.log $(RM_ON_RUN) $(RM_ON_START) valgrind.*
58+
-rm -rf *.out *.failed *.res *.rej *.orig test.log messages $(RM_ON_RUN) $(RM_ON_START) valgrind.*
5959

6060
test1.out: test1.in
6161
-rm -rf $*.failed $(RM_ON_RUN) $(RM_ON_START) wrongtermsize
@@ -112,7 +112,7 @@ bench_re_freeze.out: bench_re_freeze.vim
112112
@/bin/sh -c "if test -f benchmark.out; then cat benchmark.out; fi"
113113

114114
nolog:
115-
-rm -f test.log
115+
-rm -f test.log messages
116116

117117

118118
# 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
123123
newtests: $(NEW_TESTS)
124124

125125
.vim.res:
126-
$(RUN_VIMTEST) -S runtest.vim $*.vim
126+
$(RUN_VIMTEST) -u NONE -S runtest.vim $*.vim

src/testdir/runtest.vim

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ let testname = expand('%')
3939
let done = 0
4040
let fail = 0
4141
let errors = []
42+
let messages = []
4243
try
4344
source %
4445
catch
@@ -57,6 +58,7 @@ for test in tests
5758
call SetUp()
5859
endif
5960

61+
call add(messages, 'Executing ' . test)
6062
let done += 1
6163
try
6264
exe 'call ' . test
@@ -92,9 +94,20 @@ if len(errors) > 0
9294
write
9395
endif
9496

95-
echo 'Executed ' . done . (done > 1 ? ' tests': ' test')
97+
let message = 'Executed ' . done . (done > 1 ? ' tests': ' test')
98+
echo message
99+
call add(messages, message)
96100
if fail > 0
97-
echo fail . ' FAILED'
101+
let message = fail . ' FAILED'
102+
echo message
103+
call add(messages, message)
98104
endif
99105

106+
" Append messages to "messages"
107+
split messages
108+
call append(line('$'), '')
109+
call append(line('$'), 'From ' . testname . ':')
110+
call append(line('$'), messages)
111+
write
112+
100113
qall!

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ static char *(features[]) =
741741

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
991,
744746
/**/
745747
990,
746748
/**/

0 commit comments

Comments
 (0)