better test runner

This commit is contained in:
Haak Saxberg 2014-05-06 12:02:24 -07:00
parent a5a06857fc
commit 58b14ca461

View file

@ -106,18 +106,18 @@ endtry
set t_Co=256 set t_Co=256
if &term =~ 'xterm-color' if &term =~ 'xterm-color'
set t_ut= set t_ut=
endif endif
let g:Powerline_symbols = 'fancy' let g:Powerline_symbols = 'fancy'
set nocompatible set nocompatible
set laststatus=2 set laststatus=2
if v:version >= 703 if v:version >= 703
"undo settings "undo settings
set undodir=~/.vim/undofiles set undodir=~/.vim/undofiles
set undofile set undofile
set colorcolumn=+1 "mark the ideal max text width set colorcolumn=+1 "mark the ideal max text width
endif endif
@ -156,20 +156,20 @@ autocmd cursorhold,bufwritepost * unlet! b:statusline_trailing_space_warning
"return '[\s]' if trailing white space is detected return '' otherwise "return '[\s]' if trailing white space is detected return '' otherwise
function! StatuslineTrailingSpaceWarning() function! StatuslineTrailingSpaceWarning()
if !exists("b:statusline_trailing_space_warning") if !exists("b:statusline_trailing_space_warning")
if !&modifiable if !&modifiable
let b:statusline_trailing_space_warning = '' let b:statusline_trailing_space_warning = ''
return b:statusline_trailing_space_warning return b:statusline_trailing_space_warning
endif endif
if search('\s\+$', 'nw') != 0 if search('\s\+$', 'nw') != 0
let b:statusline_trailing_space_warning = '[\s]' let b:statusline_trailing_space_warning = '[\s]'
else else
let b:statusline_trailing_space_warning = '' let b:statusline_trailing_space_warning = ''
endif endif
endif endif
return b:statusline_trailing_space_warning return b:statusline_trailing_space_warning
endfunction endfunction
@ -270,27 +270,34 @@ function! RunTests(filename, test_path)
let tmux_pane_target = tmux_pane."_testing:1.0" let tmux_pane_target = tmux_pane."_testing:1.0"
echo tmux_pane_target echo tmux_pane_target
if a:test_path != ' '
let full_test_path = a:filename." ".a:test_path
else
let full_test_path = a:filename
endif
let command = "" let command = ""
if l:tmux_pane == "checkout" if l:tmux_pane == "checkout"
if l:full_test_path != " " " checkout uses py.test (or uh it will)
if a:test_path != ' '
let full_test_path = a:filename."::".a:test_path
else
let full_test_path = a:filename
endif
if l:full_test_path != "::"
let command = "silent !tmux send-keys -t ".tmux_pane_target." C-c ' tox ".full_test_path." 2>/dev/null' Enter" let command = "silent !tmux send-keys -t ".tmux_pane_target." C-c ' tox ".full_test_path." 2>/dev/null' Enter"
else else
let command = "silent !tmux send-keys -t ".tmux_pane_target." C-c ' make test 2>/dev/null' Enter" let command = "silent !tmux send-keys -t ".tmux_pane_target." C-c ' make test 2>/dev/null' Enter"
endif endif
else else
" yelp-main uses testify
if a:test_path != ' '
let full_test_path = a:filename." ".a:test_path
else
let full_test_path = a:filename
endif
if l:full_test_path != " " if l:full_test_path != " "
let command = "silent !tmux send-keys -t ".tmux_pane_target." C-c ' testify ".full_test_path."' Enter" let command = "silent !tmux send-keys -t ".tmux_pane_target." C-c ' testify ".full_test_path."' Enter"
endif endif
endif endif
echo command echo command
exec command exec command
exec "redraw!" exec "redraw!"
endfun endfun
function! StoreTestPath(filename, lineno) function! StoreTestPath(filename, lineno)