Skip to content

Commit

Permalink
tests: improve error reporting
Browse files Browse the repository at this point in the history
Found in some stash, untested.
  • Loading branch information
blueyed committed Feb 19, 2018
1 parent 668f1a4 commit ad3aea3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion autoload/neomake.vim
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ if s:is_testing
try
let r = s:make_info[make_id]
catch
let g:neomake_test_errors += [printf('GetMakeOptions failed: %s (in %s)', v:exception, v:throwpoint)]
let msg = printf('GetMakeOptions failed: %s (in %s)', v:exception, v:throwpoint)
call vader#log(msg)
let g:neomake_test_errors += [msg]
return {'verbosity': 3}
endtry
return r
Expand Down
8 changes: 7 additions & 1 deletion tests/include/init.vim
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,11 @@ function! s:After()
if !empty(actions)
call add(errors, printf('action_queue is not empty: %d entries: %s',
\ len(actions), string(status.action_queue)))
try
call neomake#CancelAllMakes(1)
catch
call add(errors, v:exception)
endtry
endif

if exists('#neomake_tests')
Expand Down Expand Up @@ -513,7 +518,8 @@ function! s:After()
endif

if !empty(errors)
throw len(errors).' error(s) in teardown: '.join(errors, "\n")
call map(errors, "printf('%d. %s', v:key+1, v:val)")
throw len(errors)." error(s) in teardown:\n".join(errors, "\n")
endif
endfunction
command! NeomakeTestsGlobalAfter call s:After()

0 comments on commit ad3aea3

Please sign in to comment.