Improve tests
This commit is contained in:
parent
13f92e7d9b
commit
132b284dcd
6 changed files with 17 additions and 12 deletions
|
|
@ -205,11 +205,11 @@ class DebugSession( object ):
|
||||||
|
|
||||||
def _Reset( self ):
|
def _Reset( self ):
|
||||||
if self._uiTab:
|
if self._uiTab:
|
||||||
|
vim.current.tabpage = self._uiTab
|
||||||
self._stackTraceView.Reset()
|
self._stackTraceView.Reset()
|
||||||
self._variablesView.Reset()
|
self._variablesView.Reset()
|
||||||
self._outputView.Reset()
|
self._outputView.Reset()
|
||||||
self._codeView.Reset()
|
self._codeView.Reset()
|
||||||
vim.current.tabpage = self._uiTab
|
|
||||||
vim.command( 'tabclose!' )
|
vim.command( 'tabclose!' )
|
||||||
self._uiTab = None
|
self._uiTab = None
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
RUN_VIM="vim --noplugin --clean --not-a-term"
|
RUN_VIM="vim --clean --not-a-term"
|
||||||
RUN_TEST="${RUN_VIM} -S run_test.vim"
|
RUN_TEST="${RUN_VIM} -S run_test.vim"
|
||||||
|
|
||||||
if [ -z "$VIMSPECTOR_MIMODE" ]; then
|
if [ -z "$VIMSPECTOR_MIMODE" ]; then
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
RUN_VIM="vim --noplugin --clean --not-a-term -Nu vimrc"
|
exec vim \
|
||||||
RUN_TEST="${RUN_VIM} -S run_test.vim"
|
--clean \
|
||||||
|
--not-a-term \
|
||||||
pushd tests > /dev/null
|
--cmd "let g:vimspector_enable_mappings='HUMAN'" \
|
||||||
|
-Nu $(dirname $0)/../../tests/vimrc \
|
||||||
exec $RUN_VIM "$@"
|
"$@"
|
||||||
|
|
|
||||||
|
|
@ -156,6 +156,10 @@ function! Test_Use_Mappings_HUMAN()
|
||||||
" Here we go. Start Debugging
|
" Here we go. Start Debugging
|
||||||
call feedkeys( "\<F5>", 'xt' )
|
call feedkeys( "\<F5>", 'xt' )
|
||||||
|
|
||||||
|
call assert_equal( 2, len( gettabinfo() ) )
|
||||||
|
let cur_tabnr = tabpagenr()
|
||||||
|
call assert_equal( 5, len( gettabinfo( cur_tabnr )[ 0 ].windows ) )
|
||||||
|
|
||||||
call vimspector#Reset()
|
call vimspector#Reset()
|
||||||
|
|
||||||
call vimspector#ClearBreakpoints()
|
call vimspector#ClearBreakpoints()
|
||||||
|
|
@ -166,7 +170,6 @@ function! Test_Use_Mappings_HUMAN()
|
||||||
call assert_equal( 1, len( signs ), 1 )
|
call assert_equal( 1, len( signs ), 1 )
|
||||||
call assert_equal( 0, len( signs[ 0 ].signs ) )
|
call assert_equal( 0, len( signs[ 0 ].signs ) )
|
||||||
|
|
||||||
|
|
||||||
lcd -
|
lcd -
|
||||||
%bwipeout!
|
%bwipeout!
|
||||||
endfunction
|
endfunction
|
||||||
|
|
|
||||||
|
|
@ -115,6 +115,7 @@ func RunTheTest(test)
|
||||||
else
|
else
|
||||||
try
|
try
|
||||||
let s:test = a:test
|
let s:test = a:test
|
||||||
|
let s:testid = g:testpath . ':' . a:test
|
||||||
au VimLeavePre * call EarlyExit(s:test)
|
au VimLeavePre * call EarlyExit(s:test)
|
||||||
exe 'call ' . a:test
|
exe 'call ' . a:test
|
||||||
au! VimLeavePre
|
au! VimLeavePre
|
||||||
|
|
@ -197,7 +198,7 @@ endfunc
|
||||||
func AfterTheTest()
|
func AfterTheTest()
|
||||||
if len(v:errors) > 0
|
if len(v:errors) > 0
|
||||||
let s:fail += 1
|
let s:fail += 1
|
||||||
call add(s:errors, 'Found errors in ' . s:test . ':')
|
call add(s:errors, 'Found errors in ' . s:testid . ':')
|
||||||
call extend(s:errors, v:errors)
|
call extend(s:errors, v:errors)
|
||||||
let v:errors = []
|
let v:errors = []
|
||||||
endif
|
endif
|
||||||
|
|
@ -318,7 +319,7 @@ for s:test in sort(s:tests)
|
||||||
\ && (index(s:flaky_tests, s:test) >= 0
|
\ && (index(s:flaky_tests, s:test) >= 0
|
||||||
\ || v:errors[0] =~ s:flaky_errors_re)
|
\ || v:errors[0] =~ s:flaky_errors_re)
|
||||||
while 1
|
while 1
|
||||||
call add(s:messages, 'Found errors in ' . s:test . ':')
|
call add(s:messages, 'Found errors in ' . s:testid . ':')
|
||||||
call extend(s:messages, v:errors)
|
call extend(s:messages, v:errors)
|
||||||
|
|
||||||
call add(total_errors, 'Run ' . run_nr . ':')
|
call add(total_errors, 'Run ' . run_nr . ':')
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
let g:vimspector_test_plugin_path = expand( '<sfile>:h:h' )
|
let g:vimspector_test_plugin_path = expand( '<sfile>:p:h:h' )
|
||||||
|
set mouse=a
|
||||||
|
|
||||||
let &rtp = &rtp . ',' . g:vimspector_test_plugin_path
|
let &rtp = &rtp . ',' . g:vimspector_test_plugin_path
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue