Problem: Elapsed time since testing started is not visible.
Solution: Show the elapsed time while running tests.
NO_PLUGINS = --noplugin --not-a-term
NO_INITS = -U NONE $(NO_PLUGINS)
+# File to delete when testing starts
+CLEANUP_FILES = test.log messages starttime
+
# Tests for tiny and small builds.
SCRIPTS_TINY = \
test20 \
@if exist test.log ( copy /y test.log test_result.log > nul ) \
else ( echo No failures reported > test_result.log )
$(VIMPROG) -u NONE $(COMMON_ARGS) -S summarize.vim messages
+ -if exist starttime del starttime
@echo.
@echo Test results:
@cmd /c type test_result.log
-if exist $@.res del $@.res
-if exist test.log del test.log
-if exist messages del messages
+ -if exist starttime del starttime
@$(MAKE) -f Make_ming.mak $@.res VIMPROG=$(VIMPROG) --no-print-directory
@type messages
@if exist test.log exit 1
-@if exist test.log $(DEL) test.log
-@if exist test_result.log del test_result.log
-@if exist messages $(DEL) messages
+ -@if exist starttime $(DEL) starttime
-@if exist benchmark.out del benchmark.out
-@if exist opt_test.vim $(DEL) opt_test.vim
-@if exist guidialog $(DEL) guidialog
-@if exist test.log $(DEL) test.log
-@if exist test_result.log del test_result.log
-@if exist messages $(DEL) messages
+ -@if exist starttime $(DEL) starttime
# Tiny tests. Works even without the +eval feature.
@if exist test.log ( copy /y test.log test_result.log > nul ) \
else ( echo No failures reported > test_result.log )
$(VIMPROG) -u NONE $(COMMON_ARGS) -S summarize.vim messages
+ -if exist starttime del starttime
@echo.
@echo Test results:
@cmd /c type test_result.log
-if exist $@.res del $@.res
-if exist test.log del test.log
-if exist messages del messages
+ -if exist starttime del starttime
@$(MAKE) -nologo -f Make_mvc.mak $@.res VIMPROG=$(VIMPROG)
@type messages
@if exist test.log exit 1
-if exist test.log del test.log
-if exist test_result.log del test_result.log
-if exist messages del messages
+ -if exist starttime del starttime
-if exist benchmark.out del benchmark.out
-if exist opt_test.vim del opt_test.vim
-if exist guidialog del guidialog
-if exist test.log del test.log
-if exist test_result.log del test_result.log
-if exist messages del messages
+ -if exist starttime del starttime
# Tiny tests. Works even without the +eval feature.
# Comment out this line to see the verbose output of tests.
#
# Catches SwapExists to avoid hanging at the ATTENTION prompt.
-REDIR_TEST_TO_NULL = --cmd 'au SwapExists * let v:swapchoice = "e"' | LC_ALL=C LANG=C LANGUAGE=C awk '/Executing Test_/{match($$0, "(took .*; now )?Executing Test_[^\\)]*\\)"); print substr($$0, RSTART, RLENGTH) "\r"; fflush()}'
+REDIR_TEST_TO_NULL = --cmd 'au SwapExists * let v:swapchoice = "e"' | LC_ALL=C LANG=C LANGUAGE=C awk '/Executing Test_/{match($$0, "([0-9][0-9]:[0-9][0-9] *)?Executing Test_[^\\)]*\\)"); print substr($$0, RSTART, RLENGTH) "\r"; fflush()}'
# Uncomment this line to use valgrind for memory leaks and extra warnings.
# The output goes into a file "valgrind.testN"
else echo No failures reported > test_result.log; \
fi"
$(VIMPROG) -u NONE $(NO_INITS) -S summarize.vim messages $(REDIR_TEST_TO_NULL)
+ @rm -f starttime
@echo
@echo 'Test results:'
@cat test_result.log
# Execute an individual new style test, e.g.:
# make test_largefile
$(NEW_TESTS):
- rm -f $@.res test.log messages
+ rm -f $@.res $(CLEANUP_FILES)
@MAKEFLAGS=--no-print-directory $(MAKE) -f Makefile $@.res VIMPROG=$(VIMPROG) XXDPROG=$(XXDPROG) SCRIPTSOURCE=$(SCRIPTSOURCE)
@cat messages
@if test -f test.log; then \
# Run only tests specific for Vim9 script
test_vim9:
- rm -f test_vim9_*.res test.log messages
+ rm -f test_vim9_*.res $(CLEANUP_FILES)
@MAKEFLAGS=--no-print-directory $(MAKE) -f Makefile $(TEST_VIM9_RES) VIMPROG=$(VIMPROG) XXDPROG=$(XXDPROG) SCRIPTSOURCE=$(SCRIPTSOURCE)
@cat messages
+ @rm -f starttime
@MAKEFLAGS=--no-print-directory $(MAKE) -f Makefile report VIMPROG=$(VIMPROG) XXDPROG=$(XXDPROG) SCRIPTSOURCE=$(SCRIPTSOURCE)
@if test -f test.log; then \
exit 1; \
# that may result from working on the tests, not only from running them.
clean:
-rm -rf *.out *.failed *.res *.rej *.orig XfakeHOME Xdir1 Xfind
- -rm -f opt_test.vim test.log test_result.log messages
+ -rm -f opt_test.vim test_result.log $(CLEANUP_FILES)
-rm -rf $(RM_ON_RUN) $(RM_ON_START)
-rm -f valgrind.*
-rm -f asan.*
rm -f $(SCRIPTS_BENCH)
nolog:
- -rm -f test.log test_result.log messages
+ -rm -f test_result.log $(CLEANUP_FILES)
# Tiny tests. Works even without the +eval feature.
endif
if has('reltime')
- let s:start_time = reltime()
+ let s:run_start_time = reltime()
+
+ if !filereadable('starttime')
+ " first test, store the overall test starting time
+ let s:test_start_time = localtime()
+ call writefile([string(s:test_start_time)], 'starttime')
+ else
+ " second or later test, read the overall test starting time
+ let s:test_start_time = readfile('starttime')[0]->str2nr()
+ endif
endif
" Always use forward slashes.
return lnum - top - 1
endfunc
-let g:func_start = reltime()
+if has('reltime')
+ let g:func_start = reltime()
+endif
func RunTheTest(test)
let prefix = ''
if has('reltime')
- let prefix = 'took ' .. reltimestr(reltime(g:func_start)) .. '; now '
+ let prefix = strftime('%M:%S', localtime() - s:test_start_time) .. ' '
let g:func_start = reltime()
endif
echoconsole prefix .. 'Executing ' .. a:test
endif
if s:done > 0 && has('reltime')
let message = s:t_bold .. message .. repeat(' ', 40 - len(message))
- let message ..= ' in ' .. reltimestr(reltime(s:start_time)) .. ' seconds'
+ let message ..= ' in ' .. reltimestr(reltime(s:run_start_time)) .. ' seconds'
let message ..= s:t_normal
endif
echo message
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 560,
/**/
559,
/**/