You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Babu Naidu <pb...@gmail.com> on 2009/11/19 17:05:55 UTC

How to add a debug switch similar to test=no

Hi,

I want to run my tests in debug mode by having  test.using :java_args =>
%w(-Xdebug -Xrunjdwp:transport=dt_socket,
server=y,suspend=y,address=8453 -Xms128m -Xmx256m) in my project. This is
well and good, however this enables tests to run in debug mode all the time.
How do I add a switch similar to test=no (that we pass on command line to
shutoff tests execution), for example debug=true, so that I can run my tests
in debug mode with that switch?

Thanks
Babu

Re: How to add a debug switch similar to test=no

Posted by Alex Boisvert <al...@gmail.com>.
Buildr automatically binds any variable assignment from the command-line
into environment variables. For example,

buildr foo=bar

means the environment variable "foo" is set to "bar" and you can use it in
your buildfile as such:

if ENV['foo']
  test.using :java_args => "..."
end

alex

On Thu, Nov 19, 2009 at 8:05 AM, Babu Naidu <pb...@gmail.com> wrote:

> Hi,
>
> I want to run my tests in debug mode by having  test.using :java_args =>
> %w(-Xdebug -Xrunjdwp:transport=dt_socket,
> server=y,suspend=y,address=8453 -Xms128m -Xmx256m) in my project. This is
> well and good, however this enables tests to run in debug mode all the
> time.
> How do I add a switch similar to test=no (that we pass on command line to
> shutoff tests execution), for example debug=true, so that I can run my
> tests
> in debug mode with that switch?
>
> Thanks
> Babu
>