Provide :RunAllTests
Don't waste :RunTests! on this cleverness.
This commit is contained in:
parent
9c78e32f4b
commit
0e42998a27
|
@ -123,7 +123,7 @@ stack trace is loaded into the |location-list|. Use |:lopen| to view it.
|
||||||
:RunTests [ns] [...] Call clojure.test/run-tests on the given namespaces
|
:RunTests [ns] [...] Call clojure.test/run-tests on the given namespaces
|
||||||
and load the results into the quickfix list.
|
and load the results into the quickfix list.
|
||||||
|
|
||||||
:RunTests! [pattern] Call clojure.test/run-all-tests with the given pattern
|
:RunAllTests [pattern] Call clojure.test/run-all-tests with the given pattern
|
||||||
and load the results into the quickfix list.
|
and load the results into the quickfix list.
|
||||||
|
|
||||||
*fireplace-cp*
|
*fireplace-cp*
|
||||||
|
|
|
@ -1469,23 +1469,32 @@ function! s:RunTests(bang, ...) abort
|
||||||
if &autowrite || &autowriteall
|
if &autowrite || &autowriteall
|
||||||
silent! wall
|
silent! wall
|
||||||
endif
|
endif
|
||||||
let pre = ''
|
let reqs = map(copy(a:000), '"''".v:val')
|
||||||
if a:bang && a:0
|
let pre = '(clojure.core/require '.join(empty(a:000) ? ["'".fireplace#ns()] : reqs, ' ').' :reload) '
|
||||||
let expr = '(clojure.test/run-all-tests #"'.join(a:000, '|').'")'
|
let expr = join(['(clojure.test/run-tests'] + reqs, ' ').')'
|
||||||
elseif a:bang
|
|
||||||
let expr = '(clojure.test/run-all-tests)'
|
|
||||||
else
|
|
||||||
let reqs = map(copy(a:000), '"''".v:val')
|
|
||||||
let pre = '(clojure.core/require '.join(empty(a:000) ? ["'".fireplace#ns()] : reqs, ' ').' :reload) '
|
|
||||||
let expr = join(['(clojure.test/run-tests'] + reqs, ' ').')'
|
|
||||||
endif
|
|
||||||
call fireplace#capture_test_run(expr, pre)
|
call fireplace#capture_test_run(expr, pre)
|
||||||
echo expr
|
echo expr
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
augroup fireplace_command
|
function! s:RunAllTests(bang, ...) abort
|
||||||
autocmd!
|
if a:0
|
||||||
autocmd FileType clojure command! -buffer -bar -bang -nargs=*
|
let expr = '(clojure.test/run-all-tests #"'.join(a:000, '|').'")'
|
||||||
|
else
|
||||||
|
let expr = '(clojure.test/run-all-tests)'
|
||||||
|
endif
|
||||||
|
call fireplace#capture_test_run(expr)
|
||||||
|
echo expr
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:set_up_tests() abort
|
||||||
|
command! -buffer -bar -bang -nargs=*
|
||||||
\ -complete=customlist,fireplace#ns_complete RunTests
|
\ -complete=customlist,fireplace#ns_complete RunTests
|
||||||
\ call s:RunTests(<bang>0, <f-args>)
|
\ call s:RunTests(<bang>0, <f-args>)
|
||||||
|
command! -buffer -bang -nargs=* RunAllTests
|
||||||
|
\ call s:RunAllTests(<bang>0, <f-args>)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
augroup fireplace_tests
|
||||||
|
autocmd!
|
||||||
|
autocmd FileType clojure call s:set_up_tests()
|
||||||
augroup END
|
augroup END
|
||||||
|
|
Loading…
Reference in New Issue