Skip to content

Instantly share code, notes, and snippets.

@ih4cku
Last active April 22, 2016 18:33
Show Gist options
  • Save ih4cku/fa5d57f9f1dc5c03b6c36155bf3e2904 to your computer and use it in GitHub Desktop.
Save ih4cku/fa5d57f9f1dc5c03b6c36155bf3e2904 to your computer and use it in GitHub Desktop.
run test if make success
nnoremap <F7> :make! test<CR>
augroup MakeRunTestGroup
autocmd!
autocmd QuickFixCmdPost make call RunTest()
augroup END
function! RunTest()
" check quickfix list
let l:b_ok = 1
for m in getqflist()
if m['valid']==1
let l:b_ok = 0
break
endif
endfor
if l:b_ok == 1
!build/test.bin
endif
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment