in reply to Re^3: Running tests on modules generated by Module::Starter still in /lib directory
in thread Running tests on modules generated by Module::Starter still in /lib directory

It's a nifty little VIM script in that goes in .vimrc file:

"=====[ Run a Perl module's test suite ]========================= let g:PerlTests_program = 'perltests' " ...What to call let g:PerlTests_search_height = 5 " ...How far up to searc +h let g:PerlTests_test_dir = '/t' " ...Where to look for t +ests augroup Perl_Tests autocmd! autocmd BufEnter *.p[lm] nmap <buffer> ;t :call RunPerlTests()<CR +> autocmd BufEnter *.t nmap <buffer> ;t :call RunPerlTests()<CR +> augroup END function! RunPerlTests () " Start in the current directory... let dir = expand('%:h') " Walk up through parent directories, looking for a test directory +... for n in range(g:PerlTests_search_height) " When found... if isdirectory(dir . g:PerlTests_test_dir) " Go there... silent exec 'cd ' . dir " Run the tests... exec ':!' . g:PerlTests_program " Return to the previous directory... silent cd - return endif " Otherwise, keep looking up the directory tree... let dir = dir . '/..' endfor " If not found, report the failure... echohl WarningMsg echomsg "Couldn't find a suitable" g:PerlTests_test_dir '(tried' g +:PerlTests_search_height 'levels up)' echohl None endfunction

The VIM script makes use of a perltests script in ~/bin which finds the tests and executes them via TAP::Harness which itself can take a lib argument when creating a new object. So it seems like I should be able to put something in there to make this work. The beauty of it is I can do ;t keystroke and run tests.

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks