forked from relevance/rcov
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rcov.vim, README.vim, CHANGES: vim support for --text-coverage-diff.
darcs-hash:20060610104928-0786a-b46e44914157bf7b31673219364a8124d38f199c.gz
- Loading branch information
Showing
3 changed files
with
86 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
|
||
rcov.vim allows you to run test unit tests from vim and enter quickfix mode in | ||
order to jump to uncovered code introduced since the last run. | ||
|
||
Installation | ||
============ | ||
Copy rcov.vim to the appropriate "compiler" directory (typically | ||
$HOME/.vim/compiler). | ||
|
||
Usage | ||
===== | ||
|
||
Setting the reference point | ||
--------------------------- | ||
rcov's --text-coverage-diff mode compares the current coverage status against | ||
a previously stored one. It therefore needs that information to be saved | ||
before you write new code (typically right after you perform a commit) in | ||
order to have something to compare against. | ||
|
||
You can save the current status with the --save option. | ||
If you're running rcov from Rake, you can do something like | ||
rake rcov_units RCOVOPTS="-T --save --rails" | ||
in order to take the current status as the reference point. | ||
|
||
Comparing with a recorded coverage status | ||
----------------------------------------- | ||
Type the following in command mode while editing your program: | ||
:compiler rcov | ||
|
||
rcov.vim assumes rcov can be invoked with a rake task (see README.rake for | ||
information on how to create it). | ||
|
||
You can then execute rcov and enter quickfix mode by typing | ||
|
||
:make <taskname> | ||
|
||
where taskname is the rcov task you want to use; if you didn't override the | ||
default name in the Rakefile, just | ||
|
||
:make rcov | ||
|
||
will do. | ||
|
||
vim will then enter quickfix mode, allowing you to jump to the areas that were | ||
not covered since the last time you saved the coverage data. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
" Vim compiler file | ||
" Language: Ruby | ||
" Function: Code coverage information with rcov | ||
" Maintainer: Mauricio Fernandez <mfp at acm dot org> | ||
" Info: | ||
" URL: http://eigenclass.org/hiki.rb?rcov | ||
" ---------------------------------------------------------------------------- | ||
" | ||
" Changelog: | ||
" 0.1: initial version, shipped with rcov 0.6.0 | ||
" | ||
" Comments: | ||
" Initial attempt. | ||
" ---------------------------------------------------------------------------- | ||
|
||
if exists("current_compiler") | ||
finish | ||
endif | ||
let current_compiler = "rcov" | ||
|
||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal | ||
command -nargs=* CompilerSet setlocal <args> | ||
endif | ||
|
||
let s:cpo_save = &cpo | ||
set cpo-=C | ||
|
||
CompilerSet makeprg=rake\ $*\ RCOVOPTS=\"-D\ --no-html\ --no-color\"\ $* | ||
CompilerSet errorformat= | ||
\%+W\#\#\#\ %f:%l\, | ||
\%-C\ \ \ , | ||
\%-C!!\ | ||
|
||
let &cpo = s:cpo_save | ||
unlet s:cpo_save | ||
|
||
" vim: nowrap sw=2 sts=2 ts=8 ff=unix : |