You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by dj...@apache.org on 2009/05/21 03:19:15 UTC
svn commit: r776915 - /buildr/trunk/doc/more_stuff.textile
Author: djspiewak
Date: Thu May 21 01:19:14 2009
New Revision: 776915
URL: http://svn.apache.org/viewvc?rev=776915&view=rev
Log:
Added documentation for the cobertura:check task
Modified:
buildr/trunk/doc/more_stuff.textile
Modified: buildr/trunk/doc/more_stuff.textile
URL: http://svn.apache.org/viewvc/buildr/trunk/doc/more_stuff.textile?rev=776915&r1=776914&r2=776915&view=diff
==============================================================================
--- buildr/trunk/doc/more_stuff.textile (original)
+++ buildr/trunk/doc/more_stuff.textile Thu May 21 01:19:14 2009
@@ -207,7 +207,7 @@
You can use "Cobertura":http://cobertura.sourceforge.net/ or "Emma":http://emma.sourceforge.net/ to instrument your code, run the tests and create a test coverage report in either HTML or XML format.
-There are two tasks for each tool, both of which generate a test coverage report in the @reports/cobertura@ (respectively @reports/emma@) directory. For example:
+There are two main tasks for each tool, both of which generate a test coverage report in the @reports/cobertura@ (respectively @reports/emma@) directory. For example:
{% highlight sh %}
$ buildr test cobertura:html
@@ -234,6 +234,20 @@
Emma has @include@ and @exclude@ methods too, but they take glob patterns instead of regexps.
+Cobertura also provides a @cobertura:check@ task. This task is intended to be used as a dependency for other tasks (such as @deploy@) which might wish to fail if coverage is unacceptable. The respective thresholds for task failure may be defined using the @cobertura.check@ configuration namespace. For example:
+
+{% highlight ruby %}
+define 'someModule' do
+ cobertura.check.branch_rate = 75
+ cobertura.check.line_rate = 100
+ cobertura.check.total_line_rate = 98
+
+ task(:deploy).enhance 'cobertura:check'
+end
+{% endhighlight %}
+
+The @cobertura:check@ task supports all of the configuration parameters allowed by the @cobertura-check@ Ant task (as "documented here":http://cobertura.sourceforge.net/anttaskreference.html). Configuration parameters are "Ruby-ized" (as demonstrated in the example above).
+
You can use "JDepend":http://clarkware.com/software/JDepend.html on to generate design quality metrics. There are three tasks this time, the eye candy one:
{% highlight sh %}