mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:9.0.0560: elapsed time since testing started is not visible
Problem: Elapsed time since testing started is not visible.
Solution: Show the elapsed time while running tests.
b9093d5009
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
parent
7592540029
commit
63432c854f
1
.gitignore
vendored
1
.gitignore
vendored
@ -43,6 +43,7 @@ compile_commands.json
|
|||||||
/test/old/testdir/test*.res
|
/test/old/testdir/test*.res
|
||||||
/test/old/testdir/test*.log
|
/test/old/testdir/test*.log
|
||||||
/test/old/testdir/messages
|
/test/old/testdir/messages
|
||||||
|
/test/old/testdir/starttime
|
||||||
/test/old/testdir/viminfo
|
/test/old/testdir/viminfo
|
||||||
/test/old/testdir/test.ok
|
/test/old/testdir/test.ok
|
||||||
/test/old/testdir/*.failed
|
/test/old/testdir/*.failed
|
||||||
|
@ -70,6 +70,7 @@ report:
|
|||||||
then echo TEST FAILURE; exit 1; \
|
then echo TEST FAILURE; exit 1; \
|
||||||
else echo ALL DONE; \
|
else echo ALL DONE; \
|
||||||
fi"
|
fi"
|
||||||
|
@rm -f starttime
|
||||||
|
|
||||||
test1.out: $(NVIM_PRG)
|
test1.out: $(NVIM_PRG)
|
||||||
|
|
||||||
@ -86,10 +87,13 @@ fixff:
|
|||||||
-$(NVIM_PRG) $(NO_INITS) -u unix.vim "+argdo set ff=dos|upd" +q \
|
-$(NVIM_PRG) $(NO_INITS) -u unix.vim "+argdo set ff=dos|upd" +q \
|
||||||
dotest.in
|
dotest.in
|
||||||
|
|
||||||
|
# File to delete when testing starts
|
||||||
|
CLEANUP_FILES = test.log messages starttime
|
||||||
|
|
||||||
# Execute an individual new style test, e.g.:
|
# Execute an individual new style test, e.g.:
|
||||||
# make test_largefile
|
# make test_largefile
|
||||||
$(NEW_TESTS):
|
$(NEW_TESTS):
|
||||||
rm -f $@.res test.log messages
|
rm -f $@.res $(CLEANUP_FILES)
|
||||||
@MAKEFLAGS=--no-print-directory $(MAKE) -f Makefile $@.res
|
@MAKEFLAGS=--no-print-directory $(MAKE) -f Makefile $@.res
|
||||||
@cat messages
|
@cat messages
|
||||||
@if test -f test.log; then \
|
@if test -f test.log; then \
|
||||||
@ -108,9 +112,8 @@ CLEAN_FILES := *.out \
|
|||||||
*.rej \
|
*.rej \
|
||||||
*.orig \
|
*.orig \
|
||||||
*.tlog \
|
*.tlog \
|
||||||
test.log \
|
|
||||||
test_result.log \
|
test_result.log \
|
||||||
messages \
|
$(CLEANUP_FILES) \
|
||||||
$(RM_ON_RUN) \
|
$(RM_ON_RUN) \
|
||||||
$(RM_ON_START) \
|
$(RM_ON_START) \
|
||||||
valgrind.* \
|
valgrind.* \
|
||||||
@ -132,7 +135,7 @@ test1.out: .gdbinit test1.in
|
|||||||
|
|
||||||
nolog:
|
nolog:
|
||||||
@echo "[OLDTEST-PREP] Removing test.log and messages"
|
@echo "[OLDTEST-PREP] Removing test.log and messages"
|
||||||
@rm -f test.log messages
|
@rm -f test_result.log $(CLEANUP_FILES)
|
||||||
|
|
||||||
|
|
||||||
# New style of tests uses Vim script with assert calls. These are easier
|
# New style of tests uses Vim script with assert calls. These are easier
|
||||||
|
@ -61,7 +61,16 @@ if &lines < 24 || &columns < 80
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if has('reltime')
|
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
|
endif
|
||||||
|
|
||||||
" Always use forward slashes.
|
" Always use forward slashes.
|
||||||
@ -139,12 +148,14 @@ func GetAllocId(name)
|
|||||||
return lnum - top - 1
|
return lnum - top - 1
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
if has('reltime')
|
||||||
let g:func_start = reltime()
|
let g:func_start = reltime()
|
||||||
|
endif
|
||||||
|
|
||||||
func RunTheTest(test)
|
func RunTheTest(test)
|
||||||
let prefix = ''
|
let prefix = ''
|
||||||
if has('reltime')
|
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()
|
let g:func_start = reltime()
|
||||||
endif
|
endif
|
||||||
echo prefix .. 'Executing ' .. a:test
|
echo prefix .. 'Executing ' .. a:test
|
||||||
@ -328,7 +339,7 @@ func FinishTesting()
|
|||||||
endif
|
endif
|
||||||
if s:done > 0 && has('reltime')
|
if s:done > 0 && has('reltime')
|
||||||
let message = s:t_bold .. message .. repeat(' ', 40 - len(message))
|
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
|
let message ..= s:t_normal
|
||||||
endif
|
endif
|
||||||
echo message
|
echo message
|
||||||
|
Loading…
Reference in New Issue
Block a user