Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.
Update: Rufus Cable has written a vim syntax file for TAP, along with some other useful bindings. I think I'll put this together with my stuff and get around to that plugin.
It's trivial to set up vim mappings to run the current test program you're editing. I also wrote recently about how to run all tests in your vim buffers. Today, I'll explain a great technique to run all tests for the module you're currently editing.
First, grab Johan Lindstrom's Devel::CoverX::Covered. Once you have that set up and working, you can use something like this to your
function! PerlMappings()
" run the code
noremap <buffer> <leader>r:!perl %<cr>
" or check that it compiles
noremap <buffer> <leader>r:!perl -c %<cr>
" or run tall of the tests for it
noremap <buffer> <leader>t:call TestModuleCoverage()<cr>
endfunction
function! PerlTestMappings()
noremap <buffer> <leader>r:!prove -vl %<cr>
" or check that it compiles
noremap <buffer> <leader>r:!perl -c %<cr>
noremap <buffer> <leader>t:!prove -vl %<CR>
endfunction
function! TestModuleCoverage()
let filename = bufname('%')
let tests = system('covered covering --source_file="'. filename.'"')
let result = split( tests, "\n" )
if empty(result)
echomsg "No tests found for: ". filename
else
execute ':!prove ' . join(result)
endif
endfunction
Then, if you're in a test file and hit ",t" (assuming that the comma is your leader), then you'll run the test. If you're in a regular Perl program or module, hitting ",t" will run all tests which cover that program or module.
Vim: Run All Tests Which Cover This Module 0 Comments More | Login | Reply /