Commit c762688d authored by John E. Vincent's avatar John E. Vincent

adding rcov rake tasks

parent 46a1a205
.rvmrc
*.swp
coverage.data
......@@ -16,7 +16,6 @@ platforms :mri do
end
platforms :jruby do
gem "json-jruby", "= 1.4.6", :require => "json"
# gem "kirk", :git => "git://github.com/strobecorp/kirk.git"
gem "warbler", "= 1.2.1"
gem "jruby-openssl", "= 0.7.3"
end
......@@ -51,7 +51,7 @@ GEM
sinatra-sugar (0.5.0)
monkey-lib (~> 0.5.0)
sinatra (~> 1.0)
tilt (1.2.1)
tilt (1.2.2)
warbler (1.2.1)
jruby-jars (>= 1.4.0)
jruby-rack (>= 1.0.0)
......
......@@ -90,3 +90,14 @@ end
RSpec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = FileList['spec/**/*_spec.rb']
end
namespace :coverage do
desc "Delete aggregate coverage data."
task(:clean) { rm_f "coverage.data" }
end
desc "Run Rcov code coverage analysis"
RSpec::Core::RakeTask.new(:coverage) do |t|
t.rcov = true
t.verbose = true
t.rcov_opts = %q[--aggregate coverage.data --sort coverage --text-report --exclude "config,.bundle/*,gems/*,spec/*" -o doc/coverage -Ilib -i "noah.rb"]
end
......@@ -6,7 +6,7 @@ Warbler::Config.new do |config|
# Features: additional options controlling how the jar is built.
# Currently the following features are supported:
# - gemjar: package the gem repository in a jar file in WEB-INF/lib
# config.features = %w(gemjar)
config.features = %w(gemjar)
# Application directories to be included in the webapp.
config.dirs = %w(config lib views)
......@@ -35,17 +35,17 @@ Warbler::Config.new do |config|
# Path to the pre-bundled gem directory inside the war file. Default
# is 'WEB-INF/gems'. Specify path if gems are already bundled
# before running Warbler. This also sets 'gem.path' inside web.xml.
# config.gem_path = "WEB-INF/vendor/bundler_gems"
#config.gem_path = "WEB-INF/gems"
# Bundler support is built-in. If Warbler finds a Gemfile in the
# project directory, it will be used to collect the gems to bundle
# in your application. If you wish to explicitly disable this
# functionality, uncomment here.
config.bundler = true
# config.bundler = false
# An array of Bundler groups to avoid including in the war file.
# Defaults to ["development", "test"].
config.bundle_without = ["development", "test"]
# config.bundle_without = []
# Files for WEB-INF directory (next to web.xml). This contains
# web.xml by default. If there is an .erb-File it will be processed
......@@ -80,7 +80,7 @@ Warbler::Config.new do |config|
# Array of regular expressions matching relative paths in gems to be
# excluded from the war. Defaults to empty, but you can set it like
# below, which excludes test files.
# config.gem_excludes = [/^(test|spec)\//]
config.gem_excludes = [/^(test|spec)\//]
# Files to be included in the root of the webapp. Note that files in public
# will have the leading 'public/' part of the path stripped during staging.
......@@ -94,7 +94,7 @@ Warbler::Config.new do |config|
# Name of the war file (without the .war) -- defaults to the basename
# of RAILS_ROOT
config.war_name = "noah"
# config.war_name = "mywar"
# Name of the MANIFEST.MF template for the war file. Defaults to a simple
# MANIFEST.MF that contains the version of Warbler used to create the war file.
......@@ -104,12 +104,12 @@ Warbler::Config.new do |config|
# files will be compiled. Default is to compile all \.rb files in
# the application.
# config.compiled_ruby_files = FileList['app/**/*.rb']
config.compiled_ruby_files = FileList['lib/**/*.rb', 'noah.rb']
# Value of RAILS_ENV for the webapp -- default as shown below
config.webxml.rails.env = ENV['RAILS_ENV'] || 'development'
config.webxml.rails.env = ENV['RAILS_ENV'] || 'production'
# Application booter to use, one of :rack, :rails, or :merb (autodetected by default)
# config.webxml.booter = :rails
config.webxml.booter = :rack
# When using the :rack booter, "Rackup" script to use.
# - For 'rackup.path', the value points to the location of the rackup
......@@ -121,7 +121,7 @@ Warbler::Config.new do |config|
# The script is evaluated in a Rack::Builder to load the application.
# Examples:
#config.webxml.rackup.path = 'WEB-INF/config.ru'
# config.webxml.rackup = %{require './lib/demo'; run Rack::Adapter::Camping.new(Demo)}
config.webxml.rackup = %{require './noah'; run NoahApp}
# config.webxml.rackup = require 'cgi' && CGI::escapeHTML(File.read("config.ru"))
# Control the pool of Rails runtimes. Leaving unspecified means
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
<title>Noah C0 Coverage Information - RCov</title>
<link href="screen.css" media="all" rel="stylesheet" type="text/css" />
<link href="print.css" media="print" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="rcov.js"></script>
</head>
<body>
<h1>Noah C0 Coverage Information - RCov</h1>
<noscript><style type="text/css">.if_js { display:none; }</style></noscript>
<div class="filters if_js">
<fieldset>
<label>File Filter:</label>
<select id="file_filter" class="filter">
<option value="all_files">Show All</option>
<option value="lib">lib/</option>
</select>
</fieldset>
<fieldset>
<label>Code Coverage Threshold:</label>
<select id="coverage_filter" class="filter">
<option value="all_coverage">Show All</option>
<option value="10">&lt; 10% Coverage</option><option value="20">&lt; 20% Coverage</option><option value="30">&lt; 30% Coverage</option><option value="40">&lt; 40% Coverage</option><option value="50">&lt; 50% Coverage</option><option value="60">&lt; 60% Coverage</option><option value="70">&lt; 70% Coverage</option><option value="80">&lt; 80% Coverage</option><option value="90">&lt; 90% Coverage</option><option value="100">&lt; 100% Coverage</option>
<option value="110">= 100% Coverage</option>
</select>
</fieldset>
</div>
<div class="report_table_wrapper">
<table class='report' id='report_table'>
<thead>
<tr>
<th class="left_align">Name</th>
<th class="right_align">Total Lines</th>
<th class="right_align">Lines of Code</th>
<th class="left_align">Total Coverage</th>
<th class="left_align">Code Coverage</th>
</tr>
</thead>
<tfoot>
<tr>
<td class="left_align">TOTAL</td>
<td class='right_align'><tt>610</tt></td>
<td class='right_align'><tt>518</tt></td>
<td class="left_align"><div class="percent_graph_legend"><tt class=''>55.25%</tt></div>
<div class="percent_graph">
<div class="covered" style="width:55px"></div>
<div class="uncovered" style="width:45px"></div>
</div></td>
<td class="left_align"><div class="percent_graph_legend"><tt class='coverage_total'>50.58%</tt></div>
<div class="percent_graph">
<div class="covered" style="width:51px"></div>
<div class="uncovered" style="width:49px"></div>
</div></td>
</tr>
</tfoot>
<tbody>
<tr class="all_files all_coverage 50 60 70 80 90 100 even">
<td class="left_align"><a href="noah_rb.html">noah.rb</a></td>
<td class='right_align'><tt>325</tt></td>
<td class='right_align'><tt>283</tt></td>
<td class="left_align"><div class="percent_graph_legend"><tt class=''>48.31%</tt></div>
<div class="percent_graph">
<div class="covered" style="width:48px"></div>
<div class="uncovered" style="width:52px"></div>
</div></td>
<td class="left_align"><div class="percent_graph_legend"><tt class=''>42.40%</tt></div>
<div class="percent_graph">
<div class="covered" style="width:42px"></div>
<div class="uncovered" style="width:58px"></div>
</div></td>
</tr>
<tr class="all_files all_coverage 60 70 80 90 100 lib odd">
<td class="left_align"><a href="lib-helpers_rb.html">lib/helpers.rb</a></td>
<td class='right_align'><tt>55</tt></td>
<td class='right_align'><tt>45</tt></td>
<td class="left_align"><div class="percent_graph_legend"><tt class=''>54.55%</tt></div>
<div class="percent_graph">
<div class="covered" style="width:55px"></div>
<div class="uncovered" style="width:45px"></div>
</div></td>
<td class="left_align"><div class="percent_graph_legend"><tt class=''>57.78%</tt></div>
<div class="percent_graph">
<div class="covered" style="width:58px"></div>
<div class="uncovered" style="width:42px"></div>
</div></td>
</tr>
<tr class="all_files all_coverage 70 80 90 100 lib even">
<td class="left_align"><a href="lib-models_rb.html">lib/models.rb</a></td>
<td class='right_align'><tt>230</tt></td>
<td class='right_align'><tt>190</tt></td>
<td class="left_align"><div class="percent_graph_legend"><tt class=''>65.22%</tt></div>
<div class="percent_graph">
<div class="covered" style="width:65px"></div>
<div class="uncovered" style="width:35px"></div>
</div></td>
<td class="left_align"><div class="percent_graph_legend"><tt class=''>61.05%</tt></div>
<div class="percent_graph">
<div class="covered" style="width:61px"></div>
<div class="uncovered" style="width:39px"></div>
</div></td>
</tr>
</tbody>
</table>
</div>
<p>Generated on 2011-01-27 21:32:12 -0500 with <a href="http://github.com/relevance/rcov">rcov 0.9.8</a></p>
<script type="text/javascript">
$(document).ready(function(){$("#report_table").tablesorter({widgets: ['zebra'], textExtraction: 'complex'});});
$('.filter').change(function(){
ff = $('#file_filter').val();
cf = $('#coverage_filter').val();
$('table#report_table tbody tr').each(function(i){
if ((this.className.split(" ").indexOf(ff) > -1) && (this.className.split(" ").indexOf(cf) > -1)) {
this.style.display = "";
} else {
this.style.display = "none";
};
restripe();
})
})
</script>
</body>
</html>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* Hide controls */
body {
color: #000000;
background-color: #ffffff;
}
/* Hide controls */
div.filters {
display: none;
}
\ No newline at end of file
function toggleCode( id ) {
if ( document.getElementById ) {
elem = document.getElementById( id );
} else if ( document.all ) {
elem = eval( "document.all." + id );
} else {
return false;
}
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block";
} else {
elemStyle.display = "none";
}
return true;
}
function restripe() {
i = 0;
$('table#report_table tbody tr').each(function(){
if (this.style.display != "none") {
i += 1;
classes = this.className.split(" ");
if ($.inArray("even",classes) != -1) {
classes.splice($.inArray("even",classes),1);
} else if ($.inArray("odd",classes) != -1) {
classes.splice($.inArray("odd",classes),1);
}
if (i % 2 === 0) {
this.className = classes.join(" ") + " odd";
} else {
this.className = classes.join(" ") + " even";
}
}
});
}
// Fix IE's lack of support for indexOf (!)
if (!Array.indexOf) { Array.prototype.indexOf = function(obj){ for(var i=0; i<this.length; i++){ if(this[i]==obj){return i;} } return -1; }}
\ No newline at end of file
/* @group General */
body {
font-family: Verdana, Helvetica, Arial, Sans-Serif;
font-size: 12px;
color: #4C4C4C;
background-color: #F4F2ED;
padding: 1em;
}
a:link {
color: #191919;
}
a:visited {
color: #191919;
}
pre, code {
color: #000000;
font-family: "Bitstream Vera Sans Mono","Monaco","Courier New",monospace;
font-size: 95%;
line-height: 1.3em;
margin-top: 0;
margin-bottom: 0;
padding: 0;
word-wrap: break-word;
}
h1, h2, h3, h4, h5, h6 {
margin: 0em 0em 1em 0em;
color: #666666;
}
h1 {
display: block;
font-size: 2em;
letter-spacing: -1px;
}
h2 {
margin-top: -1em;
}
fieldset {
display: inline;
border: 0px;
padding: 0px;
margin-right: 1em;
}
div.filters {
margin-bottom: 1em;
}
.hidden {
display: none;
}
/* @end */
/* @group Cross-References */
span.cross-ref-title {
font-size: 140%;
}
span.cross-ref a {
text-decoration: none;
}
span.cross-ref {
background-color:#f3f7fa;
border: 1px dashed #333;
margin: 1em;
padding: 0.5em;
overflow: hidden;
}
a.crossref-toggle {
text-decoration: none;
}
/* @end */
/* @group Report Table */
div.report_table_wrapper {
min-width: 900px;
}
table.report {
border-collapse: collapse;
border: 1px solid #666666;
width: 100%;
margin-bottom: 1em;
}
table.report tr {
line-height: 1.75em;
}
table.report th {
background: #666666;
color: #ffffff;
text-align: right;
text-transform: uppercase;
font-size: .8em;
font-weight: bold;
padding: 0em .5em;
border: 1px solid #666666;
}
table.report tfoot tr {
background: #dddddd;
font-weight: bold;
padding: .5em;
border: 1px solid #666666;
}
th.left_align, td.left_align {
text-align: left !important;
}
th.right_align, td.right_align {
text-align: right;
padding-right: 2em !important;
}
table.report th.header:hover {
cursor: pointer;
text-decoration: underline;
}
table.report th.headerSortUp:after{
content: "\25BC";
margin-left: 1em;
}
table.report th.headerSortDown:after {
content: "\25B2";
margin-left: 1em;
}
table.report tr.summary_row {
background: #cccccc;
border: 1px solid #cccccc;
}
table.report tr.summary_row td {
padding-left: .2em !important;
color: #333333;
font-weight: bold;
}
table.report td {
padding: .2em .5em .2em .5em;
}
table.report td a {
text-decoration: none;
}
table.report tbody tr:hover {
background: #cccccc !important;
}
table.report tr.summary_row td {
border-bottom: 1px solid #aaaaaa;
}
table.report tr {
background-color: #eeeeee;
}
table.report tr.odd {
background-color: #dddddd;
}
/* @end */
/* @group Percentage Graphs */
div.percent_graph_legend {
width: 5.5em;
float: left;
margin: .5em 1em .5em 0em;
height: 1em;
line-height: 1em;
}
div.percent_graph {
height: 1em;
border: #333333 1px solid;
empty-cells: show;
padding: 0px;
border-collapse: collapse;
width: 100px !important;
float: left;
margin: .5em 1em .5em 0em;
}
div.percent_graph div {
float: left;
height: 1em;
padding: 0px !important;
}
div.percent_graph div.covered {
background: #649632;
}
div.percent_graph div.uncovered {
background: #a92730;
}
div.percent_graph div.NA {
background: #eaeaea;
}
/* @end */
/* @group Details page */
table.details {
margin-top: 1em;
border-collapse: collapse;
width: 100%;
border: 1px solid #666666;
}
table.details tr {
line-height: 1.75em;
}
table.details td {
padding: .25em;
}
span.inferred, span.inferred1, span.marked, span.marked1, span.uncovered, span.uncovered1 {
display: block;
padding: .25em;
}
tr.inferred td, span.inferred {
background-color: #e0dedb;
}
tr.inferred1 td, span.inferred1 {
background-color: #e0dedb;
}
tr.marked td, span.marked, span.marked1 {
background-color: #bed2be;
}
tr.uncovered td, span.uncovered {
background-color: #ce8b8c;
}
tr.uncovered1 td, span.uncovered1 {
background-color: #ce8b8c;
}
div.key {
border: 1px solid #666666;
margin: 1em 0em;
}
/* @end */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment