You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Freaky-namuH <ac...@gmail.com> on 2008/04/15 14:22:38 UTC

Cobertura integration

Hi All,

I'm having trouble tracking down easy examples of doing things such as
running code coverage with unit tests.

I know you can do a simple "buildr cobertura:html" which works well,
but what I'd like is to run cobertura as part of the normal test
cycle.  i.e. buildr build , which then does cobertura:html,
junit:report and anything else.

Where do I add it within my module block?

  define "my-project" do

    compile.with  # Add classpath dependencies
    resources

    test.compile.with # Add classpath dependencies
    test.resources
# cobertura:html
    package(:jar)
  end

Cheers,

Ashley 
-- 
View this message in context: http://www.nabble.com/Cobertura-integration-tp16700152p16700152.html
Sent from the Buildr - User mailing list archive at Nabble.com.


Re: Cobertura integration

Posted by Alex Boisvert <bo...@intalio.com>.
On Tue, Apr 15, 2008 at 5:22 AM, Freaky-namuH <ac...@gmail.com> wrote:

> I'm having trouble tracking down easy examples of doing things such as
> running code coverage with unit tests.
>
> I know you can do a simple "buildr cobertura:html" which works well,
> but what I'd like is to run cobertura as part of the normal test
> cycle.  i.e. buildr build , which then does cobertura:html,
> junit:report and anything else.
>
> Where do I add it within my module block?
>

Add the following line in your block,

  task("build" => "cobertura:html")

which instructs buildr (actually, rake) to create a dependency between the
"build" task and the "cobertura:html" task.

alex


>
>  define "my-project" do
>
>    compile.with  # Add classpath dependencies
>    resources
>
>    test.compile.with # Add classpath dependencies
>    test.resources
> # cobertura:html
>    package(:jar)
>  end
>
> Cheers,
>
> Ashley
> --
> View this message in context:
> http://www.nabble.com/Cobertura-integration-tp16700152p16700152.html
> Sent from the Buildr - User mailing list archive at Nabble.com.
>
>